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.
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"
}
}
Stable catalog identifier returned for interoperability. The current search endpoint does not accept it.
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.