Places
Copy link

The places endpoints return points of interest, such as shops, cafés, gyms, schools and surgeries. Each place comes from Foursquare, OpenStreetMap or Overture (the listed_by field says which), and is verified when a government register or our transport data confirms it. For details, see How we verify places.

This page answers questions such as:

Request headers
Copy link

Required authentication header. Use the same application id as for the TravelTime API.

string

Required authentication header.

A list of places
Copy link

GET /v1/places

Returns the places that match your filters in the location you give. With q, the best match comes first. Otherwise, results are nearest first with near, in the order sent with cells, and by id in all other cases. For cells lists that are too long for a URL, send the same fields as a JSON body to POST /v1/places.

Parameters
Copy link

ParameterType · defaultWhat it doesExample
qtext · —Search by name. A name is not a location, so you also need to give one, or use country=gb to search the whole country.q=british+museum
categorycategory ids · —Return only places in these categories, using ids from /v1/categories. A group id includes everything under it.category=gym,swimming_pool
brandbrand slug · —Return only places of this brand.brand=pret
verifiedtrue | false · —With true, return only places that a government register (FHRS, CQC, NHS…) or our transport data confirms.verified=true
min_sources1 | 2 | 3 · 2How many of the sources (Foursquare, OpenStreetMap, Overture) must list a place. Verified places and transport stops and stations are returned at any value. See Choosing filters.min_sources=1
gridh3 | geohash · h3With geohash, cells takes geohash squares instead of H3 cells.grid=geohash
precision6 | 7 · —The size of the geohash squares, used with grid=geohash.precision=7

The endpoint also takes the common location parameters (near, radius_m, bbox, cells, at and country), the paging parameters (limit and cursor) and the output parameter (format). You can also send them in a POST body.

Each result has id, name, category, brand, lat, lng, cell, verified and listed_by. Results also have distance_m when you use near, and geohash with grid=geohash.

CodeHTTPWhen
location_required400The request has no near, bbox, cells or at, or it has q with neither a location nor country.
country_not_allowed400country is used without q.
invalid_category400category has a value that is not a group, category or detail id from /v1/categories.
grid_not_supported · invalid_precision · invalid_cells400grid=geohash is used with q or at (grid_not_supported), precision is not 6 or 7 (invalid_precision), or the geohash cells have a different precision from precision (invalid_cells).
invalid_cell_resolution400Not all of the H3 cells are resolution 9.
All of the error codes under Location and Paging also apply
Examples

The 42 cafés within 300 m of King's Cross, nearest first. Each result says how far away it is.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/places?near=51.5307,-0.1238&radius_m=300&category=cafe"
200 · 42 places

42 pins inside the 300 m circle; a pin opens its row.

All the places inside a rectangle. The request has no near, so the results have no distance_m.

The cafés inside seven H3 cells around Euston Square: 54 in all, and between 3 and 13 in each cell. They come back cell by cell, in the order the cells were sent.

To find the gyms you can reach in 45 minutes by public transport, first get the reachable H3 cells from the TravelTime API with your own key. This example sends seven of them, between Euston and St Pancras, and gets back 9 places in the gym group. category matches any of a place's categories, so the Living Centre is included: it is filed as cultural_center but also lists gym. The whole 45-minute catchment from King's Cross is 8,526 cells and has 3,173 gyms. See it live in the demo →

A name search across the whole country, with the best match first. Adding category keeps the museum rather than the bus stop named after it.

You can narrow any list with filters. This example returns the 6 Pret branches within 1 km that a government register has verified.

The response is a FeatureCollection of points. The row fields go in properties, and lat and lng become the geometry.

This works the same way on the geohash grid, for teams that use geohashes. The response says which grid it is on, and each row has its geohash as well as its cell.

A single place
Copy link

GET /v1/places/{id}

Returns everything we know about a single place. Use an id from a list of places.

This endpoint takes no other parameters.

