
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.How It Works
The API automatically routes your scraping requests through multiple proxy providers in a smart order:- The system tries different proxy providers automatically
- If one provider fails, it automatically falls back to the next one
- Successful providers are cached for each domain to improve performance
- Everything happens transparently - you just make your API request as normal
Country Selection (Geotargeting)
You can optionally specify a country code 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
Include thecountry_code parameter in your API request:
Supported Country Codes
The API supports geotargeting for a wide range of countries using ISO 3166-1 alpha-2 country codes:View All Supported Countries
View All Supported Countries
| Code | Country | Code | Country | Code | Country |
|---|---|---|---|---|---|
us | United States | uk / gb | United Kingdom | ca | Canada |
au | Australia | de | Germany | fr | France |
it | Italy | es | Spain | nl | Netherlands |
be | Belgium | ch | Switzerland | at | Austria |
se | Sweden | no | Norway | dk | Denmark |
fi | Finland | pl | Poland | cz | Czech Republic |
ie | Ireland | pt | Portugal | gr | Greece |
jp | Japan | kr | South Korea | cn | China |
in | India | sg | Singapore | hk | Hong Kong |
mx | Mexico | br | Brazil | ar | Argentina |
cl | Chile | co | Colombia | pe | Peru |
za | South Africa | eg | Egypt | ae | UAE |
sa | Saudi Arabia | il | Israel | tr | Turkey |
ru | Russia | ua | Ukraine | nz | New Zealand |
Available Parameters
The following parameters in API requests can affect proxy behavior:country_code (optional)
- Type: String
- Description: Two-letter ISO country code to route requests through proxies in a specific country
- Example:
"us","uk","de","it","fr" - Default: No specific country (uses optimal routing)
- Format: ISO 3166-1 alpha-2 (e.g.,
us,gb,de)
render_heavy_js (optional)
- Type: Boolean
- Description: Whether to render JavaScript-heavy pages. This may affect which proxy provider is used.
- Default:
false
Usage Examples
Basic Request (Automatic Proxy Selection)
Request with Country Code
Request with JavaScript Rendering and Country Code
Real-World Use Cases
Accessing Geo-Restricted Content
Getting Localized Content
E-commerce Price Comparison
Best Practices
1. 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
2. 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
3. Handle Errors Gracefully
If a request fails, the system has already tried multiple providers:4. 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
Request Failures
Request Failures
If your scraping request fails:
- Verify the URL: Make sure the URL is correct and accessible
- Check the website: Some websites may block automated access regardless of proxy
- Retry the request: The system uses automatic retries, but you can manually retry after a delay
- Try different parameters: Sometimes using
render_heavy_js: truecan help with JavaScript-heavy sites - Try a different country: If geo-restriction is the issue, try a different
country_code
Rate Limiting
Rate Limiting
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
Geo-Restricted Content
Geo-Restricted Content
If you’re trying to access geo-restricted content:
- Use the
country_codeparameter 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
Proxy Selection Issues
Proxy Selection Issues
Proxy Selection Issues
If you’re experiencing proxy-related issues:
- The system automatically tries multiple providers
- No manual configuration is needed
- If issues persist, contact support with your request ID
- Check if the issue is specific to certain websites or domains
FAQ
Do I need to configure proxy credentials?
Do I need to configure proxy credentials?
A: No, the proxy system is fully managed and automatic. You don’t need to provide any proxy credentials or configuration.
Can I choose which proxy provider to use?
Can I choose which proxy provider to use?
A: No, the system automatically selects the best proxy provider for each request. This ensures optimal performance and reliability.
How do I know which proxy was used?
How do I know which proxy was used?
A: The proxy selection is handled automatically and transparently. You don’t need to know which proxy was used - just use the API as normal.
Can I use my own proxies?
Can I use my own proxies?
A: The API uses managed proxy services. If you have specific proxy requirements, please contact support.
What happens if all proxies fail?
What happens if all proxies fail?
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.
Does using country_code cost more?
Does using country_code cost more?
A: No, the
country_code parameter doesn’t affect pricing. Credits are charged the same regardless of proxy location.Can I use country_code with all services?
Can I use country_code with all services?
A: Yes,
country_code is available for all scraping services including SmartScraper, SearchScraper, SmartCrawler, and Markdownify.What's the difference between 'uk' and 'gb' country codes?
What's the difference between 'uk' and 'gb' country codes?
A: Both
uk and gb refer to the United Kingdom. The API accepts both codes for compatibility.API Reference
For detailed API documentation, see: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!