Open spaces
Copy link

Find parks, gardens, woods, heaths and beaches by name. You can also find out how green each H3 cell is, including cells in the countryside, and which open spaces each one contains.

This page answers questions such as:

  • Which parks are near here, largest first?
  • Where are the playgrounds?
  • How green is this rural area?

Open spaces come from Overture's land and land-use areas (overture). Green cover comes from Overture's satellite land cover (overture_land_cover). Where the parks, gardens, grass and woods mapped in those areas show more green in an H3 cell than the satellite does, green cover uses them instead, because the satellite misses them in towns. /v1/catalog/{country} names both sources in source_ids, and updated_at gives the date they were last loaded.

National Parks are boundaries, not open spaces. To find out whether a home is in a National Park, use /v1/boundaries?at= on Boundaries.

Request headers
Copy link

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

string

Required authentication header.

Named open spaces
Copy link

GET /v1/open-spaces

Returns the open spaces that touch the location you give. Only public open spaces are returned by default. Results are sorted largest first with sort=-area_m2, nearest first with near, and by id otherwise.

A space that lies inside a bigger one is folded into it, based on their actual outlines. The smaller space is left out of the list whenever the bigger one passes the class and access filters, even if the bigger one does not touch the location. For example, Avenue Gardens lies inside The Regent's Park, so class=garden lists it, but a list of every kind does not.

For long lists of cells, use POST /v1/open-spaces, which takes the same fields in a JSON body (see Long requests).

Parameters
Copy link

ParameterTypeDefaultWhat it doesExample
classclasses, comma-separated—Returns only these kinds of open space, such as park, garden, playground, wood, heath, nature_reserve and beach. The allowed field of a 400 error lists every kind.class=park,wood
accesspublic | restricted | allpublicrestricted returns only the kinds that /catalog lists as restricted, such as cemeteries, zoos and campsites. all returns both, with each row tagged in access. The same rule applies on every route that lists open spaces.access=all
min_area_m2m²—Returns only open spaces at least this big, measured by their whole size.min_area_m2=50000
sort-area_m2—Sorts the results largest first.sort=-area_m2
includecells—Adds each space's H3 cells, split into in_search (those the location covers) and outside (the rest). With this option, a page holds up to 100 rows.include=cells
resolution9 | 109The H3 cell size. At 10, parks, gardens, playgrounds, woods, beaches, cemeteries and the like use their own res-10 cells, and other open spaces count each of their res-9 cells as its 7 res-10 cells. cells, at, bbox and near are read at this size, and cell_count and cells_in_search count cells of this size.resolution=10

The endpoint also takes the following common parameters:

Each row contains:

  • id (os_gb_…)
  • name, or null for an unnamed space
  • class and access
  • area_m2: the whole size of the space, in m²
  • lat and lng
  • cell: the H3 cell that holds the space
  • cell_count: the number of H3 cells in the space
  • cells_in_search: how many of those cells the location covers
  • area_in_search_m2: area_m2 multiplied by the share of the space's cells that the location covers, in m²
  • distance_m, with near: the distance to the space's lat, lng
  • cells, with include=cells. At resolution 10, a space without its own res-10 cells lists the res-10 cells of each res-9 cell the location touches, and lists the rest of its res-9 cells whole in outside

Errors

CodeHTTPWhen
location_required400None of near, bbox, cells or at is given. This endpoint does not take country.
invalid_class400class is not an open-space class. allowed lists the valid ones.
invalid_access · invalid_sort · invalid_min_area_m2400access is not public, restricted or all, sort is not -area_m2, or min_area_m2 is below 0.
invalid_include400include is anything other than cells.
invalid_limit400limit is over 10,000, or over 100 with include=cells.
invalid_resolution400resolution is anything other than 9 or 10. allowed is [9, 10].
resolution_unindexed400resolution=10 in a country whose open spaces do not have res-10 cells yet: Canada, India, Italy, New Zealand, Slovenia and Turkey. Use 9 there.

The endpoint can also return any of the error codes listed under Location and Paging.

Examples

Get the 34 open spaces in a box around Regent's Park, largest first, with their H3 cells.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/open-spaces?bbox=51.518,-0.172,51.540,-0.140&sort=-area_m2&include=cells"
200 · 34 open spaces

34 pins; a pin opens its row.

Only the big ones. Add min_area_m2=50000 to keep only open spaces of 5 hectares or more. In this box, that leaves The Regent's Park and Primrose Hill. To find large open spaces by walking time instead, see Proximity.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/open-spaces?bbox=51.518,-0.172,51.540,-0.140&min_area_m2=50000&sort=-area_m2&include=cells"

One open space
Copy link

GET /v1/open-spaces/{id}

Returns one open space by id. The response includes parent, the space it is folded into, or null.

Parameters
Copy link

ParameterTypeDefaultWhat it doesExample
includecells—Adds cells, the space's resolution 9 H3 cells.include=cells

The response has the same fields as a row in the list, without the H3 cell counts. It adds parent, the id of the space it is folded into, or null, and cells with include=cells.

Errors

CodeHTTPWhen
invalid_id400The id is not an open-space id (os_gb_…).
not_found404There is no open space with this id.
invalid_include400include is anything other than cells.
Examples

Get The Regent's Park by id. include=cells adds its 13 H3 cells.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/open-spaces/os_gb_c70107ff-da5c-321d-8059-aa8574aadf80?include=cells"
200 · one open space

