Menu

Places

Places guides

The jobs Places is built for, each as the requests that do it.

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

Find places near a point

When you have coordinates (a device's position that the user shared, a place from an earlier answer, a geocoder of your own), send them. A point works the same in every country, and nothing has to be read from a name.

Example
Shell
curl https://api.millionshort.com/v1/places \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "bike repair",
    "lat": 45.5231,
    "lng": -73.5817,
    "radius_m": 2000,
    "limit": 10
  }'

Unless you ask with near_me, we never work out where a caller is. A position the user shared is always better than a guess from an address.

Search near an IP address or near the caller

When there are no coordinates, an IP address gives a rough answer: the city its network is in.

Example
Shell
curl https://api.millionshort.com/v1/places   -H "Authorization: Bearer $MILLIONSHORT_API_KEY"   -H "Content-Type: application/json"   -d '{
    "query": "coffee",
    "ip": "203.0.113.24",
    "radius_m": 2000
  }'
Text
"resolved": { "name": "Toronto", "region": "ON", "country": "CA", "lat": 43.71, "lng": -79.4,
              "kind": "ip", "accuracy": "city", "alternatives": [] }

How near is read

near takes a place by name. These are read:

KindExamples
A city or townToronto, Denver, CO, Paris, France
A neighbourhood, with its city when the name is commonLeslieville, Toronto, Capitol Hill, Seattle
A postcodeM4M 1L4, 10001, SW1A 1AA
A street address100 Queen St W, Toronto
An intersectionYonge and Eglinton
An airport codeYYZ

What to know:

When a name is not found, fall back in this order: add or correct the qualifier, try the city alone, then send coordinates.

Finding the right category

A query word is matched as well as we can read it; a category is exact. When the kind of place matters, look the category up once and send its id.

Example
Shell
curl "https://api.millionshort.com/v1/places/categories?q=dental"   -H "Authorization: Bearer $MILLIONSHORT_API_KEY"

The list is free. ?q= keeps the categories whose id holds every word, and ?parent=italian_restaurant lists what is directly under a category. Then:

Example
Shell
curl https://api.millionshort.com/v1/places   -H "Authorization: Bearer $MILLIONSHORT_API_KEY"   -H "Content-Type: application/json"   -d '{
    "category": ["dental_clinic", "general_dentistry"],
    "exclude_category": ["b2b_dental_lab"],
    "near": "Austin, TX",
    "has_phone": true
  }'

Opening hours and open_now

Opening hours are known for a small share of places. Plan for that.

Example
Shell
curl https://api.millionshort.com/v1/places \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "pharmacy",
    "near": "M5B 2H1",
    "open_now": true
  }'

hours.weekly is in the place's local time, and hours.timezone names its time zone, so you can work out later openings yourself.

Read what a place says about itself

A place carries no reviews or descriptions. Its website is the way to more: search inside it with include_domains, or read its pages with Extract.

Example
Shell
curl https://api.millionshort.com/v1/search \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "opening hours menu", "include_domains": ["harbourlanecoffee.example"], "num_results": 5 }'

A stale listing

A business that has closed may still be listed. last_seen is the day a place was last confirmed. For a recommendation that matters, prefer places seen recently, and say when a listing is old.

How popularity is scored

Every place has a popularity, a whole number from 0 to 100. It is worked out from what we already hold about the place, not from visits or reviews, and it says how well known and well attested a place is. Two kinds of evidence go into it:

Reach is worth at most 45 points, and it is scaled by the place's own evidence: a branch of a famous chain with little evidence of its own gets at most 18 of them. So a chain's shared website never makes every one of its branches 100. The place's own evidence is worth up to 55 points, so a well-attested independent place scores well without any reach at all. More of any kind of evidence never lowers the score.

What the numbers look like in practice: a well-attested branch of a large chain is usually in the 80s or 90s, a well-attested independent place in the 30s to 60s, and a sparse or old listing below 20. A score is a guide for ordering and filtering, not a rating of quality.

Most popular coffee places around a point, leaving out sparse listings:

Example
Shell
curl https://api.millionshort.com/v1/places \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "coffee",
    "lat": 39.7392,
    "lng": -104.9903,
    "radius_m": 3000,
    "sort": "popularity",
    "min_popularity": 30,
    "fields": ["name", "address", "popularity"]
  }'

sort: "popularity" and min_popularity work on the best matches for the search (up to 100 of them), then order or filter those. To tell independent places from chains, look at brand (null for a place with no brand), not at a low score.

Popularity on the OpenStreetMap layer

A place of the OpenStreetMap layer has a popularity too, on the same 0 to 100 scale, but it is a different score. It is worked out from that OpenStreetMap listing alone, never from our other places or anything looked up about them. Four equal parts go into it:

The two scores are never compared or ordered together. With "layer": "both", sort: "popularity" and min_popularity apply to each list on its own score.

Two lists: our places and the OpenStreetMap layer

The OpenStreetMap layer is being switched on; until it is, layer is refused as an unknown parameter (400 INVALID_PARAM, free). From then on, "layer": "both" returns two lists side by side: results, our combined list, and osm_results, the OpenStreetMap layer. Each list is the answer its layer gives alone to the same request. The two are never merged, de-duplicated or ranked together, so the same place can be in both. If you show them, show them as two lists, and show "© OpenStreetMap contributors", linked to https://www.openstreetmap.org/copyright, next to the places of the OpenStreetMap layer. Each list is priced on its own. Data sources and licences has the licence and the terms.

Example
Shell
curl https://api.millionshort.com/v1/places \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "bakery",
    "near": "Leslieville, Toronto",
    "layer": "both",
    "limit": 5,
    "fields": ["name", "address", "phone"]
  }'

Every place in osm_results carries layer, licence and attribution, whatever fields asked for.

This page as Markdown · llms.txt