This page will help you get started with Google Location API.
Overview
Location API allows developers to obtain information about geographical locations around the world. With this API, you can find and retrieve data about cities, countries, counties, municipalities, neighborhoodies, provincies and more. Additionally, the Locations API also enables limiting search results using various parameters.
Location API return an array of locations ordered by reach. Locations that reach the most people will be first.
Location API is free to use.
To ensure quality of service for all users, there is a rate limit of 100 requests per minute applied to the Locations API.
Examples
Example 1
Obtaining a list of 2 largest locations for the query new york
using the Locations API
Request:
https://app.scrapein.app/api/v1/locations?api_key={API-KEY}&q=new+york&limit=2
Response:
{
"request_info": {
"success": true
},
"locations_total": 2919,
"locations_total_current_page": 2,
"page": 1,
"limit": 2,
"locations": [
{
"id": 9058772,
"name": "Richmond County",
"type": "County",
"full_name": "Richmond County,New York,United States",
"parent_id": 21167,
"country_code": "US",
"reach": 23600000,
"gps_coordinates": {
"latitude": 40.601223999999995,
"longitude": -74.162599
}
},
{
"id": 1023191,
"name": "New York",
"type": "City",
"full_name": "New York,New York,United States",
"parent_id": 21167,
"country_code": "US",
"reach": 23600000,
"gps_coordinates": {
"latitude": 40.773691,
"longitude": -73.912125
}
}
]
}
Example 2
Obtaining a list of 2 largest locations for the query village
using the Locations API in the United States (country code us
)
Request:
https://app.scrapein.app/api/v1/locations?api_key={API-KEY}&q=village&country_code=us&limit=2
Response:
{
"request_info": {
"success": true
},
"locations_total": 58,
"locations_total_current_page": 2,
"page": 1,
"limit": 2,
"locations": [
{
"id": 9073489,
"name": "Greenwich Village",
"type": "Neighborhood",
"full_name": "Greenwich Village,New York,United States",
"parent_id": 21167,
"country_code": "US",
"reach": 969000,
"gps_coordinates": {
"latitude": 40.7335719,
"longitude": -74.0027418
}
},
{
"id": 9061144,
"name": "Camelback East Village",
"type": "Neighborhood",
"full_name": "Camelback East Village,Arizona,United States",
"parent_id": 21136,
"country_code": "US",
"reach": 737000,
"gps_coordinates": {
"latitude": 33.487358,
"longitude": -112.0118669
}
}
]
}
Example 3
Obtaining a list of 2 largest cities in the Germany (country code "de")
Request:
https://app.scrapein.app/api/v1/locations?api_key={API-KEY}&limit=2&country_code=de&type=city
Response:
{
"request_info": {
"success": true
},
"locations_total": 1875,
"locations_total_current_page": 2,
"page": 1,
"limit": 2,
"locations": [
{
"id": 1003854,
"name": "Berlin",
"type": "City",
"full_name": "Berlin,Berlin,Germany",
"parent_id": 20226,
"country_code": "DE",
"reach": 11700000,
"gps_coordinates": {
"latitude": 52.50607,
"longitude": 13.446641999999999
}
},
{
"id": 1004607,
"name": "Cologne",
"type": "City",
"full_name": "Cologne,North Rhine-Westphalia,Germany",
"parent_id": 20235,
"country_code": "DE",
"reach": 10200000,
"gps_coordinates": {
"latitude": 50.937531,
"longitude": 6.9602786
}
}
]
}
Example 4
Obtaining information about a specific location using its identifier: id=1014221
Request:
https://app.scrapein.app/api/v1/locations?api_key={API-KEY}&id=1014221
Response:
{
"request_info": {
"success": true
},
"locations_total": 1,
"locations_total_current_page": 1,
"page": 1,
"limit": 10,
"locations": [
{
"id": 1014221,
"name": "San Francisco",
"type": "City",
"full_name": "San Francisco,California,United States",
"parent_id": 21137,
"country_code": "US",
"reach": 10700000,
"gps_coordinates": {
"latitude": 37.7749295,
"longitude": -122.41941550000001
}
}
]
}
Example 5
Obtaining a list of cities and states in the USA (page 3, with 100 results on each page)
Request:
https://app.scrapein.app/api/v1/locations?api_key={API-KEY}&type=state,city&country_code=us&limit=100&page=3
Response:
{
"request_info": {
"success": true
},
"locations_total": 16472,
"locations_total_current_page": 100,
"page": 3,
"limit": 100,
"locations": [
{
"id": 1015303,
"name": "Columbus",
"type": "City",
"full_name": "Columbus,Georgia,United States",
"parent_id": 21143,
"country_code": "US",
"reach": 659000,
"gps_coordinates": {
"latitude": 32.4609764,
"longitude": -84.9877094
}
},
{},
{
"id": 1014033,
"name": "Moreno Valley",
"type": "City",
"full_name": "Moreno Valley,California,United States",
"parent_id": 21137,
"country_code": "US",
"reach": 502000,
"gps_coordinates": {
"latitude": 33.9424658,
"longitude": -117.2296717
}
}
]
}