Copy <? 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 ) ;
?>
Copy <? 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 ) ;
Copy <? 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.