Menu

Places

Places parameters

Every field of a Places request, and everything that comes back for each place.

Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)

Text
POST https://api.millionshort.com/v1/places

Finds businesses and points of interest by what they are and where they are, and returns them as data. The call is synchronous. Nothing is fetched from any site to answer it. There is no map and there are no tiles.

Request

A request says what is sought, where to look, how to narrow the places, and how to shape the answer. Any field not listed here is a 400 INVALID_PARAM.

What

Send at least one of query, category and brand.

FieldTypeExampleNotes
querystring, 1 to 200 characters"query": "bike repair"A kind of place, a name or a brand. Never read as a location
categorya category id or its name, or a list of up to 10"category": "coffee_shop", "category": ["Coffee shop", "cafe"]Keeps only places filed under one of them, or below it. See Categories
brandstring, up to 120 characters"brand": "Tim Hortons"A chain or brand by name. Sent alone, it is searched by that name

With both query and category, category decides which places are kept: "query": "coffee", "category": "bakery" returns bakeries.

Where

Send at most one of these six. Two of them in one request is a 400.

FieldTypeExampleNotes
nearstring, up to 200 characters"near": "Leslieville, Toronto"A place by name. See How near is read
lat, lngnumbers, -90 to 90 and -180 to 180"lat": 43.6532, "lng": -79.3832A point. They go together
bbox[south, west, north, east], in degrees"bbox": [48.85, 2.29, 48.87, 2.35]A box
ipone public IPv4 or IPv6 address"ip": "203.0.113.24"The approximate location of that address: the nearest city we can place it in. See IP addresses
near_meboolean"near_me": trueAs ip, with the address this call came from
neighbourhoodstring, up to 120 characters"neighbourhood": "Leslieville", "city": "Toronto"A neighbourhood by name. Send city with it when the name is common

A name or a brand can be searched with no location at all. A kind of place cannot: "coffee" with nowhere to look is a 400. The address a request comes from is used only when near_me says so.

Narrowing

FieldTypeExampleNotes
citystring, up to 120 characters"city": "Austin"With none of the six fields above, city is where to look. Beside neighbourhood it says which city's. Otherwise it keeps only places whose address has that city. Compared without case
regionstring, up to 120 characters"city": "Austin", "region": "TX"Goes with city as a location, and is then not checked on the places. Otherwise it keeps only places whose address has that region code. Compared without case
countrytwo-letter country code"country": "CA"Keeps only places whose address is in that country
radius_minteger, 10 to 50,000"radius_m": 1500A fixed radius in metres around the location. Not with bbox. Without it the radius fits the place
exclude_categoryas category"exclude_category": ["fast_food_restaurant"]Leaves out places filed under any of these
has_phoneboolean"has_phone": truetrue keeps only places with a phone number
has_websiteboolean"has_website": truetrue keeps only places with a website
has_hoursboolean"has_hours": truetrue keeps only places whose opening hours we know
open_nowboolean"open_now": truetrue keeps only places whose hours we know and that are open now
min_popularityinteger, 0 to 100"min_popularity": 50Keeps only places whose popularity is at least this, among the best matches (up to 100 of them)

Shaping

FieldTypeDefaultExampleNotes
sortrelevance, distance or popularityrelevance"sort": "distance"distance needs a point to measure from. With an area, or with no location, it is not applied, and the answer carries a sort_not_applied warning. popularity takes the best matches (up to 100 of them) and returns the most popular first
fieldsa list of place fieldsall"fields": ["name", "address", "phone"]Only these fields come back on each place. It changes no price
limitinteger, 1 to 5010"limit": 20How many places to return. With "layer": "both", how many in each list
layermerged, osm or bothmerged"layer": "both"Which list of places to search. merged is our combined list. osm is the OpenStreetMap layer, a separate list under its own licence. both returns the two lists side by side, results and osm_results, never mixed. The OpenStreetMap layer is being switched on: until it is, layer is refused as an unknown parameter (400 INVALID_PARAM, free). See Data sources and licences

Which filters work where

Every field works worldwide, on the same places. What varies from one part of the world to another is how well a place name is read, and how much of the data a filter has to work with.

Canada and the United StatesElsewhere
lat with lng, bbox, radius_mWorksWorks the same
near with a city nameRead well, with or without the state or province ("Denver, CO")A plain city name, or a city with its country ("Paris, France"), usually works
near with a neighbourhood, a postcode, an intersection; neighbourhoodRead best hereUneven. Prefer lat with lng
Everyday trade words in query ("plumber", "dentist")Read best hereCategory ids are the safer choice
city, country as a check on the addressWorksWorks
region as a check on the addressA state or province code (ON, TX)An address may carry its region in words, or none. Prefer country and city
ip, near_mePlaced in a city, more reliably herePlaced in a city, or the nearest town we know
category, exclude_category, brandWorksWorks
has_phone, has_websiteWorksWorks
has_hours, open_nowOnly where hours exist: few placesThe same, and fewer still
sort, min_popularity, fields, limitWorksWorks

Three more things to know:

Categories

