Home/Blog/Mobile Proxy for Zapier
Tool Integration

Mobile Proxy for Zapier

Zapier's built-in Webhooks action does not expose a proxy field. The clean workaround is Code by Zapier: a Python or JavaScript step inside the Zap that does the HTTP call yourself with full proxy control. Here's the working pattern.

5 min read·Workflow Automation·Last updated: May 2026

Prerequisites

  • Zapier paid plan (Code by Zapier is gated behind Pro+).
  • Mobile proxy slot at mobileproxies.org with HTTP credentials and API key.
  • Storage by Zapier (optional, for stashing credentials and rotating tokens between runs).

Step-by-Step Configuration

STEP 01

Stash credentials in Zapier env

Add a Code by Zapier action and use input data fields for the proxy host, user, and password. Mark them as input vars so they appear in Zap settings — never hard-code passwords inside the script (they show up in run history).

# Input Data (set in the Zap UI, not in code):
#   PROXY_HOST  → proxy.mobileproxies.org
#   PROXY_PORT  → 8000
#   PROXY_USER  → u_4a9c
#   PROXY_PASS  → p_2X7q...
#   API_KEY     → YOUR_API_KEY
#   TARGET_URL  → resolved from the trigger step
STEP 02

Python Code by Zapier step

Zapier's Python runtime has requests pre-installed. Paste this into the Code field:

import requests

user = input_data['PROXY_USER']
pwd  = input_data['PROXY_PASS']
host = input_data['PROXY_HOST']
port = input_data['PROXY_PORT']
url  = input_data['TARGET_URL']

proxy_url = f"http://{user}:{pwd}@{host}:{port}"
proxies = { "http": proxy_url, "https": proxy_url }

r = requests.get(url, proxies=proxies, timeout=25,
                 headers={"User-Agent": "Mozilla/5.0 (iPhone)"})

output = {
    "status": r.status_code,
    "body":   r.text[:50000],     # Zapier caps Code output ~6MB total
    "egress_ip": requests.get("https://api.ipify.org",
                              proxies=proxies, timeout=10).text,
}
STEP 03

JavaScript variant (Node 18)

If you prefer JS, Code by Zapier ships fetch but not https-proxy-agent. Use require('http').request through the proxy CONNECT method, or call a relay you control:

// JS Code by Zapier (simpler path: use Zapier "StoreClient" for cred storage)
const { PROXY_USER, PROXY_PASS, PROXY_HOST, PROXY_PORT, TARGET_URL } = inputData;

const auth = Buffer.from(`${PROXY_USER}:${PROXY_PASS}`).toString('base64');

// Outbound through a Cloudflare Worker relay you operate that forwards
// to the mobile proxy — avoids the missing https-proxy-agent issue.
const res = await fetch('https://relay.your-domain.com/fetch', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ url: TARGET_URL, proxy: `http://${PROXY_USER}:${PROXY_PASS}@${PROXY_HOST}:${PROXY_PORT}` }),
});

return { status: res.status, body: (await res.text()).slice(0, 50000) };
STEP 04

Pipe the output to downstream steps

Anything you set on the output dict (Python) or returned object (JS) becomes available as merge fields for later steps — Slack, Airtable, Google Sheets, Gmail, etc.

STEP 05

Rotate via Webhooks before the Code step

Add a Webhooks by Zapier → POST action above the Code step that rotates the IP. The Webhook step doesn't need a proxy itself — it just calls our control plane.

URL:       https://buy.mobileproxies.org/api/v1/proxies/us-mob-01/switch
Method:    POST
Headers:   Authorization: Bearer YOUR_API_KEY
Payload:   {}

Verify It Works

Run the Zap once and inspect the Code step output. The egress_ip field is the public IP the request used — paste it intohttps://ipinfo.io and confirm the ASN is a mobile carrier. If you see Zapier's own AWS range, the proxy URL didn't apply (usually a typo in the env field).

Rotating IPs Between Runs

For Zaps that run on a schedule, simply chain the rotation Webhook + 5–10s delay (using Delay by Zapier) before the Code step. For multi-step loops that rotate mid-Zap, use Looping by Zapier with a counter stored in Storage by Zapier:

# Pattern: rotate every 20 iterations
counter = int(StoreClient(input_data['STORE_KEY']).get('counter') or 0)
if counter % 20 == 0:
    requests.post(
        "https://buy.mobileproxies.org/api/v1/proxies/us-mob-01/switch",
        headers={"Authorization": f"Bearer {input_data['API_KEY']}"},
        timeout=10,
    )
StoreClient(input_data['STORE_KEY']).set('counter', counter + 1)

Common Errors

"requests.exceptions.ProxyError: HTTPSConnectionPool…"

Usually a misspelled host. Zapier's Python runtime can't resolve hosts that don't have public DNS — confirm proxy.mobileproxies.org resolves with dig locally.

"Code step exceeded 10MB output limit"

Trim response bodies before returning. r.text[:50000] is plenty for downstream parsing; store the full body in S3 or a webhook receiver if you need it.

Webhooks step always egresses from AWS

Expected — the Webhooks built-in action does not support proxies. Move that call into the Code step so it runs through the mobile proxy.

Related Guides

Add Mobile IPs to Any Zap

$5 trial. Drop the proxy URL into a Code by Zapier step and your Zap egresses from a real carrier IP.