Skip to main content
GET
/
v1
/
googlelocations
Get Geolocation
curl --request GET \
  --url https://api.lobstr.io/v1/googlelocations \
  --header 'Authorization: <authorization>'

Documentation Index

Fetch the complete documentation index at: https://docs.lobstr.io/llms.txt

Use this file to discover all available pages before exploring further.

Use this endpoint to fetch valid location values for the params.location setting in the Google Search Scraper. These values provide geographic bias for your search queries.

Headers

Authorization
string
required
Your API authentication token. Value: Token YOUR_API_KEY

Query Parameters

q
string
required
Search substring for location names. Example: Alabama
country_name
string
required
Full country name. Example: United States

Query Parameters

ParameterRequiredDescription
qYesSubstring to search for in region, district, or city names
country_nameYesFull country name to scope the search (e.g., United States)

Response Fields

FieldTypeDescription
namestringDisplay name of the location (region, district, or city)
canonical_namestringFull hierarchical name (e.g., Alabama,United States)
country_namestringCountry associated with this location
country_codestringISO 2-letter country code (e.g., US)
Use the returned name value as your params.location setting.
Location values provide geographic bias - search results will be relevant to that area.

Code Examples

curl -X GET "https://api.lobstr.io/v1/googlelocations?q=Alabama&country_name=United%20States" \
  -H "Authorization: Token YOUR_API_KEY"

Response

200
{
  "success": true,
  "data": [
    {
      "name": "Alabama",
      "canonical_name": "Alabama,United States",
      "country_name": "United States",
      "country_code": "US"
    },
    {
      "name": "Alabama's 1st Congressional District 2022 redistricting",
      "canonical_name": "Alabama's 1st Congressional District 2022 redistricting,Alabama,United States",
      "country_name": "United States",
      "country_code": "US"
    },
    {
      "name": "The University of Alabama",
      "canonical_name": "The University of Alabama,Alabama,United States",
      "country_name": "United States",
      "country_code": "US"
    },
    {
      "name": "University of Alabama at Birmingham",
      "canonical_name": "University of Alabama at Birmingham,Alabama,United States",
      "country_name": "United States",
      "country_code": "US"
    }
  ]
}