Skip to main content
Proxy Configuration

Overview

The ScrapeGraphAI API uses an intelligent proxy system that automatically handles web scraping requests through multiple proxy providers. The system uses a fallback strategy to ensure maximum reliability — if one provider fails, it automatically tries the next one. No configuration required: The proxy system is fully automatic and transparent to API users. You don’t need to configure proxy credentials or settings yourself. In v2, all proxy and fetch behaviour is controlled through the FetchConfig object, which you can pass to any service method (extract, scrape, search, crawl, etc.).

How It Works

The API automatically routes your scraping requests through multiple proxy providers in a smart order:
  1. The system tries different proxy providers automatically
  2. If one provider fails, it automatically falls back to the next one
  3. Successful providers are cached for each domain to improve performance
  4. Everything happens transparently — you just make your API request as normal

Fetch Modes

The mode parameter inside FetchConfig controls how pages are retrieved and which proxy strategy is used: To enable stealth mode (residential proxy with anti-bot headers), set the separate stealth boolean to true alongside any mode. For example, mode: "js" with stealth: true provides JS rendering through a residential proxy — equivalent to the old js+stealth mode.

Country Selection (Geotargeting)

You can optionally specify a two-letter country code via FetchConfig.country to route requests through proxies in a specific country. This is useful for:
  • Accessing geo-restricted content
  • Getting localized versions of websites
  • Complying with regional requirements
  • Testing location-specific features

Using Country Code

Supported Country Codes

The API supports geotargeting for a wide range of countries using ISO 3166-1 alpha-2 country codes:
And many more! The API supports over 100 countries. Use standard ISO 3166-1 alpha-2 country codes.

FetchConfig Reference

All proxy and fetch behaviour is configured through the FetchConfig object:

Usage Examples

Basic Request (Automatic Proxy Selection)

Request with Country Code

Stealth Mode with JS Rendering

Real-World Use Cases

Accessing Geo-Restricted Content

Getting Localized Content

E-commerce Price Comparison

Best Practices

1. Choose the Right Fetch Mode

Pick the mode that matches your target site:
  • auto (default) — let the system decide; works for most sites
  • fast — use for simple, static HTML pages
  • js — use for SPAs and JavaScript-rendered content
  • Add stealth: true for anti-bot sites — combine with any mode (e.g., mode: "js" + stealth: true for dynamic anti-bot sites)

2. Use Country Code When Needed

Only specify a country code if you have a specific requirement:
  • Accessing geo-restricted content
  • Getting localized versions of websites
  • Complying with regional requirements
  • Don’t specify if you don’t need it — let the system optimize automatically

3. Let the System Handle Routing

The API automatically selects the best proxy provider for each request:
  • No manual proxy selection needed
  • Automatic failover ensures reliability
  • Performance is optimized automatically

4. Handle Errors Gracefully

If a request fails, the system has already tried multiple providers:

5. Monitor Rate Limits

Be aware of your API rate limits:
  • The proxy system respects these limits automatically
  • Monitor your usage in the dashboard
  • Implement appropriate delays between requests

Troubleshooting

Request Failures

If your scraping request fails:
  1. Verify the URL: Make sure the URL is correct and accessible
  2. Check the website: Some websites may block automated access regardless of proxy
  3. Try a different mode: Use mode: "js" with stealth: true for heavily-protected sites
  4. Retry the request: The system uses automatic retries, but you can manually retry after a delay
  5. Try a different country: If geo-restriction is the issue, try a different country

Rate Limiting

If you receive rate limit errors (HTTP 429):
  • Wait a few minutes before making new requests
  • The API automatically handles rate limits on proxy providers
  • Consider implementing exponential backoff in your application
  • Check your API usage limits in the dashboard

Geo-Restricted Content

If you’re trying to access geo-restricted content:
  • Use the country parameter inside FetchConfig to specify the required country
  • Make sure the content is available in that country
  • Some content may still be restricted regardless of proxy location
  • Try multiple country codes if one doesn’t work

Anti-Bot Protection

If a website is blocking your requests:
  • Set stealth: true in FetchConfig (combine with mode: "js" for dynamic sites)
  • Add a wait time to let the page fully load
  • Use scrolls to trigger lazy-loaded content
  • Add custom headers if the site expects specific ones

FAQ

A: No, the proxy system is fully managed and automatic. You don’t need to provide any proxy credentials or configuration.
A: Use the mode parameter in FetchConfig (auto, fast, or js) and set stealth: true when you need residential proxy with anti-bot headers.
A: No, the system automatically selects the best proxy provider for each request. You can influence the strategy by setting the mode parameter.
A: The API will return an error. The system tries multiple providers with automatic fallback, so this is rare. If it happens, verify the URL and try again.
A: No, the country parameter doesn’t affect pricing. Credits are charged the same regardless of proxy location.
A: Yes, FetchConfig is available for all services including extract, scrape, search, crawl, and monitor.
A: Both uk and gb refer to the United Kingdom. The API accepts both codes for compatibility.

Support & Resources

API Reference

Detailed API documentation

Dashboard

Monitor your API usage and credits

Community

Join our Discord community

GitHub

Check out our open-source projects

Need Help?

Contact our support team for assistance with proxy configuration, geotargeting, or any other questions!