Geotargeting (Premium)

In addition to the list of Country Codes listed on the Geotargeting page, our premium geotargeting service offers advanced capabilities for accessing and targeting exclusive geographic locations.

To get access to these geographic locations, please use premium=true together with the country_code parameter:

  • API REQUEST

import requests
payload = {'api_key': 'APIKEY', 'url':'https://httpbin.org/ip', 'country_code': 'lu', 'premium': True}
r = requests.get('https://api.scraperapi.com', params=payload)
print(r.text)
  • PROXY MODE

import requests

# Define the proxy configuration
proxies = {
    "http": "http://scraperapi.country_code=lu.premium=true:API_KEY@proxy-server.scraperapi.com:8001"
}

# Make the request using the proxy
r = requests.get('http://httpbin.org/ip', proxies=proxies, verify=False)

# Print the response text
print(r.text)
  • SDK Method

from scraperapi_sdk import ScraperAPIClient

# Initialize the ScraperAPI client with your API key
client = ScraperAPIClient('API_KEY')

# Make the request with the correct parameters
response = client.get(
    url='http://httpbin.org/ip', 
    params={
        'country_code': 'us',  
        'premium': 'true'
    }
)

# Print the response
print(response)

ZIP Code Geo targeting is currently supported for the Amazon domain. To find out more, please visit this link.

Last updated