The response has the same fields as a list result, plus its address (street, postcode, city), the registers that verify it (verified_by), all of its categories and updated_at.

CodeHTTPWhen
invalid_id400The id is not a place id (pl_gb_…).
not_found404There is no place with this id.
Examples

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/places/pl_gb_b9eda4a4-485e-4c63-8b0f-45e782c39d25"
200 · one place

1 pin; it opens its row.

Places per H3 cell
Copy link

GET /v1/places/cells

Counts the places in each H3 cell, in each boundary, or in total. For long cells lists, send the same fields as a JSON body to POST /v1/places/cells.

Parameters
Copy link

ParameterType · defaultWhat it doesExample
categorycategory ids · —Count only the places in these categories.category=gym
includecategories, groups · —categories adds category_counts to each row. For each category, this is the number of places that category= would count, and a place counts once in each of its categories. groups adds group_counts, which works the same way for groups, so a place in two groups counts in both.include=categories,groups
grid, precisionh3 | geohash · h3; 6 | 7 · —Use geohash squares instead of H3 cells, as on /v1/places.grid=geohash&precision=6

The endpoint also takes the common location parameters, the per-cell parameters (group_by and resolution), and the paging and output parameters. You can also send them in a POST body.

Each result has cell and count, plus category_counts with include=categories and group_counts with include=groups. On the geohash grid, results have geohash instead of cell. In totals, the counts are summed (rollup: sum).

CodeHTTPWhen
invalid_resolution400resolution is not one that places supports (6 to 10). allowed lists them.
invalid_group_by400group_by is not cell, all or one of the country's boundary types. allowed lists them.
invalid_include400include has a value other than categories or groups.
invalid_format400geojson is used with a group_by other than cell, or on the geohash grid.
invalid_category · grid_not_supported · invalid_precision · invalid_cells400The same as on /v1/places, except that grid_not_supported here means grid=geohash with at.
All of the error codes under Location and Paging also apply

1. Send one cell, get one row
Copy link

Put the id of one H3 cell in cells. You get back one row for that cell, and count is the number of places in it.

You send

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/places/cells?cells=89195da4d03ffff"

You get

{
  "resolution": 9,
  "results": [
    {
      "cell": "89195da4d03ffff",
      "count": 120
    }
  ],
  "next_cursor": null
}

2. Send several cells, get one row for each
Copy link

Separate the cell ids with commas. You get one row for each cell, in the order you sent them. These seven cells lie between Euston and St Pancras, and hold between 28 and 120 places each. The map shades each cell by its count. Select a cell to see its row.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/places/cells?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff"
200 · 7 H3 cells

Shade = count281207 H3 cells; click a cell to open its row.

3. Add them up: one row for all the cells
Copy link

Add group_by=all to get one total row instead. The same seven cells hold 495 places. cell_count says how many cells went into the total.

For a long list of cells, send POST /v1/places/cells with the same fields in a JSON body. See Long requests.

You send

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/places/cells?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff&group_by=all"

You get

{
  "resolution": 9,
  "results": [
    {
      "cell_count": 7,
      "count": 495
    }
  ],
  "next_cursor": null,
  "rollup": {
    "cell_count": "sum",
    "count": "sum"
  }
}

4. No cell ids yet? Send an area
Copy link

Send near and radius_m for a circle. You get one row for every cell in the area, and each row has its cell id. This circle of 1 km around King's Cross holds 31 cells.

For a box, send bbox (south, west, north, east) instead, such as bbox=51.522,-0.140,51.538,-0.110.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/places/cells?near=51.5307,-0.1238&radius_m=1000"
Examples

Place counts on geohash squares instead of H3 cells, for teams that use geohashes. Each row has geohash instead of cell.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/places/cells?bbox=51.522,-0.140,51.538,-0.110&grid=geohash&precision=7"
200 · 100 squares, more pages

Shade = count054100 squares; a square opens its row.

Try these requests in the playground →