NAV

Introduction

Welcome on the Neopark API Guide! It describes who to use our API, in version 2, where you will find data about parkings.

Before using our API, you need to create an account. You can create a free account by registering here.

Authentication

Example Request

$ curl "https://neopark.io/api-partners/web/v2/hello"
    -u user:pass

The Neopark API uses HTTP Basic Authentication over SSL.

Endpoints overview

The root endpoint is https://neopark.io/api-partners/web/v2/ and we currently have the following endpoints.

Method Path Description
GET /hello Test purpose
GET /parkings/simple List of parkings
GET /parkings/{parking_id}/simple Data on a specific parking

Definitions

GET /hello

Example Request

curl "https://neopark.io/api-partners/web/v2/hello" -u user:pass

JSON Response in case of success

{ "message": "Hello world" }

JSON Response in case of wrong API key used

{
  "status_code": 401,
  "error_type": "unauthorized",
  "error_message": "Your API authentication is wrong"
}

Simple endpoint to test the API connection.

Returns

A simple message with the text "Hello world".

GET /parkings/simple

Example Request

$ curl "https://neopark.io/api-partners/web/v2/parkings/simple?lat=48.860161&lng=2.346553&rad=0.8"
    -u user:pass

JSON Response

[
  {
    "parking": {
      "parking_id": 612,
      "name": "Parking Sébastopol",
      "main_location": {
        "lat": 48.860708,
        "lng": 2.34942,
        "dist": 0.21808138475867,
        "address": "43 bis boulevard de Sébastopol",
        "town": "PARIS",
        "zipcode": "75001",
        "country_code": "FR"
      },
    },
    "dist": 0.76,
    "offer": false,
    "price": null,
    "currency": null
  },
  {
    "parking_id": 6890,
    "name": "Parking Les Halles St Eustache",
    "main_location": {
      "lat": 48.8634289,
      "lng": 2.3439805,
      "dist": 0.40866000012317,
      "address": "22 Rue des Halles",
      "town": "PARIS",
      "zipcode": "75001",
      "country_code": "FR"
    },
    "booking_offers": [
      {
        "booking_center_id": 3,
        "booking_center_name": "Neoparking",
        "booking_center_slug": "neopark",
        "booking_urls": {
          "FR": "https://www.neoparking.com/...",
          "EN": "https://en.neoparking.com/...",
          "ES": "https://es.neoparking.com/...",
          "IT": "https://it.neoparking.com/...",
          "DE": "https://de.neoparking.com/...",
          "NL": "https://nl.neoparking.com/..."
        }
      },
      {
        "booking_center_id": 1,
        "booking_center_name": "Zenpark",
        "booking_center_slug": "zenpark",
        "booking_urls": {
          "FR": "http://www.neopark.io/..."
        }
      },
      {
        "booking_center_id": 2,
        "booking_center_name": "TRIP'N'DRIVE",
        "booking_center_slug": "tripndrive",
        "booking_urls": {
          "FR": "http://www.neopark.io/...",
          "EN": "http://www.neopark.io/...",
          "ES": "http://www.neopark.io/...",
          "IT": "http://www.neopark.io/...",
          "DE": "http://www.neopark.io/..."
        }
      }
    ]
  },
  {"...":"..."}
]

Parameters

Property Type Required Description
lat float required The latitude of the search
lng float required The longitude of the search
rad float required The radius of the search, in kilometers. Must be lower than 5
from DateTime optional The begining of the search
to DateTime optional The end of the search

Returns

Returns a list with informations about parkings, ordered by distance. Each element of the list contains the following properties.

Property Type Description
parking Parking Parking data
dist float The distance, in kilometers, from the parking main location to the point (lat,lng)
offer bool Indicates if there is a booking offer for this parking
urls LanguageUrls A list of URLs (in different languages) of a booking offer when there is an offer. Otherwise it is URLs to http://parking-public.fr
price (1) float | null The price of the offer when there is an offer (null otherwise)
currency (1) string | null The currency code ("EUR" for euro) when there is an offer (null otherwise)

