Donate using PayPal

CycleStreets API (v2)

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

Photomap categories

This API call returns all the photo categories (e.g. cycleparking,obstruction,etc.) and metacategories (e.g. good,bad,event,etc.) available in the Photomap (e.g. see the categorisation page or the legend on the main Photomap page).

The data will include a Unixtime value indicating the cache validity, e.g.: validuntil: 1284497262 . Clients should cache the data until this time.

Example

Example which retrieves the data.

https://api.cyclestreets.net/v2/photomap.categories

Result:

{
    "validuntil": 1402189242,
    "categories": {
        "cycleparking": {
            "name": "Cycle parking",
            "plural": "Cycle parking",
            "description": "Photos of parked cycles, on racks, railings, in shelters. Or photos of cycle racks themselves.",
            "iconProperties": "26x20,13x20,0x-20,37x22,15x20",
            "iconLocation": "/images/categories/iconsets/cyclestreets/svg/cycleparking_neutral.svg"
        },
        "obstructions": {
            "name": "Obstruction",
            "plural": "Obstructions",
            "description": "A narrow place, difficult for cycles to pass.",
            "iconProperties": "33x20,17x20,0x-20,35x26,17x26",
            "iconLocation": "/images/categories/iconsets/cyclestreets/svg/obstructions_neutral.svg"
        },
        
        …
		
        "general": {
            "name": "Other",
            "plural": "Other",
            "description": "A general photo.",
            "iconProperties": "12x20,6x20,0x-20,27x23,9x20",
            "iconLocation": "/images/categories/iconsets/cyclestreets/svg/general_neutral.svg"
        }
    },
    "metacategories": {
        "bad": {
            "name": "Problem",
            "description": "A problem that needs to be fixed"
        },
        "good": {
            "name": "Good practice",
            "description": "An example of good practice"
        },
        "other": {
            "name": "Infrastructure",
            "description": "Other (infrastructure-related)"
        },
        "any": {
            "name": "Misc",
            "description": "Non-specific"
        },
        "event": {
            "name": "Event",
            "description": "Event or temporary issue"
        }
    }
}

Request parameters - required

None.

Request parameters - optional

counts int 1
Whether to include counts, which will appear within the category list. This will include only those locations with a photo.

Response

JSON structure as per example above.

Error response

JSON object containing an error key and a text string.

Example error (text string will vary):

{
    "error": "Problem retrieving the categories/metacategories."
}

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

My comments relate to: *






Your comments: *
URL of page: * https://edinburgh.cyclestreets.net/api/v2/photomap.categories/
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.