Apify Proxy Configuration 2026: Residential, Datacenter & Sessions
Apify Proxy provides datacenter and residential IPs for web scraping. Use datacenter for cheap, fast requests on easy targets. Use residential when targets block datacenter IPs. Sessions keep the same IP across requests when you need cookies or login state. View proxy usage in the Apify Console.
Proxy types at a glance
| Type | Cost model | Best for | Block rate |
|---|---|---|---|
| Datacenter | Per proxy / IP count | Easy sites, APIs, high volume | Higher on strict sites |
| Residential | Per GB traffic | Amazon, LinkedIn, anti-bot targets | Lower |
| Auto | Default mix | General use, let Apify choose | Variable |
Pricing details: apify.com/proxy and apify.com/pricing.
Basic proxy setup in Actor code
Create a proxy configuration and pass it to your crawler:
import { Actor } from 'apify';
import { CheerioCrawler } from 'crawlee';
await Actor.init();
// Datacenter (default) — uses shared proxy pool
const proxyConfiguration = await Actor.createProxyConfiguration();
// Residential — for strict targets
const residentialProxy = await Actor.createProxyConfiguration({
groups: ['RESIDENTIAL'],
countryCode: 'US', // optional: two-letter country code
});
const crawler = new CheerioCrawler({
proxyConfiguration: residentialProxy,
async requestHandler({ $, request }) {
const title = $('title').text();
await Actor.pushData({ url: request.url, title });
},
});
await crawler.run(['https://example.com']);
await Actor.exit();
Datacenter proxy
Default when you call Actor.createProxyConfiguration() with no options. Good for:
- Public APIs
- Sites with light anti-bot
- High request volume
- Cost-sensitive jobs
const proxyConfig = await Actor.createProxyConfiguration();
// Uses auto mode: Apify rotates across available datacenter groups
Session persistence: 26 hours. Use sessionId when you need the same IP for multiple requests.
Residential proxy
Use when datacenter IPs get blocked. Traffic appears from real consumer IPs. Priced by data (GB), not by IP count.
const proxyConfig = await Actor.createProxyConfiguration({
groups: ['RESIDENTIAL'],
countryCode: 'US', // optional
});
Session persistence: 1 minute. Send a request every ~20 seconds to keep the session alive if you need longer.
Tip: Use blockRequests() to skip images, fonts, and analytics. Residential costs scale with traffic.
import { playwrightUtils } from 'crawlee';
// In requestHandler, before loading heavy resources:
await playwrightUtils.blockRequests(page, {
urlPatterns: ['*.jpg', '*.png', '*.woff2', 'google-analytics.com'],
});
Proxy groups and sessions
Groups: RESIDENTIAL, DATACENTER, or group names from your plan. Check available groups in Console → Proxy.
Sessions: Reuse the same IP for multiple requests. Crawlee manages sessions automatically when you set sessionPoolOptions. For raw HTTP:
const proxyUrl = await proxyConfiguration.newUrl('my-session-id');
const response = await gotScraping({ url: targetUrl, proxyUrl });
When to use each type
| Scenario | Recommendation |
|---|---|
| Blog, docs, public API | Datacenter or auto |
| E-commerce (Amazon, etc.) | Residential |
| LinkedIn, social | Residential, often with browser |
| Google SERP | Use Apify SERP Actors or dedicated SERP proxy if available |
| High volume, low sensitivity | Datacenter |
| Budget limits | Datacenter first; upgrade only if blocked |
Exposing proxy in Actor input
Let users choose proxy type via your input schema:
{
"proxyConfiguration": {
"title": "Proxy configuration",
"type": "object",
"editor": "proxy",
"default": { "useApifyProxy": true }
}
}
In code:
const input = await Actor.getInput();
const proxyConfig = await Actor.createProxyConfiguration(input?.proxyConfiguration);
Troubleshooting blocked requests
- Switch to residential for strict targets.
- Add countryCode when the target is region-specific.
- Lower concurrency to reduce rate-limit pressure.
- Use sessions when the site ties state to IP (carts, login).
- Block heavy resources to cut residential traffic cost.
Track success rate and cost per page. Adjust proxy strategy per domain, not globally.
Run a small test with datacenter, then residential, on your target. Compare block rate and cost. Configure proxies →
No. Residential reduces blocks on strict sites but costs more (per GB). Use datacenter for easy targets; escalate to residential only when you see 403/429 or blocks.
Expose proxyConfiguration in your input schema (editor: proxy). Users pick groups and country in the Console. In code, pass it to Actor.createProxyConfiguration(input.proxyConfiguration).
Cost per successful page by domain. Combines reliability and spend. Track 403/429 rates and escalate to residential when blocks rise.
1 minute. Each request resets the timer. To keep it longer, send a request every ~20 seconds. Datacenter sessions last 26 hours.




