Proxy Country allows you to specify the geographic location from which your scraping requests originate. This feature enables access to geo-restricted content, region-specific pricing, and localized search results by routing your requests through residential IP addresses in your chosen country. Many websites serve different content based on the visitor’s location. Proxy Country addresses this challenge by allowing your requests to appear to originate from any of 190+ supported countries, thereby providing access to region-specific data that would otherwise be unavailable.

How Proxy Country works

When you specify a country code with the proxy_country parameter, ZenRows routes your request through a residential IP address located in that country. The target website recognizes your request as coming from a real user in the specified location, enabling you to access geo-restricted content and view localized results. Proxy Country requires Premium Proxy to be enabled, as only residential IP addresses can provide accurate geolocation. Datacenter proxies cannot reliably represent specific geographic locations.

Basic usage

Enable Proxy Country by adding both premium_proxy=true and proxy_country parameters to your request:
# pip install requests
import requests

url = 'https://httpbin.io/anything'
apikey = 'YOUR_ZENROWS_API_KEY'
params = {
    'url': url,
    'apikey': apikey,
    'premium_proxy': 'true',
    'proxy_country': 'es',
}
response = requests.get('https://api.zenrows.com/v1/', params=params)
print(response.text)

Common use cases

E-commerce price monitoring

Monitor pricing across different regions:
Python
countries = ['us', 'gb', 'de', 'fr', 'jp']
product_url = 'https://example-store.com/product/123'

for country in countries:
    response = requests.get('https://api.zenrows.com/v1/', params={
        'url': product_url,
        'apikey': 'YOUR_ZENROWS_API_KEY',
        'premium_proxy': 'true',
        'proxy_country': country,
    })
    
    # Extract and compare prices for each region
    print(f"Price in {country}: {extract_price(response.text)}")

Search engine localization

Get search results as they appear in different countries:
Python
search_query = 'best restaurants'
search_url = f'https://www.google.com/search?q={search_query}'

# Get US results
us_response = requests.get('https://api.zenrows.com/v1/', params={
    'url': search_url,
    'apikey': 'YOUR_ZENROWS_API_KEY',
    'premium_proxy': 'true',
    'proxy_country': 'us',
})

# Get ES results  
uk_response = requests.get('https://api.zenrows.com/v1/', params={
    'url': search_url,
    'apikey': 'YOUR_ZENROWS_API_KEY',
    'premium_proxy': 'true',
    'proxy_country': 'es',
})

Content availability testing

Check if content is accessible from different regions:
Python
def test_content_availability(url, countries):
    results = {}
    
    for country in countries:
        response = requests.get('https://api.zenrows.com/v1/', params={
            'url': url,
            'apikey': 'YOUR_ZENROWS_API_KEY',
            'premium_proxy': 'true',
            'proxy_country': country,
        })
        
        results[country] = {
            'accessible': response.status_code == 200,
            'status_code': response.status_code,
        }
    
    return results

# Test video availability across regions
video_url = 'https://streaming-service.com/video/123'
availability = test_content_availability(video_url, ['us', 'ca', 'gb', 'au'])

Best practices

Choose appropriate countries

Select countries based on your specific needs:
  • US (us) - For American content
  • GB (gb) - For UK-specific results
  • DE (de) - For German/EU content
  • JP (jp) - For Japanese content data
  • CA (ca) - For Canadian content
See our complete list of countries here!

Handle region-specific layouts

Some websites serve different HTML structures by region:
Python
def extract_data_by_region(html_content, country):
    if country in ['us', 'ca']:
        # North American layout
        return extract_with_us_selectors(html_content)
    elif country in ['gb', 'de', 'fr']:
        # European layout
        return extract_with_eu_selectors(html_content)
    else:
        # Default extraction
        return extract_with_default_selectors(html_content)

Implement country fallbacks

If a specific country doesn’t work, try alternatives:
Python
def scrape_with_fallback(url, preferred_countries):
    for country in preferred_countries:
        try:
            response = requests.get('https://api.zenrows.com/v1/', params={
                'url': url,
                'apikey': 'YOUR_ZENROWS_API_KEY',
                'premium_proxy': 'true',
                'proxy_country': country,
            })
            
            if response.status_code == 200:
                return response, country
                
        except Exception as e:
            print(f"Failed with {country}: {e}")
            continue
    
    return None, None

# Try US first, then Canada, then UK
response, used_country = scrape_with_fallback(
    'https://example.com', 
    ['us', 'ca', 'gb']
)

Troubleshooting

Common issues and solutions

IssueCauseSolution
Content still geo-blockedWebsite blocks entire regionsTry neighboring countries or different continents
Different layout than expectedRegion-specific website versionsUpdate CSS selectors for each region
Slower response timesDistance from target serversChoose countries closer to the website’s servers
Inconsistent resultsRegional content variationsImplement region-specific data extraction logic

Debugging geo-restrictions

When content remains blocked despite using Proxy Country:
1

Try multiple countries in the same region

Python
eu_countries = ['de', 'fr', 'it', 'es', 'nl']
for country in eu_countries:
    # Test each country
2

Check if the entire region is blocked

Python
test_countries = ['us', 'gb', 'de', 'jp', 'au', 'br']
# Test diverse geographic locations
3

Combine with additional features

  • js_render: Makes the request act like a headles browser
  • wait_for: Waits for a specific CSS element on the target url
  • custom_headers: Enable using custom headers on the request
Python
params = {
    'premium_proxy': 'true',
    'proxy_country': 'us',
    'js_render': 'true', # For JavaScript-heavy sites
    'wait_for': '.content',  # Wait for specific elements
    'custom_headers': 'true', # Enable using custom headers on the request
}
headers = {
    'referer': 'https://www.google.com'
}

Pricing

Proxy Country doesn’t increase the request cost. You pay the Premium Proxy (10 times the standard price) regardless of the country you choose.

Frequently Asked Questions (FAQ)