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

require 'net/http'
require 'json'
params = {
:api_key => "API_KEY",
:country_code => "lu",
:premium => true,
:url => "http://httpbin.org/ip"
}
uri = URI('http://api.scraperapi.com/')
uri.query = URI.encode_www_form(params)
website_content = Net::HTTP.get(uri)
print(website_content)
  • PROXY MODE

require 'httparty'
HTTParty::Basement.default_options.update(verify: false)
response = HTTParty.get('http://httpbin.org/ip', {
  http_proxyaddr: "proxy-server.scraperapi.com",
  http_proxyport: "8001",
  http_proxyuser: "scraperapi.country_code=lu.premium=true",
  http_proxypass: "API_KEY"
})
results = response.body
puts results 
  • SDK METHOD

# remember to install the library: gem install scraperapi
require 'scraper_api'
client = ScraperAPI::Client.new("API_KEY")
result = client.get("http://httpbin.org/ip", country_code: 'lu', premium: true).raw_body
puts result

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

Last updated