A category has an id, such as coffee_shop, pharmacy or museum, and a name, such as "Coffee shop". category and exclude_category take either: a name is read as its id. Categories form a tree, and a category matches the places filed under it or under anything below it, so restaurant covers sushi_restaurant.

Every place in an answer lists the ids it is filed under in categories, the broader ones first, and any of them can be sent as category. A category we do not have is a 400 INVALID_PARAM. The list below has every one.

The category list

Text
GET https://api.millionshort.com/v1/places/categories

Free. Returns the categories a place can be filed under.

Query parameterExampleNotes
q?q=sushi, ?q=coffee%20shopKeeps the categories whose id holds every word. Up to 80 characters
parent?parent=italian_restaurantKeeps the categories directly under this one
Example
Shell
curl "https://api.millionshort.com/v1/places/categories?q=sushi" \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY"
Text
{
  "data": {
    "categories": [
      { "id": "sushi_restaurant", "label": "Sushi restaurant", "parent": "japanese_restaurant" }
    ]
  },
  "request_id": "req_01JD0PLACESCAT4H8W2",
  "usage": { "credits": 0, "cost_usd": 0, "breakdown": { "place_categories": 0 } },
  "warnings": []
}

Each entry has id, label and parent; parent is null at the top of the tree. With no parameter the whole tree comes back, about two thousand categories. The list does not say how many places a category holds.

IP addresses

ip and near_me search around the approximate location of an IP address.

Examples

A category inside a box:

Example
Shell
curl https://api.millionshort.com/v1/places \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "category": "museum",
    "bbox": [48.85, 2.29, 48.87, 2.35],
    "limit": 20
  }'

Restaurants in a neighbourhood, nearest first, leaving two categories out, with only four fields back:

Example
Shell
curl https://api.millionshort.com/v1/places \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "restaurant",
    "neighbourhood": "Leslieville",
    "city": "Toronto",
    "exclude_category": ["pizza_restaurant", "Fast food restaurant"],
    "has_website": true,
    "sort": "distance",
    "fields": ["name", "category", "distance_m", "website"]
  }'

Branches of a chain around an IP address's city that have opening hours on record:

Example
Shell
curl https://api.millionshort.com/v1/places \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "brand": "Tim Hortons",
    "ip": "203.0.113.24",
    "radius_m": 3000,
    "has_hours": true
  }'

Dentists in a city, by city and state:

Example
Shell
curl https://api.millionshort.com/v1/places \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "category": "dental_clinic",
    "city": "Austin",
    "region": "TX",
    "has_phone": true
  }'

Response

data has three parts: resolved, results and attribution. The envelope around it (request_id, usage, warnings) is the one every endpoint uses.

With "layer": "osm", data also has "layer": "osm", and results are places of the OpenStreetMap layer. With "layer": "both", data has "layer": "both", then results and attribution as for merged, and osm_results and osm_attribution for the OpenStreetMap layer. See Data sources and licences.

resolved

What the location was taken to mean. For a name (near, neighbourhood, or a city used as the location) it is the place found. For ip and near_me it is the city the address was placed in. It is null for lat with lng, for bbox, and for a search with no location.

FieldTypeNotes
namestringThe place found
regionstring or nullFor a named place, a state, province or region code such as ON, when it has one. For an IP address, the region as we have it, which can be in words
countrystring or nullTwo-letter country code
lat, lngnumbersIts position
kindarea, point or ipA city or a region is an area. A neighbourhood, a postcode, an address or a landmark is a point. ip is the city an address was placed in
accuracy"city" or null"city" for ip and near_me; null otherwise
alternativeslist, up to 5Other places of that name, each with name, region and country. Empty for ip
Text
"resolved": {
  "name": "Toronto",
  "region": "ON",
  "country": "CA",
  "lat": 43.71,
  "lng": -79.4,
  "kind": "ip",
  "accuracy": "city",
  "alternatives": []
}

The IP address itself is never in an answer.

A place

Each entry of results. Every field is present unless the request's fields picked some; what is not known is null.

FieldTypeNotes
idstringOur id for the place
namestring
categoryobject or nullThe place's own category: id and label
categorieslist of stringsEvery category id the place is filed under, the broader ones first
addressobjectstreet, unit, city, region, postcode, country (two letters) and formatted, each a string or null
lat, lngnumbers
distance_minteger or nullMetres from the point searched around: a named place when it is a point, the city an ip was placed in, lat and lng, or the middle of bbox. null when the location is an area, which has no one point, and when no location was sent
phonestring or nullIn international form, such as +14165550142
websitestring or null
brandstring or nullFor a branch of a chain
hoursobject or nulltimezone, weekly and partial. See below. null for most places
open_nowboolean or nullnull when the hours are not known
last_seendate or nullThe day the place was last confirmed by one of the data's sources. Not an edit by its owner
popularityinteger 0 to 100, or nullHow well known the place is. See How popularity is scored

hours.weekly has one list per day, monday to sunday, of opening spans in the place's local time, written "07:00-17:00". A day with none listed is an empty list. hours.timezone is the place's time zone, and hours.partial is true when some of the hours on record could not be read.

