Skip to content

Services

GET /contesto/servizi

Amenities found around the point, grouped by category, each with its distance and its geometry.

Example Request

curl --location 'https://sandbox-context.realitycs.it/contesto/servizi?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:

servizi holds thirteen categories: negozio, supermercato, asilo, scuola, universita, ospedale, ristorante, banca, farmacia, hotel, palestra, parcheggio and parco.

Every entry of a category has the same shape:

  • nome: Name of the place, in capitals.
  • distanza: Distance from the requested point, in metres.
  • geojson: Geometry of the place, as standard GeoJSON with type and coordinates.
  • tag: Sub category of the place. Only returned inside negozio, with values such as abbigliamento, bellezza and servizi.

Empty categories are null

A category with no result in the radius is set to null, not to an empty array. In the example below universita and ospedale are both null, which is the normal outcome at 250 metres.

parcheggio is a MultiPolygon

Twelve categories return a Point, with coordinates ordered longitude first. parcheggio instead returns a MultiPolygon tracing the outline of the car park, so its coordinates are nested four levels deep. Branch on geojson.type rather than assuming a point.

The same category comes back as a Point on Services by zone, so the two endpoints cannot share the same parsing code.

Results are capped at 500 per category

A dense area at the maximum radius hits the cap: in Milan at raggio=1000 both negozio and ristorante return exactly 500 entries. When you see 500, assume the list is truncated rather than complete.

Example Response

Note

Each category is truncated to one entry in the example below, and the MultiPolygon of parcheggio to three positions. The actual response returns everything found in the radius.

{
  "contesto": {
    "servizi": {
      "negozio": [
        {
          "nome": "SIENA MERCATO",
          "distanza": 88,
          "geojson": {
            "coordinates": [
              11.32553,
              43.32289
            ],
            "type": "Point"
          },
          "tag": "servizi"
        }
      ],
      "supermercato": [
        {
          "nome": "CONAD",
          "distanza": 233,
          "geojson": {
            "coordinates": [
              11.32863,
              43.32151
            ],
            "type": "Point"
          }
        }
      ],
      "asilo": [
        {
          "nome": "MONUMENTO",
          "distanza": 238,
          "geojson": {
            "coordinates": [
              11.32699,
              43.324138
            ],
            "type": "Point"
          }
        }
      ],
      "scuola": [
        {
          "nome": "ACHILLE SCLAVO",
          "distanza": 196,
          "geojson": {
            "coordinates": [
              11.32351,
              43.32238
            ],
            "type": "Point"
          }
        }
      ],
      "universita": null,
      "ospedale": null,
      "ristorante": [
        {
          "nome": "GOLD FINGER BAR",
          "distanza": 29,
          "geojson": {
            "coordinates": [
              11.32579,
              43.3224
            ],
            "type": "Point"
          }
        }
      ],
      "banca": [
        {
          "nome": "BANCA MONTE DEI PASCHI DI SIENA SPA",
          "distanza": 182,
          "geojson": {
            "coordinates": [
              11.32586,
              43.32379
            ],
            "type": "Point"
          }
        }
      ],
      "farmacia": [
        {
          "nome": "PARAFARMACIA DRUGSTORE SAN DOMENICO DOTTORE SECCIANI FRANCESCO",
          "distanza": 231,
          "geojson": {
            "coordinates": [
              11.3277,
              43.32054
            ],
            "type": "Point"
          }
        }
      ],
      "hotel": [
        {
          "nome": "NH EXCELSIOR",
          "distanza": 132,
          "geojson": {
            "coordinates": [
              11.327228,
              43.322844
            ],
            "type": "Point"
          }
        }
      ],
      "palestra": [
        {
          "nome": "DENTRO LE MURA",
          "distanza": 189,
          "geojson": {
            "coordinates": [
              11.32644,
              43.320493
            ],
            "type": "Point"
          }
        }
      ],
      "parcheggio": [
        {
          "nome": "PARCHEGGIO STADIO",
          "distanza": 37,
          "geojson": {
            "coordinates": [
              [
                [
                  [
                    11.32438,
                    43.321409
                  ],
                  [
                    11.324399,
                    43.321414
                  ],
                  [
                    11.324423,
                    43.321421
                  ]
                ]
              ]
            ],
            "type": "MultiPolygon"
          }
        }
      ],
      "parco": [
        {
          "nome": "LA LIZZA",
          "distanza": 124,
          "geojson": {
            "coordinates": [
              11.32626,
              43.323535
            ],
            "type": "Point"
          }
        }
      ]
    }
  }
}