Contents:
This API call returns details of the Photo of the day.
The Photo of the day is a photo taken on the same date of the year, in a previous year, selected by the Cyclestreets review team for each day.
Very occasionally, due to personnel availability, a Photo of the day might not have been set, in which case an error is returned, as per the example below. It is important for the client application be tolerant of this scenario.
'Today' is defined with reference to the United Kingdom time zone.
Example which retrieves today's Photo of the day, specifying the thumbnail size in the returned data, and that the date should be pre-formatted.
https://api.cyclestreets.net/v2/photomap.photooftheday?thumbnailsize=640&datetime=friendlydate
Result:
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "id": 70562, "caption": "Lovely picture of good cycle practice in Porto, Portugal", "hasPhoto": true, "thumbnailUrl": "https://www.cyclestreets.net/location/70562/cyclestreets70562-size640.jpg", "username": "martin", "licenseName": "Public domain", "datetime": "22nd April, 2015" }, "geometry": { "type": "Point", "coordinates": [ -8.6769, 41.150661 ] } } ] }
None.
date=2016-03-28
, to be specified instead.Controls what information is returned for each location. It is strongly recommended to send this, so that clients receive exactly the data they need.
Available fields are listed on the photomap.locations API page.
If fields is not supplied, the default is used, which represents a sensible and useful set of fields.
The fields id,latitude,longitude,caption are always returned.
When the data is returned in the geojson format, the values for latitude,longitude appear only in the /geometry/coordinates field rather than being duplicated in the properties list.
Fields are returned in the ordering specified by the caller.
Unrecognised fieldnames are simply ignored rather than an error being thrown.
If specified, the datetime field (if requested in the fields list) will be converted from unixtime (the default output format) to a formatted version; the available output formats are:
date ('g:ia, jS F Y', $date)
in PHPdate ('jS F, Y', $date)
in PHPGeoJSON object as per example above, in the same format as the photomap.location v2 API call, but with datetime
as an additional default field.
JSON object containing an error key and a text string.
Example errors (text string will vary):
{ "error": "No photo has been set for today." }
{ "error": "The specified date is invalid." }