Services by zone
GET /contesto/servizi_zona
Nearest amenities to the point, whatever their distance. Unlike Services it is not bound to a radius, and it also covers post offices.
Example Request
curl --location 'https://sandbox-context.realitycs.it/contesto/servizi_zona?latitudine=45.464664&longitudine=9.188540' \
--header 'Authorization: Bearer <token>'
Request Fields
| Field | Required | Default | Description | Type | Example | Notes |
|---|---|---|---|---|---|---|
latitudine | yes | Latitude of the point | number | 45.464664 | ||
longitudine | yes | Longitude of the point | number | 9.188540 |
raggio is accepted but ignored
As on Transport by zone, passing raggio neither fails nor changes the response. Use Services when you need to restrict the search to a given distance.
JSON keys in the response:
servizi_zona holds fourteen categories: negozio, supermercato, asilo, scuola, universita, ospedale, ristorante, banca, farmacia, ufficio_postale, hotel, palestra, parcheggio and parco.
Every entry 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 a GeoJSON
Pointwithcoordinatesordered longitude first. - tag: Sub category of the place. Only returned inside
negozio.
Up to 10 results per category
Each category returns at most 10 entries, ordered by increasing distance, so the first one is always the nearest. A category can return fewer when there is nothing else nearby.
ufficio_postale exists only here
Services returns thirteen categories and never includes ufficio_postale, even at the same point and at the maximum radius. If you need post offices, this is the only endpoint that reports them.
parcheggio is a Point here, a MultiPolygon there
On this endpoint every category, parcheggio included, comes back as a Point. On Services parcheggio is returned as a MultiPolygon outlining the car park. The two endpoints therefore need different handling for the same category.
Names can be blank
Some entries carry a nome made of a single space, as happens for a hospital in the example data. Trim the value and fall back to the category label when the result is empty, rather than rendering a blank line.
Example Response
Note
Each category is truncated to one entry in the example below, the actual response returns up to 10 per category.
{
"contesto": {
"servizi_zona": {
"negozio": [
{
"nome": "CIELO",
"distanza": 16,
"geojson": {
"coordinates": [
9.18867,
45.46477
],
"type": "Point"
},
"tag": "servizi"
}
],
"supermercato": [
{
"nome": "CONAD CITY",
"distanza": 687,
"geojson": {
"coordinates": [
9.180986799,
45.461510895
],
"type": "Point"
}
}
],
"asilo": [
{
"nome": "BAMBI & BIMBI",
"distanza": 124,
"geojson": {
"coordinates": [
9.189982,
45.4642035
],
"type": "Point"
}
}
],
"scuola": [
{
"nome": "SC. EL.PAPA GIOVANNI PAOLO II",
"distanza": 124,
"geojson": {
"coordinates": [
9.189982,
45.4642035
],
"type": "Point"
}
}
],
"universita": [
{
"nome": "UNIVERSITÀ DEGLI STUDI DI MILANO",
"distanza": 411,
"geojson": {
"coordinates": [
9.186722999,
45.461190695
],
"type": "Point"
}
}
],
"ospedale": [
{
"nome": " ",
"distanza": 859,
"geojson": {
"coordinates": [
9.177563667,
45.465026855
],
"type": "Point"
}
}
],
"ristorante": [
{
"nome": "7'S GIÃ’",
"distanza": 18,
"geojson": {
"coordinates": [
9.18841,
45.46453
],
"type": "Point"
}
}
],
"banca": [
{
"nome": "BANCA POPOLARE DI LODI",
"distanza": 71,
"geojson": {
"coordinates": [
9.18763,
45.46461
],
"type": "Point"
}
}
],
"farmacia": [
{
"nome": "FARMACIA, PIAZZA DEL DUOMO",
"distanza": 60,
"geojson": {
"coordinates": [
9.18854,
45.46412
],
"type": "Point"
}
}
],
"ufficio_postale": [
{
"nome": "MILANO CENTRO",
"distanza": 265,
"geojson": {
"coordinates": [
9.185151299,
45.464676595
],
"type": "Point"
}
}
],
"hotel": [
{
"nome": "TOWNHOUSE DUOMO MILANO",
"distanza": 70,
"geojson": {
"coordinates": [
9.189321799,
45.464969495
],
"type": "Point"
}
}
],
"palestra": [
{
"nome": "CITY CLUB",
"distanza": 244,
"geojson": {
"coordinates": [
9.187875299,
45.462516895
],
"type": "Point"
}
}
],
"parcheggio": [
{
"nome": "AUTOSILO SAN BARNABA",
"distanza": 855,
"geojson": {
"coordinates": [
9.19780171,
45.45937665
],
"type": "Point"
}
}
],
"parco": [
{
"nome": "ORTO BOTANICO DI BRERA",
"distanza": 553,
"geojson": {
"coordinates": [
9.188934057,
45.47080184
],
"type": "Point"
}
}
]
}
}
}