Skip to content
Get Started
G2G2
4.7/5
Excellent
Trustpilot

How to use proxies with Apify

On Apify, open the Actor's Input tab, go to Proxy and browser configuration and enter your own proxy URL, http://USERNAME:PASSWORD@HOST:PORT, instead of Apify Proxy. In your own Actor code, pass the same URL to Actor.createProxyConfiguration({ proxyUrls: [...] }) and give the result to the crawler.

  • Session Control
  • High Speed
  • Privacy First

What you need

Apify runs scrapers (Actors) in the cloud and has its own proxy service built in. If you already have CleanProxies, for example residential GB that never expire or dedicated US ISP IPs, Actors that support custom proxies and the Apify SDK accept your proxy URLs directly.

Your credential line

From the dashboard's proxy manager: host (or IP), port, username and password. Convert lists with the proxy list formatter.

Apify ready

  • An Apify account and an Actor whose input has a proxy configuration field, or your own Actor built with the Apify SDK.
  • For code: npm install apify crawlee (JavaScript) or pip install apify (Python).

Which proxy fits Apify?

Both products use the same setup in Apify. What changes is how long an IP stays with you.

One rotating URL can give each request a new IP from 50M+ residential IPs in 190+ countries. For logins or paginated flows, generate sticky lines (5, 10, 15, 30 or 60 minutes, or 24 hours) and add them as separate URLs.

starting from$0.63/GB

Residential IPs in 190+ countries with country, state and city targeting. Rotate on every request or hold a sticky session for up to 90 minutes; GB never expire.

Add each dedicated US ISP IP as its own URL in proxyUrls. The SDK uses them round-robin, every IP stays the same all month, and bandwidth is unlimited for long monitoring runs.

starting from$0.75/IP

Dedicated static IPs registered to US and Canadian ISPs. The address stays the same for as long as you hold it, with unlimited bandwidth and HTTP(S) or SOCKS5 access.

credentials

Your CleanProxies credentials

Every product connects over HTTP(S); static ISP and ISP subnet proxies also run SOCKS5 and IP whitelisting. This is what the dashboard gives you to paste into Apify.

Static ISP and ISP subnetHTTP(S)SOCKS5IP whitelist
IP:PORT:USER:PASS

One line per dedicated IP. With IP whitelisting on, the line is just IP:PORT and no password is sent.

Rotating residential and mobileHTTP(S)User:pass
HOST:PORT:USER:PASS

Generated in the proxy manager. The username carries the location and session you pick, so generate a new list to change them.

As a URL, for code and most toolshttp://USERNAME:PASSWORD@HOST:PORTsocks5://USERNAME:PASSWORD@HOST:PORT

Use http:// even for HTTPS websites; the TLS session still runs end to end. The socks5:// form is for static ISP and ISP subnet proxies.

How to set up CleanProxies in Apify

Four steps, then check the exit IP with the free proxy checker.

  1. 1

    Build the proxy URL

    In the CleanProxies dashboard, generate a residential line (rotating or sticky, with the country you need) and write it as http://USERNAME:PASSWORD@HOST:PORT.

  2. 2

    Open the Actor's proxy input

    In Apify Console, open the Actor's Input tab and the Proxy and browser configuration section. It only appears for Actors whose input schema defines a proxy field.

  3. 3

    Switch to your own proxies

    Choose the option for your own (custom) proxies instead of Apify Proxy and paste one proxy URL per line.

  4. 4

    Run and check the log

    Start the run. In your own Actors, use the SDK snippets below and log the exit IP once at the start of the run.

copy & paste

Apify proxy examples

Replace the highlighted placeholders with the values from your dashboard. Pick an example to see its code.

Apify + CleanProxies

Custom proxies in the Actor input (JSON)

In the input's JSON view (or a run started through the API), the proxy field is an object. With your own proxies, useApifyProxy is false and proxyUrls lists the URLs. The field name depends on the Actor, often proxyConfiguration or proxy, so check its input schema.

Actor inputJSON
{
  "startUrls": [{ "url": "https://example.com" }],
  "proxyConfiguration": {
    "useApifyProxy": false,
    "proxyUrls": ["http://USERNAME:PASSWORD@HOST:PORT"]
  }
}
fix it fast

Troubleshooting Apify proxy errors

Verify your exit IP

Run the snippet below locally with apify run or as an Actor: it prints the exit IP through the same proxy configuration. Compare it with your CleanProxies line, then remove it from production runs.

Open What is my IP? through the proxy to see the address and headers a website receives, or paste up to ten lines into the free proxy checker to test connectivity, latency and exit IP.

Still stuck? Our 24/7 support team answers fast: contact us with the error and the line you used (leave the password out).

Apify error fixes
  • The run doesn't use your proxyWhy: The Actor's input has no custom proxy support, or useApifyProxy is still true.Set useApifyProxy to false with your proxyUrls, and check the Actor's input schema or README for its proxy field.
  • The crawler runs without any proxyWhy: createProxyConfiguration() returned undefined because the input had useApifyProxy: false and no proxyUrls.Make sure the input object passed in contains proxyUrls.
  • Invalid URL errorsWhy: The line was pasted as HOST:PORT:USERNAME:PASSWORD instead of a URL.Convert it to http://USERNAME:PASSWORD@HOST:PORT with the proxy list formatter.
  • 407 Proxy Authentication RequiredWhy: Wrong credentials, or special characters in the password breaking the URL.Copy the line again and URL-encode the password.
  • Logged-in pages fail halfway through a runWhy: A rotating line changed the IP between requests of the same session.Use sticky residential lines or ISP IPs for any flow that logs in.

Apify proxy guides

Setup guides and best practices from the CleanProxies blog.

Get the latest insightsAll Blogs

More integrations

Setup guides for tools people run next to Apify.

Proxies for sites people reach with Apify
All integrations

Apify proxy FAQs

Straight answers about running CleanProxies in Apify.

Yes. Actors whose input has a proxy configuration field accept custom proxy URLs, and the Apify SDK takes them through createProxyConfiguration with proxyUrls.

Got more questions?All FAQs