Links

Locations List

We use Google Geographical Targeting, that’s why you can use it as a data source. These are the location types ‘Autonomous Community’, ‘Borough’, ‘City’, ‘Country’, ‘Governorate’, ‘Municipality’, ‘Postal Code’, ‘Prefecture’, ‘Province’, ‘Region’, ‘State’, ‘Territory’, ‘Union Territory’. Download the CSV file of full list of supported locations: Google Locations And Bing Locations. By calling this API you will receive the list of locations available for our SERP API
Requires authentication
get
https://api.serphouse.com/location/search
Get a list of locations available for our SERP API
Parameters
Query
q*
search in our location database
type*
Type can be google and bing Google and Bing have a different locations so if you are targeting on Bing then pass type as bing otherwise google.
Header
Authorization*
Bearer <YOUR_API_TOKEN>
Responses
200: OK
Successful operation
401: Unauthorized
Unauthenticated

Example request:

BASH
RUBY
PYTHON
NODE.JS
PHP
JAVA
JAVASCRIPT
GO
C#/.NET
curl --location --request GET 'https://api.serphouse.com/location/search?q=texas&type=google' \
--header 'Authorization: Bearer <YOUR_API_TOKEN>'
require "uri"
require "net/http"
url = URI("https://api.serphouse.com/location/search?q=texas&type=google")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <YOUR_API_TOKEN>"
response = https.request(request)
puts response.read_body
import requests
url = "https://api.serphouse.com/location/search?q=texas&type=google"
payload={}
headers = {
'Authorization': 'Bearer <YOUR_API_TOKEN>'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var config = {
method: 'get',
url: 'https://api.serphouse.com/location/search?q=texas&type=google',
headers: {
'Authorization': 'Bearer <YOUR_API_TOKEN>'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
<?php
$client = new GuzzleHttp();
$headers = [
'Authorization' => 'Bearer <YOUR_API_TOKEN>'
];
$request = new GuzzleHttp\Psr7\Request('GET', 'https://api.serphouse.com/location/search?q=texas&type=google', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder()
.url("https://api.serphouse.com/location/search?q=texas&type=google")
.get()
.addHeader("Authorization", "Bearer <YOUR_API_TOKEN>")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <YOUR_API_TOKEN>");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.serphouse.com/location/search?q=texas&type=google", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.serphouse.com/location/search?q=texas&type=google"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer <YOUR_API_TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new RestClient("https://api.serphouse.com/location/search?q=texas&type=google");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <YOUR_API_TOKEN>");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);