This repository has been archived by the owner. It is now read-only.
mudar edited this page Oct 28, 2012 · 6 revisions

GeoJSON API to get the geo-location of spots where parking is allowed during a specific period of time.

###Base URL

http://www.parkcatcher.com/api/?
day=5&hour=10.5&duration=2&
latCenter=45.508918&lonCenter=-73.553617&radius=100&
latNW=45.500564421707544&lonNW=-73.56202840805054&latSE=45.49463845610178&lonSE=-73.54838132858276&
lang=fr&descHtml=1

##GET Arguments

###Required:

  • *day: integer.
    The start day of the requested parking period. Values range from 1 (Monday) to 7 (Sunday). Defaults to current day.
  • *hour: decimal.
    The start hour of the requested parking period. Values range from 0 to 24. Defaults to current time, floored to the nearest 30 minutes.
    Ex: 1 = 1 AM, 10.5 = 10:30 AM, 23.25 = 11:15 PM.
  • *duration: integer.
    The total duration of the requested parking period. Values range from 0.5 to 48. Default is 2 hours.
    The City laws don't allow parking for more than 48 hours at the same spot. Durations shorter than 30 min are ignored since 99% of the panels are at HH:00 or HH:30.

###Destination Type #1, Using Bounds:

  • latNW: float.
    Nort-West latitude geographical bound.
    Ex: 45.500564421707
  • lonNW: float.
    Nort-West longitude geographical bound.
    Ex: 45.500564421707
  • latSE: float.
    South-East latitude geographical bound.
    Ex: 45.500564421707
  • lonSE: float.
    South-East longitude geographical bound.
    Ex: 45.500564421707

###Destination Type #2, Using Center and Radius:
(Will be supported soon...)

  • latCenter: float.
    Center latitude geographical point.
    Ex: 45.508918
  • lonCenter: float.
    Center longitude geographical point.
    Ex: -73.553617
  • radius: integer.
    Unit is metres. Values range from 50 to 500.

###Optional:

  • lang: string.
    Language output for panels description. Supported values are fr (default) and en.
    (English output will be supported soon...)
  • descHtml: boolean.
    Output format of panels descriptions. 0/false (default): Panels descriptions and categories are returned in an array of objects. 1/true: panels descriptions are are grouped in HTML <li> tags, categories are included as CSS classes.

###Notes:

  • Besides the first three required arguments { day, hour, duration }, you need to provide the destination arguments.
    Type #1 requires four arguments { latNW*, lonNW, latSE, lonSE }.
    Type #2 requires three arguments { latCenter, lonCenter, radius }.
  • Data provided by the city has a geographical point precision of 12.
    Ex: 45.500564421707

Query Examples:

Output Examples

Panels descriptions in two arrays of raw text, descHtml=0

{
    "status": "ok",
    "name": "PARKING",
    "type": "FeatureCollection",
    "count": 73,
    "features": [
        {
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -73.5574796176,
                    45.4966591928
                ]
            },
            "type": "Feature",
            "properties": {
                "panels": [
                    {
                        "desc": "\\\\P 19h-07h",
                        "cat": "STATIONNEMENT"
                    }
                ]
            },
            "id": 1
        },
        {
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -73.557771253373,
                    45.499534046675
                ]
            },
            "type": "Feature",
            "properties": {
                "panels": [
                    {
                        "desc": "P 02h 09h-21h",
                        "cat": "STATIONNEMENT"
                    },
                    {
                        "desc": "\\\\P 19h30-20h30 LUN. JEU. 1 MARS AU 1 DEC.",
                        "cat": "STATIONNEMENT"
                    }
                ]
            },
            "id": 3
        }
    ]
}

Panels descriptions in HTML format, descHtml=1

{

    "status": "ok",
    "name": "PARKING",
    "type": "FeatureCollection",
    "count": 73,
    "features": [
        {
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -73.5574796176,
                    45.4966591928
                ]
            },
            "type": "Feature",
            "properties": {
                "desc": "<li class=\\"prk\\">19h-07h</li>"
            },
            "id": 1
        }
    ]
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.