Note the distinction between a place and a location. A location is a Safe Place location, from our database. A place is a geocoded entity return by Google Web Services.
/locations/all/
/locations/near/@[latitude],[longitude]/
/locations/bb/@[north],[west],[south],[east]/[page]/
/place/autocomplete/[input]/
/place/details/[place_id]>/
A complete list of every Safe Place location in the database. You probably don't want to use this since it returns a lot of records!
Required Parameters
None
Optional Parameters
None
Example
curl -X GET http://api.safeplaces.org.uk/locations/all/
Typical Response
{
"locations":
[
{
"latitude": "53.797178",
"name": "Leeds City Bus Station",
"longitude": "-1.535832"
},
{
"latitude": "53.796792",
"name": "Leeds City Bus Station",
"longitude": "-1.535822"
},
{
"latitude": "53.921626",
"name": "Farnley Hall",
"longitude": "-1.672454"
},
{
"latitude": "53.817910",
"name": "Sensory Leeds CIC",
"longitude": "-1.594371"
},
{
"latitude": "53.906231",
"name": "Otley Court House",
"longitude": "-1.693260"
},
{
"latitude": "53.772553",
"name": "Hamara Healthy Living Centre",
"longitude": "-1.550564"
},
.
.
.
List the three nearest Safe Place locations that are currently open and within 15 minutes walk of the specified lat-lng.
Required Parameters
@latitude,longitude of a search origin.
Optional Parameters
None
Example
curl -X GET http://api.safeplaces.org.uk/locations/near/@53.7959731,-1.5563807/
Response
{
"locations":
[
{
"latitude": "53.800904",
"rank": 1,
"name": "College House",
"longitude": "-1.558415"
},
{
"latitude": "53.800904",
"rank": 2,
"name": "Park Lane Campus",
"longitude": "-1.558415"
},
{
"latitude": "53.800066",
"rank": 3,
"name": "Oxford Place Centre",
"longitude": "-1.550650"
}
]
}
List all the currently open Safe Place locations within the given bounding box. Results are paged, 30 locations per page.
Required Parameters
@north,west corner of the bounding box in lat-lng coordinates.
south,east corner of the bounding box in lat-lng coordinates.
Optional Parameters
page number to retrieve.
Example
curl -X GET http://api.safeplaces.org.uk/locations/bb/@53.809840,-1.561733,53.802415,-1.548042/
Response
{
"count": 1,
"page": 1,
"page_size": 30,
"previous": "",
"next": "",
"locations":
[
{
"latitude": "53.806979",
"longitude": "-1.560689",
"id": 333,
"rank": 100,
"name": "Leeds Institute of Health Sciences"
}
]
}
List of place_idS that partially match the 'input' text. The whole of the UK is searched unless you provide a latitude and longitude that will bias the results to somewhat near the specified location.
Required Parameters
input search string.
Optional Parameters
@latitude,longitude of a search origin to bias the results.
Example
curl -X GET http://api.safeplaces.org.uk/place/autocomplete/Leeds%20Bu/
Response
{
"status": "OK",
"predictions":
[
{
"terms":
[
{
"value": "Leeds Building Society",
"offset": 0
},
{
"value": "Kingsway",
"offset": 24
},
{
"value": "London",
"offset": 34
},
{
"value": "United Kingdom",
"offset": 42
}
],
"description": "Leeds Building Society, Kingsway, London, United Kingdom",
"reference": "ClRHAAAAS7dIOYo95in3Hr6km09UUgPpzmW-98vJ70NTb-hZrBboHrzsQ3S5L-NgCLB8snrhsHyqp8YPrWXTDK5kh3gLwRAsFwXAPGrHqgVP51w3luQSEDtxsud0OPtg1l_CnAxExuMaFLYkry2JRlwULxfUq2tSKjxS8bWi",
"matched_substrings":
[
{
"length": 8,
"offset": 0
}
],
"place_id": "ChIJ8XwetMoEdkgR7oCRyANdIJ0",
"id": "c19c7608c7c8eb7ec2219bd31752445c4e6cba35",
"types":
[
"establishment"
]
},
{
"terms":
[
{
"value": "Leeds Building Society",
"offset": 0
},
{
"value": "High Street",
"offset": 24
},
{
"value": "Epsom",
"offset": 37
},
{
"value": "United Kingdom",
"offset": 44
}
],
"description": "Leeds Building Society, High Street, Epsom, United Kingdom",
"reference": "ClRIAAAAyO089CcfgcayqpZ4TL7eS_lAdExIaS8MYfC79dm0S3nDLM6J-z9MxJEAnUgigmOcRMW5IxXtzcw0dYxOn7GoM3mNPaJrMWYDqr9pOUgvpSQSEI3-1Sy3pyuZtj6yMFPT_fIaFB9KdqupjYJ1X0Svvg3KPDYTjM5A",
"matched_substrings":
[
{
"length": 8,
"offset": 0
}
],
"place_id": "ChIJz_9YoRHidUgRVJSjFx6-NXs",
"id": "2915a39de5d6101a86f7800dd00b4c11f6866339",
"types":
[
"establishment"
]
},
{
"terms":
[
{
"value": "Leeds Bus Station",
"offset": 0
},
{
"value": "York Street",
"offset": 19
},
{
"value": "Leeds",
"offset": 32
},
{
"value": "United Kingdom",
"offset": 39
}
],
"description": "Leeds Bus Station, York Street, Leeds, United Kingdom",
"reference": "ClRDAAAAcXUzoeTBGVzKaXl3-h6eEhfPe2pxKTIcgkDE0mwaOowTE-DSvlN298gWwEd7lvl85h74XnQGwtesIy128YfFai3D3IWbfahIHNP59KZDKNcSEBikaDXxn-p6ocDQj6x8VVEaFDR5C9apSNCxLiqTW-k2CN4ifx_b",
"matched_substrings":
[
{
"length": 8,
"offset": 0
}
],
"place_id": "ChIJ3-4lJhdceUgRnEoRGjFBGTU",
"id": "b390fc09639799445ac893cbe980c71a254aa240",
"types":
[
"transit_station",
"point_of_interest",
"establishment",
"geocode"
]
},
{
"terms":
[
{
"value": "Leeds Building Society",
"offset": 0
},
{
"value": "The Parade",
"offset": 24
},
{
"value": "Watford",
"offset": 36
},
{
"value": "United Kingdom",
"offset": 45
}
],
"description": "Leeds Building Society, The Parade, Watford, United Kingdom",
"reference": "ClRKAAAAe-6kjjw3vnqKknMn0_WdMLeoNweTZt3nrFo5J2M8m7WESHnl-BSUaIYorXFVeeMokC-9q5vvORwDpLOcWFBl_0dIMIS6XEa6x7N8dKFt6AISEElNScOF0GV1Hrw6mWJX5mwaFPl0xend86XcF17czPF3cxKGOagY",
"matched_substrings":
[
{
"length": 8,
"offset": 0
}
],
"place_id": "ChIJB_6eC8FqdkgRs4ZEPgClsLs",
"id": "27191bf71f7660ba7ba6c844192ff738557ba300",
"types":
[
"establishment"
]
},
{
"terms":
[
{
"value": "Leeds Building Society",
"offset": 0
},
{
"value": "Cross Street",
"offset": 24
},
{
"value": "Reading",
"offset": 38
},
{
"value": "United Kingdom",
"offset": 47
}
],
"description": "Leeds Building Society, Cross Street, Reading, United Kingdom",
"reference": "ClRLAAAAERWwTlE0ofnk8mWoymBKW7VLCr6uHIDrwjndNKw12gp91_CRWeIn4eUXtrRZUYi5x6-jpvW4vaADJXumTY1v1eJH1FaG_KXY8fI_hOzyRYYSENhs6G6mznZArDSg5nDwg-YaFNMCzCLJY2EJsFrzzq6hVb7rcK9r",
"matched_substrings":
[
{
"length": 8,
"offset": 0
}
],
"place_id": "ChIJndeQsRebdkgRhy_cYNrqgEM",
"id": "0b00ec0bbbed2812602941a7bd10a69e9aadc317",
"types":
[
"establishment"
]
}
]
}
A geographical feature represented by the given place ID.
Required Parameters
None
Optional Parameters
None
Example
curl -X GET http://api.safeplaces.org.uk/place/details/ChIJ3-4lJhdceUgRnEoRGjFBGTU/
Response
{
"status": "OK",
"html_attributions": [ ],
"result":
{
"website": "http://www.wymetro.com/BusTravel/BusStationsAndStops/LCBS",
"rating": 3.9,
"utc_offset": 60,
"user_ratings_total": 35,
"name": "Leeds City bus station",
"reference": "CnRpAAAAATwzuJdpVzm-7nylkHMnZKTqlBw2D8AGCmwhekhhOzRu13WhduRrrYHks20QxGChKWYreSfujYAiscECu9E3tG_g9tjHSzOCki4MLfQTjkDR5uWSdZbgAMsWEDOR9knZ-27jE9Ao8ACoOGDH78KCvRIQGuMTuAfqWQDuJZpohA4V_BoUC_r6cFtiLhp9EO2sTkd91v-wTaw",
"geometry":
{
"location":
{
"lat": 53.7971339,
"lng": -1.5356426
}
},
"adr_address": "<span class=\"street-address\">York St</span>, <span class=\"extended-address\">City Centre</span>, <span class=\"locality\">Leeds</span> <span class=\"postal-code\">LS2 7HU</span>, <span class=\"country-name\">United Kingdom</span>",
"place_id": "ChIJ3-4lJhdceUgRnEoRGjFBGTU",
"international_phone_number": "+44 113 245 7676",
"vicinity": "York Street, City Centre, Leeds",
.
.
.