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

<?php

$url = "http://api.scraperapi.com?api_key=API_KEY&country_code=lu&premium=true&url=http://httpbin.org/ip";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    print_r($response);
}

curl_close($ch);
?>
  • PROXY MODE

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://httpbin.org/ip");
curl_setopt($ch, CURLOPT_PROXY, "http://scraperapi.country_code=lu.premium=true:API_KEY@proxy-server.scraperapi.com:8001");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
  • SDK METHOD

<?php
require 'vendor/autoload.php'; 

use ScraperAPI\Client; 

$apiKey = 'API_KEY';
$client = new Client($apiKey);

$response = $client->get("http://httpbin.org/ip", [
    "country_code" => "lu",
    "premium" => true
]);

print($response->raw_body);

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

Last updated