Shifter와 함께 사용 Zapier
Zapier는 기본 프록시 필드를 제공하지 않지만, Code by Zapier 액션과 Webhooks by Zapier 액션 모두 몇 줄의 JavaScript 또는 Python 코드로 Shifter의 Web Scraping API를 통해 아웃바운드 요청을 보낼 수 있게 해줍니다.
빠른 시작
설치
// Add a 'Code by Zapier' or 'Webhooks by Zapier' action — no install required. 기본 사용법
// In a "Code by Zapier" (Run JavaScript) action:
const apiKey = inputData.shifter_api_key;
const targetUrl = inputData.target_url;
const country = inputData.country || "us";
const params = new URLSearchParams({
api_key: apiKey,
url: targetUrl,
country: country,
render_js: "1",
session_id: inputData.zap_run_id, // sticky residential IP for this run
});
const response = await fetch(`https://scrape.shifter.io/v1?${params}`);
const html = await response.text();
output = { html, status: response.status, length: html.length }; 기능
예시
Zapier 코드 — 스티키 세션을 사용한 JavaScript
Shifter Web Scraping API를 통해 페이지를 가져오는 사용자 지정 JS 단계를 실행하세요. Zap 실행 ID에서 파생된 session_id를 전달하여 실행의 모든 단계가 하나의 레지덴셜 IP를 공유하도록 합니다.
// "Code by Zapier" action -> Run JavaScript
//
// inputData.target_url -> https://example.co.uk/products
// inputData.country -> "uk"
// inputData.shifter_api_key -> your Shifter API key (Storage by Zapier secret)
// inputData.zap_run_id -> Zap run id from the trigger
const params = new URLSearchParams({
api_key: inputData.shifter_api_key,
url: inputData.target_url,
country: inputData.country || "us",
render_js: "1", // headless browser
session_id: inputData.zap_run_id, // sticky IP per Zap run
});
const response = await fetch(`https://scrape.shifter.io/v1?${params}`);
const html = await response.text();
// Extract a value with a regex — Zapier's Code action doesn't bundle cheerio.
const titleMatch = html.match(/<title>([\s\S]*?)<\/title>/i);
const priceMatch = html.match(/class=["']price["'][^>]*>([^<]+)/i);
output = {
status: response.status,
title: titleMatch?.[1]?.trim(),
price: priceMatch?.[1]?.trim(),
length: html.length,
}; Zapier 코드 — Python (urllib)
Zapier의 Python 런타임은 Web Scraping API를 호출하고 응답을 파싱하기에 충분합니다. Python으로 작성하고 표준 라이브러리에 접근해야 할 때 유용합니다.
# "Code by Zapier" action -> Run Python
import urllib.request
import urllib.parse
import re
params = urllib.parse.urlencode({
"api_key": input_data["shifter_api_key"],
"url": input_data["target_url"],
"country": input_data.get("country", "us"),
"render_js": "1",
"session_id": input_data["zap_run_id"],
})
req = urllib.request.Request(
f"https://scrape.shifter.io/v1?{params}",
headers={"User-Agent": "ZapierShifterClient/1.0"},
)
with urllib.request.urlopen(req, timeout=30) as resp:
html = resp.read().decode("utf-8", errors="replace")
status = resp.status
# Extract whatever the Zap needs.
title = (re.search(r"<title>(.*?)</title>", html, re.IGNORECASE | re.DOTALL) or [None, ""])[1].strip()
prices = re.findall(r'class="price"[^>]*>([^<]+)', html)
return {
"status": status,
"title": title,
"prices": prices[:10],
} Zapier의 Webhooks: 커스텀 요청
Zap이 Code 단계를 허용하지 않는 경우(일부 플랜), Webhooks by Zapier의 'Custom Request' 액션을 사용하여 쿼리 파라미터로 Web Scraping API를 직접 호출하세요.
# Action: Webhooks by Zapier -> Custom Request
#
# Method: GET
# URL: https://scrape.shifter.io/v1
# Query String Params:
# api_key = {{credentials.shifter_api_key}}
# url = {{trigger.target_url}}
# country = us
# render_js = 1
# session_id = {{trigger.zap_run_id}}
#
# Headers:
# User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
#
# Output:
# The response body is the fully-rendered HTML, returned to Zapier
# as a single output field. Pipe it into a Filter, Formatter, or
# another Code step to parse what you need.
#
# Notes:
# - session_id uses the Zap run id so all requests within one run
# share the same residential IP (sticky session, 10 min default).
# - country can be sourced from a previous step
# ({{step1.country}}) for per-item geo routing. Zapier의 스토리지 — 시크릿 관리
API 키를 Code actions에 직접 붙여넣지 마세요. Shifter API 키를 암호화하여 Zap 전반에서 재사용하려면 Storage by Zapier(또는 엔터프라이즈 플랜의 Zapier Vault)를 사용하세요.
// One-off setup (run once via Code by Zapier):
//
// await fetch("https://store.zapier.com/api/records", {
// method: "POST",
// headers: { "X-Secret": ZAPIER_STORAGE_SECRET },
// body: JSON.stringify({
// shifter_api_key: "YOUR_SHIFTER_API_KEY",
// }),
// });
//
// Then in any future Zap that needs the Shifter API key:
const storageRes = await fetch(
"https://store.zapier.com/api/records?key=shifter_api_key",
{ headers: { "X-Secret": process.env.ZAPIER_STORAGE_SECRET } },
);
const { shifter_api_key } = await storageRes.json();
const params = new URLSearchParams({
api_key: shifter_api_key,
url: inputData.target_url,
country: "us",
render_js: "1",
session_id: inputData.run_id,
});
const response = await fetch(`https://scrape.shifter.io/v1?${params}`);
// ... use response as in the previous examples 자주 묻는 질문
Zapier와 Shifter 사용에 관한 일반적인 질문.
Not on the standard Webhooks action — Zapier's HTTP layer doesn't expose a proxy field. The supported workarounds are Code by Zapier (run a JavaScript or Python step that calls the Shifter Web Scraping API) or the Webhooks Custom Request action pointed at https://scrape.shifter.io/v1 with the country, render_js, and session_id query params.
Pick Code by Zapier > Run JavaScript (or Python). Inside the step, call https://scrape.shifter.io/v1 with the target URL, your api_key, country, render_js, and session_id as query params. The response body is the fully-rendered HTML. The full setup is about 15 lines of code.
실행 내의 모든 Shifter 호출마다 안정적인 session_id, 즉 Zap 실행 ID, 트리거 레코드 ID 또는 트리거 페이로드의 해시값을 전달하세요. 동일한 session_id를 공유하는 요청은 동일한 레지덴셜 IP를 통해 라우팅됩니다. 세션은 기본적으로 10분 동안 고정 상태를 유지합니다.
예. country 쿼리 파라미터(예: country=uk, country=jp)를 전달하세요. 이전 단계(`{{step1.country}}`)에서 값을 가져오면 Zapier가 각 항목을 적절한 레지덴셜 풀을 통해 라우팅합니다. 이는 지역화된 가격 모니터링이나 다중 지역 SERP 확인에 유용합니다.
Storage by Zapier(무료) 또는 Zapier Vault(엔터프라이즈)를 사용하세요. 둘 다 서버 측에서 비밀 정보를 암호화합니다. API 키를 Code 액션에 직접 붙여넣지 마세요. Zap 기록과 팀 감사 로그에 노출될 수 있습니다.
가벼운 스크래핑(실행당 몇백 페이지 미만, 단일 단계 파싱)의 경우 Zapier + Shifter가 잘 작동합니다. 페이지네이션, 심층 파싱, 수천 개 항목 등 더 무거운 작업의 경우 Zapier의 작업 한도에 부딪히게 됩니다. 이 경우, Zapier에서 n8n이나 맞춤 백엔드를 트리거하고 그곳에서 Shifter를 실행하세요.
Shifter 사용을 함께 시작하기 Zapier
Shifter의 205M+ 레지덴셜 및 ISP 프록시를 Code by Zapier 또는 Webhooks Custom Request를 통해 Zap에 추가하세요. 실행별 스티키 세션, 항목별 지역 설정, 내장 헤드리스 렌더링, Storage / Vault 자격 증명 완전 지원.