Text
"hours": {
  "timezone": "America/Toronto",
  "weekly": {
    "monday": ["07:00-17:00"], "tuesday": ["07:00-17:00"], "wednesday": ["07:00-17:00"],
    "thursday": ["07:00-17:00"], "friday": ["07:00-19:00"], "saturday": ["08:00-19:00"], "sunday": []
  },
  "partial": false
},
"open_now": true

Results come most relevant first, nearest first with "sort": "distance", or most popular first with "sort": "popularity". A place carries no rating, review, photo or price level, and no answer says which source a field came from.

Attribution

Text
"attribution": {
  "text": "Place data from open data sources. Credits and licences: https://millionshort.com/credits#places",
  "url": "https://millionshort.com/credits#places"
}

The places come from open data, and some of its licences ask for a credit. Every answer carries this object: one line of text, and the address of the page that lists each source and its licence. No parameter removes it: fields shapes the places, not the credit.

If you show these places to people, you must show that line, or a link to that page, with them. Our terms of service require it, and following it is up to you. Take the text from the answer; do not copy it from this page, because it can change.

Data sources and licences

The OpenStreetMap layer is being switched on. Until it is, the API refuses layer as an unknown parameter (400 INVALID_PARAM, free), and every answer is our combined list. What follows applies from the day it is on.

Places of the OpenStreetMap layer ("layer": "osm", and osm_results with "layer": "both") are © OpenStreetMap contributors. The data is available under the Open Database License (ODbL) 1.0. See openstreetmap.org/copyright.

This layer is a separate list. Its places are never merged, de-duplicated or ranked with the other places. With "layer": "both" the two lists come back side by side: each is the answer its layer gives alone, and a place can be in both. limit, sort, min_popularity, fields and every filter apply to each list on its own.

Every place of the OpenStreetMap layer carries its credit, and fields cannot remove it:

Text
{
  "name": "…",
  "layer": "osm",
  "licence": "ODbL-1.0",
  "attribution": {
    "text": "© OpenStreetMap contributors",
    "url": "https://www.openstreetmap.org/copyright"
  }
}

The answer carries the layer's credit too: attribution with "layer": "osm", or osm_attribution with "layer": "both". Each has text, url and licence ("ODbL-1.0").

Terms for the OpenStreetMap layer. Our terms of service say two things about these places:

How to obtain the OpenStreetMap layer

The OpenStreetMap layer is a database derived from OpenStreetMap alone. We offer it under the Open Database License (ODbL) 1.0. It is refreshed every week from the public OpenStreetMap data. Write to [email protected] for a copy of the layer as we serve it (a data file, under the ODbL), or for a description of how it is made from the public data. The same offer is on the Credits page.

Data notices

Some of the place data comes from Foursquare Open Source Places, which Foursquare Labs, Inc. publishes under the Apache License, Version 2.0 (apache.org/licenses/LICENSE-2.0). Its notice asks that its content go in the developer documentation of an API that serves the data. Here it is, as Foursquare publishes it:

Text
© 2026 Foursquare Labs, Inc. All rights reserved.
The Foursquare OS Places dataset (the “Data”) is licensed under the Apache License, Version 2.0 (the “License”). You may not use, modify, or distribute the Data except in compliance with the License.
As set forth more fully in the License, if you use, modify, or distribute the Data, you must:
– provide recipients with a copy of the License.
– if applicable, include prominent notices to the extent you’ve changed the Data.
– preserve attribution to Foursquare, including preserving the full content of this NOTICE.txt file.
To ensure appropriate attribution to Foursquare, we recommend the following:
– if using/distributing the Data in flat file form as-is or after making changes/modifications: include this NOTICE.txt file, which may be modified to include an additional notice of your changes/modifications, if any.
– if using/distributing the Data in API form as-is or after making changes/modifications: include a copy of the content from this NOTICE.txt file prominently in your developer documentation for such API, which may be modified to include an additional notice of your changes/modifications, if any.
You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, the Data distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
We also encourage you to join our Placemaker community where you can contribute and provide suggestions to improve the accuracy of the Data for future releases for yourself and others.

Our changes: we transformed the Data to our own format, normalised it, and combined it with other sources, keeping one listing per place. The same notice is on the Credits page. Naming the source here is only to give the credit its licence asks for; it implies no endorsement.

Warnings

CodeWhen
hours_coverageWhenever open_now is sent: most places have no hours on record, so open places can be missing
sort_not_applied"sort": "distance" was sent and there is no point to measure from (the location is an area, or there is none). The places are in order of relevance

Limits

LimitValue
limit1 to 50
radius_m10 to 50,000 metres
category, exclude_categoryup to 10 each
query, nearup to 200 characters each
brand, neighbourhood, city, regionup to 120 characters each

A plan's requests a minute and searches in flight apply as they do to a search; Places is not one of the heavy sources. Pricing and limits has the numbers.

Credits

1 credit per list covers up to 10 places. Each further 10 places returned in that list, or part of 10, is 0.5. A call returns one list, or two with "layer": "both", and each list is priced on its own. Every filter, sort and fields are free, the category list is free, and a call that fails costs nothing. Pricing and limits has worked examples.

This page as Markdown · llms.txt