Skip to main content

Apify Proxy Configuration 2026: Residential, Datacenter & Sessions

· 4 min read
Yassine El Haddad
Software Developer & Automation Specialist

I build production AI agents, web scrapers, and automation pipelines. Most of what I publish here comes from the actual problems they run into: proxies that get banned, anti-bot stacks that fingerprint your client, RAG that drifts when the underlying data moves. Stack: Python, TypeScript, Go, FastAPI, LangChain, Crawlee, Playwright, deployed on AWS, GCP, and Cloudflare.

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

TypeCost modelBest forBlock rate
DatacenterPer proxy / IP countEasy sites, APIs, high volumeHigher on strict sites
ResidentialPer GB trafficAmazon, LinkedIn, anti-bot targetsLower
AutoDefault mixGeneral use, let Apify chooseVariable

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

ScenarioRecommendation
Blog, docs, public APIDatacenter or auto
E-commerce (Amazon, etc.)Residential
LinkedIn, socialResidential, often with browser
Google SERPUse Apify SERP Actors or dedicated SERP proxy if available
High volume, low sensitivityDatacenter
Budget limitsDatacenter 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

  1. Switch to residential for strict targets.
  2. Add countryCode when the target is region-specific.
  3. Lower concurrency to reduce rate-limit pressure.
  4. Use sessions when the site ties state to IP (carts, login).
  5. Block heavy resources to cut residential traffic cost.

Track success rate and cost per page. Adjust proxy strategy per domain, not globally.

Apify Affiliate Banner 728x90Apify Affiliate Banner 728x90Apify Affiliate Banner 300x50Apify Affiliate Banner 300x50
Next step

Run a small test with datacenter, then residential, on your target. Compare block rate and cost. Configure proxies →

Frequently Asked Questions

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.

Common mistakes and fixes

Getting 403 or blocked on target site

Try residential proxies (groups: ['RESIDENTIAL']). Datacenter IPs are often blocked by strict targets.

Residential proxy burning through traffic

Use blockRequests() to skip images/fonts. Residential is priced by data; datacenter by IP count.