(1) Only displayed when from and to are set.

GET /parkings/{parking_id}/simple

Argument

The only argument, parking_id, represents the id of the parking you want details.

Parameters

Property Type Required Description
from DateTime optional The begining of the search
to DateTime optional The end of the search

Returns

Property Type Description
parking Parking Parking data
offer bool Indicates if there is a booking offer for this parking
urls LanguageUrls A list of URLs (in different languages) of a booking offer when there is an offer. Otherwise it is URLs to http://parking-public.fr
price float | null The price of the offer when there is an offer (null otherwise). This property is displayed only when from and to are set
currency string | null The currency code ("EUR" for euro) when there is an offer (null otherwise). This property is displayed only when from and to are set

Objects

Parking

Parking Object Example

{
  "parking_id": 6890,
  "name": "Parking Les Halles St Eustache",
  "main_location": {
      "lat": 48.8634289,
      "lng": 2.3439805,
      "dist": 0.40866000012317,
      "address": "22 Rue des Halles",
      "town": "PARIS",
      "zipcode": "75001",
      "country_code": "FR"
    }
}
Attributes Type Description
parking_id int Parking id
name string Parking name
main_location Location Parking main location

Location

Location Object Example

{
  "lat": 48.8634289,
  "lng": 2.3439805,
  "dist": 0.40866000012317,
  "address": "22 Rue des Halles",
  "town": "PARIS",
  "zipcode": "75001",
  "country_code": "FR"
}
Attributes Type Description
lat int Latitude
lng string Longitude
address string Address
town string Town
zipcode string Zipcode
country_code string Country code (eg: FR for France)

MultiLangStrings

MultiLangStrings Object Example

{
  "FR": "https://www.neoparking.com/...",
  "EN": "https://en.neoparking.com/...",
  "ES": "https://es.neoparking.com/...",
  "IT": "https://it.neoparking.com/...",
  "DE": "https://de.neoparking.com/...",
  "NL": "https://nl.neoparking.com/..."
}

MultiLangStrings is a list where the key is a language code and the value is a string.

Formats

DateTime

The Neopark API support the ISO-8601 format for passing in dates and times. The full format is YYYY-MM-DDTHH:mm:ss.sssZ but shorter versions can be used.

Short version Translation
2016-07-14 2016-07-14T00:00:00.000Z
2016-07-14T20:42 2016-07-14T20:42:00.000Z
2016-07-14T20:42Z 2016-07-14T20:42:00.000Z (GMT timezone)
2016-07-14T20:42-0700 2016-07-14T20:42:00.000-0700 (US Pacific time zone)

Country codes

The country code follows the ISO 3166-1 standard. All the values in our API can be find below.

Country code Country
AT Austria
BE Belgium
CH Switzerland
DE Germnay
ES Spain
FR France
GB United Kingdom
IT Italy
LU Luxembourg
MC Monaco
NL Netherlands
PT Portugal

Prices and currencies

Prices are always a float value and associated with a currency.

Errors

Example of JSON Response Error

{
  "status_code": 402,
  "error_type": "invalid_parking_id",
  "error_message": "There is no parking with id '42' or you can't access it.",
}

When an error happen, 3 elements are displayed to explain the error:

Status Code

400 Bad Request The request was unacceptable, often due to a missing required parameter
401 Unauthorized No valid API key provided
402 Request Failed The parameters were valid but the request failed
403 Forbidden You don't have the rights to access this route
404 Not Found The specified route was not found
405 Method Not Allowed You tried to access a route with an invalid method
429 Too Many Requests You're requesting too many routes! Slow down!
500 Internal Server Error We had a problem with our server.

Error Type

bad_request Unacceptable, often due to a missing required parameter
forbidden Access Denied for this route
invalid_parking_id Invalid parking id specified in the route
not_found Specified route was not found
unauthorized Invalid credentials provided
internal_error For internal errors(5xx status code)
unknown_error For other errors