search docs
Edit

Residential proxy

Achieve a higher level of anonymity using real IP addresses. Access a wider pool of proxies and reduce blocking by websites' anti-scraping measures.

Residential proxies are connected to real Internet Service Provider-based proxies located in homes and offices. Unlike datacenter proxies, this makes them very hard to block.

This solution allows you access to a larger pool of servers than datacenter proxy. This makes it a better option in cases when you need a large number of different IP addresses.

Residential proxies support IP address rotation and sessions.

Pricing is based on data traffic. It is measured for each connection made and displayed on your dashboard in the Apify app.

If you would like to use residential proxy or for more information, contact us.

Connecting to residential proxy

Connecting to residential proxy works the same way as datacenter proxy, with two differences.

  1. The groups username parameter should always specify RESIDENTIAL.

  2. You can specify the country in which you want your proxies to be.

How to set a proxy group

When using standard libraries and languages, specify the groups parameter in the username as groups-RESIDENTIAL.

For example, your proxy URL when using the got JavaScript library will look like this:

1
const proxyUrl = "http://groups-RESIDENTIAL:<YOUR_PROXY_PASSWORD>@proxy.apify.com:8000";

In the Apify SDK, you set the group in your proxy configuration:

1
2
3
const proxyConfiguration = await Apify.createProxyConfiguration({
        groups: ['RESIDENTIAL'],
});

How to set proxy country

When using standard libraries and languages, specify the country parameter in the username as country-COUNTRY-CODE.

For example, your username parameter when using Python 3 will look like this:

1
username = f"groups-RESIDENTIAL,session-my_session,country-JP"

In the Apify SDK, you set the country in your proxy configuration using two-letter country codes. Specify the groups as RESIDENTIAL, then add a country parameter.

1
2
3
4
const proxyConfiguration = await Apify.createProxyConfiguration({
        groups: ['RESIDENTIAL'],
        country: 'FR',
});

Username examples

Use randomly allocated IP addresses from all available countries:

1
groups-RESIDENTIAL

A random proxy from the US:

1
groups-RESIDENTIAL,country-US

Set a session and select an IP address from the United States:

1
groups-RESIDENTIAL,session-my_session_1,country-US

Session persistence

When using residential proxy with the session parameter set in the username, a single IP address is assigned to the session ID provided after you make the first request.

Session IDs represent IP addresses. Therefore, you can manage the IP addresses you use by managing sessions. [More info]

This IP/session ID combination persists for 1 minute. Each subsequent request resets the expiration time to 1 minute.

If the proxy server becomes unresponsive or the session expires, a new IP address is selected for the next request.

If you really need to persist the same session, you can try sending some data using that session (e.g. every 20 seconds) to keep it alive.
Providing the connection is not interrupted, this will let you keep the IP address for longer.

To learn more about sessions and IP address rotation, see the proxy overview page.