Shifter verwenden mit Zapier
Zapier bietet kein natives Proxy-Feld — aber die Aktion "Code by Zapier" und die Aktion "Webhooks by Zapier" ermöglichen es Ihnen, ausgehende Anfragen über Shifters Web Scraping API mit wenigen Zeilen JavaScript oder Python zu senden.
Schnellstart
Installieren
// Add a 'Code by Zapier' or 'Webhooks by Zapier' action — no install required. Grundlegende Nutzung
// 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 }; Funktionen
Beispiele
Code by Zapier — JavaScript mit Sticky Session
Führe einen benutzerdefinierten JS-Schritt aus, der eine Seite über die Shifter Web Scraping API abruft. Übergib eine session_id, die aus der Zap-Lauf-ID abgeleitet wird, damit jeder Schritt in einem Lauf dieselbe Residential IP verwendet.
// "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,
}; Code by Zapier — Python (urllib)
Zapiers Python-Laufzeitumgebung reicht aus, um die Web Scraping API aufzurufen und die Antwort zu verarbeiten. Nützlich, wenn du lieber Python schreibst und Zugriff auf die Standardbibliothek benötigst.
# "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],
} Webhooks by Zapier — Custom Request
Wenn dein Zap keine Code-Schritte erlaubt (bei manchen Tarifen), verwende die Webhooks by Zapier-Aktion 'Custom Request' und rufe die Web Scraping API direkt mit Query-Parametern auf.
# 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. Storage by Zapier — Secret Management
Füge den API-Schlüssel nicht direkt in Code-Aktionen ein. Verwende Storage by Zapier (oder Zapiers Vault bei Enterprise-Tarifen), um deinen Shifter API-Schlüssel verschlüsselt zu speichern und zap-übergreifend wiederzuverwenden.
// 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 Häufig gestellte Fragen
Häufige Fragen zur Verwendung von Shifter mit Zapier.
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.
Übergib bei jedem Shifter-Aufruf innerhalb des Laufs eine stabile session_id — die Zap-Lauf-ID, die Trigger-Datensatz-ID oder einen Hash der Trigger-Nutzlast. Anfragen mit derselben session_id werden über dieselbe Residential IP geleitet. Sitzungen bleiben standardmäßig 10 Minuten lang sticky.
Ja. Übergeben Sie den country-Abfrageparameter (z. B. country=uk, country=jp). Beziehen Sie ihn aus einem vorherigen Schritt (`{{step1.country}}`) und Zapier leitet jedes Element über den entsprechenden Residential-Pool -- nützlich für lokalisiertes Preismonitoring oder Multi-Region-SERP-Prüfungen.
Verwende Storage by Zapier (kostenlos) oder Zapier Vault (Enterprise). Beide verschlüsseln Geheimnisse serverseitig. Vermeide es, den API-Schlüssel direkt in Code-Aktionen einzufügen — er wäre im Zap-Verlauf und in Team-Audit-Protokollen sichtbar.
Für leichtes Scraping (weniger als ein paar hundert Seiten pro Lauf, einstufige Verarbeitung) funktioniert Zapier + Shifter gut. Für umfangreichere Aufgaben — Paginierung, tiefes Parsen, Tausende von Einträgen — stößt du an Zapiers Aufgabenlimits. In diesem Fall empfiehlt es sich, n8n oder ein benutzerdefiniertes Backend von Zapier aus auszulösen und Shifter dort laufen zu lassen.
Shifter verwenden mit Zapier
Fügen Sie Shifters 205M+ Residential- und ISP-Proxys über Code by Zapier oder Webhooks Custom Request zu Ihren Zaps hinzu. Sticky Sessions pro Ausführung, Geo-Targeting pro Element, integriertes Headless-Rendering und vollständige Storage- / Vault-Anmeldedatenunterstützung.