Skip to content

Transport

GET /contesto/trasporti

Public transport stops found around the point, grouped by category, each with its distance and its geometry.

Example Request

curl --location 'https://sandbox-context.realitycs.it/contesto/trasporti?latitudine=43.32215&longitudine=11.3259&raggio=250' \
--header 'Authorization: Bearer <token>'

Request Fields

Field Required Default Description Type Example Notes
latitudine yes Latitude of the point number 43.32215
longitudine yes Longitude of the point number 11.3259
raggio optional 500 Search radius around the point, in metres number 250 From 1 to 1000

JSON keys in the response:

trasporti holds four categories: bus_fermata (bus stop), metro_fermata (underground stop), tram_fermata (tram stop) and stazione (railway station).

Every entry has the same shape:

  • nome: Name of the stop, in capitals.
  • distanza: Distance from the requested point, in metres.
  • geojson: Geometry of the stop, as a GeoJSON Point with coordinates ordered longitude first.

Empty categories are null

A category with no stop in the radius is set to null, not to an empty array. In the example below three categories out of four are null, which is the usual outcome outside a large city.

Duplicated stops are normal

The same physical stop is often returned several times under slightly different names and almost identical coordinates, one per line or per travel direction. Deduplicate on your side if you need a count of distinct stops rather than of services.

Looking for the nearest station?

This endpoint only sees within a kilometre, so stazione is frequently null. To get the nearest railway station, airport, port or motorway exit whatever the distance, use Transport by zone.

Example Response

Note

bus_fermata is truncated to two entries in the example below, the actual response returns every stop in the radius.

{
  "contesto": {
    "trasporti": {
      "bus_fermata": [
        {
          "nome": "VIA TOZZI",
          "distanza": 156,
          "geojson": {
            "coordinates": [
              11.327807,
              43.322005
            ],
            "type": "Point"
          }
        },
        {
          "nome": "SIENA-VIA TOZZI",
          "distanza": 164,
          "geojson": {
            "coordinates": [
              11.327684,
              43.322842
            ],
            "type": "Point"
          }
        }
      ],
      "metro_fermata": null,
      "tram_fermata": null,
      "stazione": null
    }
  }
}