1 pin; it opens its row.

Open space per H3 cell
Copy link

GET /v1/open-spaces/cells

Returns how green each H3 cell is and which open spaces are in it. With group_by=all, you get one total row for everything you send instead. Every cell in the location is returned, with 0 and an empty list where it has no open space. Cells come back in the order sent with cells, and by cell id otherwise. Resolutions 9 and 10 are supported, and a group_by=all total also accepts coarser cell ids. For long lists of cells, use POST /v1/open-spaces/cells, which takes the same fields in a JSON body (see Long requests).

Parameters
Copy link

ParameterTypeDefaultWhat it doesExample
classclasses, comma-separated—Counts and lists only these kinds of open space. The response names them in class.class=playground
accesspublic | restricted | allpublicSets which open spaces appear in open_spaces. open_space_m2 always counts public open space only.access=all
resolution9 | 109The H3 cell size, as on /v1/open-spaces. Green cover is resolution 9 only, so green_m2, green_share and cover are left out at 10.resolution=10

The endpoint also takes the following common parameters:

Each row contains:

  • cell, or cell_count in the total
  • open_space_m2: the public open space in the H3 cell, in m², with each space's size spread evenly over its cells
  • green_m2: the green cover, in m²
  • green_share and cover: shares of the H3 cell, from 0 to 1. cover is split into trees, shrub, grass, crops, wetland and built, and green_share is everything except built
  • open_space_count: the number of open spaces
  • open_spaces: up to 5 open spaces, biggest first, each as {id, name, class, access, area_m2} at its whole size. A space folded into a bigger one is shown as the bigger one

In the total, the rollup block shows how each field is added up: sum for the m² fields and cell_count, area_weighted_mean for green_share and cover, distinct for open_space_count, and none for open_spaces, which is left out of totals.

Errors

CodeHTTPWhen
invalid_resolution400resolution is anything other than 9 or 10. allowed is [9, 10].
resolution_unindexed400The same as on /v1/open-spaces.
invalid_group_by400group_by is not cell or all. allowed lists them.
invalid_format400geojson is requested with group_by=all.
invalid_class · invalid_access400The same as on /v1/open-spaces.

The endpoint can also return any of the error codes listed under Location, Per-cell endpoints and Paging.

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. green_share is how much of the cell is green, cover splits the cell by land cover, and open_spaces names the open spaces in it.

You send

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

You get

{
  "resolution": 9,
  "results": [
    {
      "cell": "89195da4d03ffff",
      "open_space_m2": 2286,
      "green_m2": 2598,
      "green_share": 0.028,
      "cover": {
        "trees": 0,
        "shrub": 0,
        "grass": 0.028,
        "crops": 0,
        "wetland": 0,
        "built": 0.972
      },
      "open_space_count": 1,
      "open_spaces": [
        {
          "id": "os_gb_b64f90ef-0a32-36ee-8c41-f06baf5f920e",
          "name": "Catholic Central Library Gardens",
          "class": "park",
          "access": "public",
          "area_m2": 2286
        }
      ]
    }
  ],
  "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. The map shades each cell by its open space, from none to 1.5 ha. 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/open-spaces/cells?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff"
200 · 7 H3 cells

Shade = open_space_m20 m²1.5 ha7 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 5 open spaces, with 23,190 m² of open space. rollup says how each field was added up.

For a long list of cells, send POST /v1/open-spaces/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/open-spaces/cells?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff&group_by=all"

You get

{
  "resolution": 9,
  "results": [
    {
      "cell_count": 7,
      "open_space_m2": 23190,
      "open_space_count": 5,
      "green_m2": 22491,
      "green_share": 0.034,
      "cover": {
        "trees": 0,
        "shrub": 0,
        "grass": 0.034,
        "crops": 0,
        "wetland": 0,
        "built": 0.966
      }
    }
  ],
  "next_cursor": null,
  "rollup": {
    "cell_count": "sum",
    "open_space_m2": "sum",
    "open_space_count": "distinct",
    "open_spaces": "none",
    "green_m2": "sum",
    "green_share": "area_weighted_mean",
    "cover": "area_weighted_mean"
  }
}

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

Send bbox (south, west, north, east) for a box, or 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 box around Regent's Park holds 55 cells.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/open-spaces/cells?bbox=51.518,-0.172,51.540,-0.140"
Examples

With class=playground, only playgrounds are counted and listed. In this box, 7 of the 55 H3 cells contain one of the box's 6 playgrounds.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/open-spaces/cells?bbox=51.518,-0.172,51.540,-0.140&class=playground"
200 · 55 H3 cells

Shade = open_space_m20 m²4,213 m²55 H3 cells; click a cell to open its row.

This example uses the H3 cells of two real postcodes. You can use at= to find the cell for a point. GU26 6JA in Grayshott is all trees, with no open space mapped. SP6 2BQ in Woodgreen is on Woodgreen Common, a heath.

cover takes built from satellite land cover, and takes green from it too wherever the map shows less green. This means fields and woods count as green even where no open space is named. SP6 2BQ is also in the New Forest National Park. National Parks are boundaries rather than open spaces, because towns sit inside them too.

/v1/catalog/{country} publishes three separate definitions of green: green cover, open space and designations. Designations are served as boundaries, because towns sit inside them.

Try these requests in the playground →