SERP Locations API
Locations API allows you to search Shifter's Scraping API supported locations. This API is free to use.
In this documentation, you will find detailed usage guides and code examples that will help you get up and running in the shortest time possible. If the articles below leave any questions unanswered, please feel free to contact our technical support team.
The URL below retrieves the first 5 locations that contain “Austin” in their name in our database. You can then use a string composed of all location properties (e.g.
"1001982", "Austin", "Austin, Manitoba, Canada", "20115", "CA", "City", Active
) as the value of the param location
for the search API to get more precise results.GET https://locations.serp.shifter.io/?q=Venice&limit=5
⇡ Input
cURL
NodeJS
Python
PHP
Golang
Java
.NET
Ruby
curl --request GET --url "https://locations.serp.shifter.io/?q=Venice&limit=5"
const http = require("https");
const options = {
"method": "GET",
"hostname": "https://locations.serp.shifter.io",
"port": null,
"path": "/?q=Venice&limit=5",
"headers": {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
import http.client
conn = http.client.HTTPSConnection("https://locations.serp.shifter.io")
conn.request("GET", "/?q=Venice&limit=5")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://locations.serp.shifter.io/?q=Vince&limit=5",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://locations.serp.shifter.io/?q=Venice&limit=5"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.get("https://locations.serp.shifter.io/?q=Venice&limit=5")
.asString();
var client = new RestClient("https://locations.serp.shifter.io/?q=Venice&limit=5");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://locations.serp.shifter.io/?q=Venice&limit=5")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
⇣ Output
[
{
"Criteria ID": "1008966",
"Name": "Venice",
"Canonical Name": "Venice",
"Parent ID": "Veneto",
"Country Code": "Italy",
"Target Type": "9053442",
"Status": "IT"
},
{
"Criteria ID": "1014368",
"Name": "Venice",
"Canonical Name": "Venice",
"Parent ID": "California",
"Country Code": "United States",
"Target Type": "21137",
"Status": "US"
},
{
"Criteria ID": "1015223",
"Name": "Venice",
"Canonical Name": "Venice",
"Parent ID": "Florida",
"Country Code": "United States",
"Target Type": "21142",
"Status": "US"
},
{
"Criteria ID": "1016920",
"Name": "Venice",
"Canonical Name": "Venice",
"Parent ID": "Illinois",
"Country Code": "United States",
"Target Type": "21147",
"Status": "US"
},
{
"Criteria ID": "20618",
"Name": "Metropolitan City of Venice",
"Canonical Name": "Metropolitan City of Venice",
"Parent ID": "Veneto",
"Country Code": "Italy",
"Target Type": "9053442",
"Status": "IT"
}
]
q Optional Searches locations that contain the supplied string.
limit Optional Specifies the number of locations returned.
400 Bad Request – Your request is invalid or has invalid parameters.
404 Not Found – The specified endpoint could not be found or the method is invalid.
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.
Last modified 6mo ago