curl "https://www.mapsdata.io/api/v1/locations?q=New%20York&country=US" \
-H "x-api-key: md_live_your_key"
{
"locations": [
{
"location_code": 1023191,
"name": "New York",
"full_name": "New York, New York, United States",
"country_code": "US",
"location_name": "New York,New York,United States",
"city": "New York",
"region": "New York",
"country": "US",
"location_type": "City",
"label": "New York, New York"
}
]
}
Endpoints
Look up locations
Find a city label that maps exactly to the Mapsdata search UI.
GET
/
locations
curl "https://www.mapsdata.io/api/v1/locations?q=New%20York&country=US" \
-H "x-api-key: md_live_your_key"
{
"locations": [
{
"location_code": 1023191,
"name": "New York",
"full_name": "New York, New York, United States",
"country_code": "US",
"location_name": "New York,New York,United States",
"city": "New York",
"region": "New York",
"country": "US",
"location_type": "City",
"label": "New York, New York"
}
]
}
Search the bundled city catalog. The endpoint returns up to eight prefix matches and consumes no lead credits.
string
required
City name, between 2 and 100 characters. Example:
New York.string
Optional two-letter country code used to disambiguate matches. Example:
US.curl "https://www.mapsdata.io/api/v1/locations?q=New%20York&country=US" \
-H "x-api-key: md_live_your_key"
{
"locations": [
{
"location_code": 1023191,
"name": "New York",
"full_name": "New York, New York, United States",
"country_code": "US",
"location_name": "New York,New York,United States",
"city": "New York",
"region": "New York",
"country": "US",
"location_type": "City",
"label": "New York, New York"
}
]
}
Map the response to a search
The dashboard selectslabel, not location_code. To reproduce the UI request exactly:
{
"input": {
"query": "plumber",
"location": "New York, New York",
"countryCode": "US",
"maxResults": 100,
"language": "en"
}
}
string
Send this value as
input.location.string
Send this value as
input.countryCode.integer
Stable catalog identifier returned for interoperability. The current search endpoint does not accept it.
string
Fully qualified city, region, and country name for display or storage.
Do not send only
New York when a catalog match is available. Using New York, New York plus countryCode: US avoids ambiguous markets and matches the UI.