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 a list of locations available for our SERP API
GET
https://api.serphouse.com/location/search
Query Parameters
Name | Type | Description |
---|---|---|
q* | String | search in our location database |
type* | String | Type can be |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <YOUR_API_KEY> |
{
"status": "success",
"msg": "ok",
"results": [
{
"id": 9113189,
"name": "Texas's 33rd Congressional District 2022 redistricting",
"loc": "Texas's 33rd Congressional District 2022 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
},
{
"id": 9113190,
"name": "Texas's 34th Congressional District 2022 redistricting",
"loc": "Texas's 34th Congressional District 2022 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
},
{
"id": 9113191,
"name": "Texas's 35th Congressional District 2022 redistricting",
"loc": "Texas's 35th Congressional District 2022 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
},
{
"id": 9113192,
"name": "Texas's 36th Congressional District 2022 redistricting",
"loc": "Texas's 36th Congressional District 2022 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
},
{
"id": 9113193,
"name": "Texas's 37th Congressional District 2022 redistricting",
"loc": "Texas's 37th Congressional District 2022 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
},
{
"id": 9113194,
"name": "Texas's 38th Congressional District 2022 redistricting",
"loc": "Texas's 38th Congressional District 2022 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
},
{
"id": 9040743,
"name": "Texas's 1st Congressional District 2012 redistricting",
"loc": "Texas's 1st Congressional District 2012 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
},
{
"id": 9040744,
"name": "Texas's 10th Congressional District 2012 redistricting",
"loc": "Texas's 10th Congressional District 2012 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
},
{
"id": 9040745,
"name": "Texas's 11th Congressional District 2012 redistricting",
"loc": "Texas's 11th Congressional District 2012 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
},
{
"id": 9040746,
"name": "Texas's 12th Congressional District 2012 redistricting",
"loc": "Texas's 12th Congressional District 2012 redistricting,Texas,United States",
"type": "Congressional District",
"country_code": "US"
}
]
}
{
"status": "error",
"msg": "Unauthenticated"
}
Example request:
curl --location --request GET 'https://api.serphouse.com/location/search?q=texas&type=google' \
--header 'Authorization: Bearer <YOUR_API_KEY>'
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_KEY>"
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_KEY>'
}
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_KEY>'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
<?php
$serphouse = new SERPHouse\SERPHouseClient('YOUR_API_KEY');
$res = $serphouse->location->search(['q' => 'texas', 'type' => 'google']);
echo $res->getResponse();
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_KEY>")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <YOUR_API_KEY>");
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_KEY>")
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_KEY>");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Last updated