Your own proxies in Apify: actor input and SDK

How to route an Apify actor through Sous proxies: via the proxy setting in the actor input, or via proxyUrls in SDK code.

HTTPLogin and passwordRotation and sticky
Apify · proxy
Own proxies
http://user123:••••••@gate.sousproxy.com:10000
✓ IP: Germany, residentialSave

Why use a proxy in Apify

Apify is a cloud platform for scrapers and bots called actors. The platform has its own Apify Proxy, but the SDK also lets you pass your own proxies as a list of URLs. Your own proxies let you pick the country and type of addresses.

What to pick

For scraping take residential proxies in rotation: each crawler request leaves from a new IP. If the actor logs into an account or goes through a multi-step form, export a sticky session. Pass the line as a URL with the protocol and the login and password.

Residential

from $0.6 / GB

Home ISP addresses. The main choice for accounts and protected sites.

VIP

$2 / GB

Hand-picked clean IPs, faster and more stable than regular residential.

Mobile

$4 / GB

Carrier IPs, for platforms that check addresses strictly.

Step-by-step setup

Button names are given exactly as they appear in Apify.

  1. A URL like http://login:pass@host:port

    Apify takes your own proxies as a list of URLs. Export a line with the http:// prefix and the login and password inside in @SousProxyBot. Escape special characters in the password, or the URL parses wrong.

  2. Input → Proxy and browser configuration

    For a ready actor open the «Input» tab in the console, scroll down and expand «Proxy and browser configuration». It exists only for actors whose input schema describes it. Switch from Apify Proxy to your own and paste the URLs, one per line.

  3. Your own actor: Actor.createProxyConfiguration

    In SDK code pass the list in proxyUrls when creating the configuration; example below. Don't specify Apify Proxy groups then.

  4. proxyConfiguration into the crawler

    Pass the object to a crawler, e.g. CheerioCrawler or PlaywrightCrawler, with the proxyConfiguration option. All the crawler's connections then go through your URLs.

  5. Without a sessionId: round-robin

    With several URLs the SDK hands them out in turn. For scraping one rotating line is enough: the IP changes on our side.

  6. With a sessionId: one line per session

    Calling newUrl with a session id always returns the same line. Pass several Sous sticky sessions and each crawler session is pinned to its own IP.

Code example

Put in your own HOST, PORT, LOGIN and PASSWORD from the bot or the dashboard.

js
import { Actor } from 'apify';

await Actor.init();

const proxyConfiguration = await Actor.createProxyConfiguration({
    proxyUrls: ['http://LOGIN:PASSWORD@HOST:PORT'],
});

const proxyUrl = await proxyConfiguration.newUrl();
console.log('Proxy:', proxyUrl);

await Actor.exit();

Common errors

The issues people most often bring to support.

!

The actor still goes through Apify ProxyThe actor input still has the Apify Proxy setting. Switch it to your own proxies or remove the Apify Proxy groups from the code.

!

Proxy auth errorCheck that the login and password in the URL are right and contain no characters that need escaping. Re-export the line in the bot.

!

The site blocks requestsMake sure the line is in rotation mode and lower the crawler's concurrency.

Need a proxy for Apify?

Residential, VIP and mobile IPs. HTTP and SOCKS5, pay per GB, 1 GB free to try.

FAQ

How does the SDK cycle several proxyUrls?

Per Apify docs, without a sessionId the lines go round-robin. With one sessionId the SDK returns the same line every time.

How do I keep one IP per session?

Export several sticky sessions, pass them in proxyUrls and call newUrl with the session id. Each crawler session is then pinned to its own line and IP.

How many URLs for scraping?

With our rotation one is enough: the IP behind it changes by itself. Traffic is billed in gigabytes.

Does SOCKS5 work?

The proxy management docs show only HTTP URLs. Use a line with the http:// prefix.