REST API

Register new developer

The registration is needed for using REST API. Type your email address and you will obtain a password.

REST API Documentation

REST Interafce

API uses REST-like interface. This means that all calls to the API are made over the Internet, using HTTP GET and POST requests to the API server (http://cloud.eyedea.cz/api/v2). Any programming language that can be used to communicate over HTTP can be used for client-side implementations.

Photo can be uploaded directly in the API request. A requests that uploads a photo must be formed as a MIME multi-part message sent using POST data. Each argument, including the raw image data, should be specified as a separate chunk of form data. (See example below)

Responses are returned in JSON format.

API Methods

usage notes:

All coordinates and sizes are provided in pixels.

The maximum image size you can treat with is 10MB.

url:

http://cloud.eyedea.cz/api/v2/cardetect.json

parameters:
  • email [string] - the email provided by user during registration.
  • password [string] - the user's password obtained after registration.
  • url (use only with GET method) [string] - an URL of inspected image.
  • upload (use only with POST method) [binary] - uploaded image file.
  • lp_version[integer] (optional) - numeric code for specifying the license plate's country origin. Codes with country codes and license plate's dimension follows:
    • 1 - A,B,CZ,D,E,F,H,NL,P,PL,S,SK,TR [52x11cm]
    • 2 - I [front: 36x11cm, rear: 52x11cm]
    • 3 - CH [30x8cm]
    • 4 - FIN [44x12cm]
  • lp_tl_x [float] (optional) - pixel vertical position of the license plate's top left corner.
  • lp_tl_y [float] (optional) - pixel horizontal position of the license plate's top left corner.
  • lp_br_x [float] (optional) - pixel vertical position of the license plate's bottom right corner.
  • lp_br_y [float] (optional) - pixel horizontal position of the license plate's bottom right corner.
  • use_detector [boolean] (optional) - specifies whether to use the license plate detector for vehicle localization (default value is true).
return values:
  • photos [array] - a list of photos (in current version only one photo at time can be passed to the function).
    • width [integer]
    • height [integer]
    • tags [array]
      • top_left [array] - top left corner of detected license plate.
        • x [float]
        • y [float]
      • bottom_right [array] - bottom right corner of detected license plate.
        • x [float]
        • y [float]
      • lp_detection_confidence [float] - value greater than 0.
      • auto_detection [integer] - indicates whether the license plate detector was used for vehicle localization. Could be 0 or 1.
      • lp_text_content [string] - text content of detected license plate.
      • ilpc [string] - country code of the license place.
      • category [string] - could be one of the following: BUS, CAR, HVT, LGT, VAN.
      • category_score [float] - value between 0 and 1.
      • make [string] - vehicle make.
      • make_score [float] - value between 0 and 1.
      • model [string] - vehicle model.
      • model_score [float] - value between 0 and 1.
      • color [string] - vehicle color.
      • color_score [float] - value between 0 and 1.
      • view [string] - could be one of the following: frontal, rear.
  • status [string] - could be "success" or "failure".
  • error_code [integer] - specified only when an error occurs.
  • error_message [string] - specified only when an error occurs.

GET example:

http://cloud.eyedea.cz/api/v2/cardetect.json?email=your_email&password=your_password&url=url_of_image

POST example: (post to http://cloud.eyedea.cz/api/v2/cardetect.json)

				Content-Type: multipart/form-data; boundary=nonRelevantString
				Content-Length: 104687
				-----------------------------nonRelevantString
				Content-Disposition: form-data; name="email"
				your_email
				-----------------------------nonRelevantString
				Content-Disposition: form-data; name="password"
				your_password
				-----------------------------nonRelevantString
				Content-Disposition: form-data; name="upload"; filename="image.jpg"
				Content-Type: image/jpeg
			

Code example in python:
				import apiclient

				x = apiclient.carDetect('your_email', 'your_password', 'your_image.jpg', use_detector=True)
				y = apiclient.carDetect('your_email', 'your_password', 'your_image.jpg', use_detector=False, lp_tl_x=410, lp_tl_y=390, lp_br_x=490, lp_br_y=420, lp_version=1)
			
Download python api client

The apiclient can be called also directly from command line:

				python apiclient.py carDetect -e your_email -p your_password -img vcl_example002.jpg -uD
			
error codes:
error_codeerror_message
20IMG_DECODE_ERROR
29UPLOAD_ERROR
31DOWNLOAD_ERROR_FILE_NOT_FOUND
33DOWNLOAD_ERROR_FILE_TOO_LARGE
34DOWNLOAD_ERROR_MALFORMED_URL
104INTERNAL_ERROR
204INVALID_LOGIN
402MISSING_ARGUMENTS
205DAILY_API_USAGE_LIMIT_EXCEEDED