Donate using PayPal

CycleStreets API (v2)

  • Details for:
  • API overview
  • Obtain API key
  • Usage policy
  • Uptime policy

Photo of the day

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

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
                ]
            }
        }
    ]
}

Request parameters - required

None.

Request parameters - optional

date string, YYYY-MM-DD
By default, the Photo of the day will be for today. This parameter enables a specific date, e.g. date=2016-03-28, to be specified instead.
fields string, comma-separated list of fields from the list on the photomap.locations API page,
  default id,latitude,longitude,caption,hasPhoto,thumbnailUrl,username,licenseName,datetime

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.

thumbnailsize int 60|120|150|180|200|250|300|350|400|425|450|500|640|800|1000|1200|1500|1800|2000 (default 425)
The thumbnail size used in the thumbnail URLs shown within the data. At present, only the stated sizes are supported; however we plan to remove this limitation shortly; for now, if you require another size, please let us know and we will add it as a supported size. If an unsupported size is specified, the default (425) is currently returned.
datetime string

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:

  • friendly A friendly format suitable for showing on a webpage, e.g. '6:55pm, 4th October 2013'; this is equivalent to date ('g:ia, jS F Y', $date) in PHP
  • friendlydate A friendly date format suitable for showing on a webpage, e.g. '4th October, 2013'; this is equivalent to date ('jS F, Y', $date) in PHP
  • sqldatetime SQL DATETIME format (i.e. simplified ISO 8601 format): YYYY-MM-DD HH:MM:SS
  • unixtime Unixtime (the default)

Response

GeoJSON object as per example above, in the same format as the photomap.location v2 API call, but with datetime as an additional default field.

Error response

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."
}

We welcome your feedback, especially to report bugs or give us route feedback.

My comments relate to: *






Your comments: *
URL of page: * https://canterbury.cyclestreets.net/api/v2/photomap.photooftheday/
How did you find out about CycleStreets?:
Your name:
Our ref: Please leave blank - anti-spam measure

* Items marked with an asterisk [*] are required fields and must be fully completed.