Geographic Targeting

With using geographic targeting, you can make requests from the countries that we support.
Geotargeting

Scrape.do allows you to send requests through supported countries using geotargeting. In this way, you can crawl the target web site more easily by focusing on a certain country.

To use geographic targeting, you must fill in the geoCodeattribute.

Beware that you need a Pro plan to use this feature!

Bash
Python
Go
C#
Java
NodeJs
Javascript
Ruby
PHP
Swift
Bash
$ curl "http://api.scrape.do?token=API_TOKEN \
&url=https://www.example.com \
&geoCode=us"
Python
import requests
url = "http://api.scrape.do?token=API_TOKEN&geoCode=us&url=http://example.com"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
Go
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.scrape.do?token=API_TOKEN&geoCode=us&url=http://example.com"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
}
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
C#
var client = new RestClient("http://api.scrape.do?token=API_TOKEN&geoCode=us&url=http://example.com");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("http://api.scrape.do?token=API_TOKEN&geoCode=us&url=http://example.com")
.method("GET", null)
.build();
Response response = client.newCall(request).execute();
NodeJs
var axios = require('axios');
var config = {
method: 'get',
url: 'http://api.scrape.do?token=API_TOKEN&geoCode=us&url=http://example.com',
headers: {}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "http://api.scrape.do?token=API_TOKEN&geoCode=us&url=http://example.com");
xhr.send();
Ruby
require "uri"
require "net/http"
url = URI("http://api.scrape.do?token=API_TOKEN&geoCode=us&url=http://example.com")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.scrape.do?token=API_TOKEN&geoCode=us&url=http://example.com",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Swift
import Foundation
var semaphore = DispatchSemaphore (value: 0)
var request = URLRequest(url: URL(string: "http://api.scrape.do?token=API_TOKEN&geoCode=us&url=http://example.com")!,timeoutInterval: Double.infinity)
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()

Some countries and their codes are given in the table below. The country that you cannot see below may be supported by the system, but for this you should use Business and above packages.

Country

GeoCode

United States

us

Great Britain

gb

Canada

ca

Turkey

tr

China

cn

Russia

ru

Sweden

se

Germany

de

France

fr

Spain

es

Brazil

br