Stream Cloud API Reference
Stream Cloud API provides methods to upload videos for processing in the cloud and receive results via webhooks. This requires a Stream Cloud license with video upload enabled.
Stream Cloud Video Upload API
To enable video upload for your stream cloud license, visit graphical configuration page:
- Add at least one webhook to forward results to.
- Click on Video Upload, optionally enter a preferred Camera ID then Submit
- The page will now show Video Upload. Click on Camera Processing to enable back camera processing.
- View your list of Stream cloud licenses to quickly find the one with video upload enabled
- Licenses with upload enabled cannot be run concurrently on premise
- Videos must be downloadable from upload_url without encryption
- The video size limit is 100 MB
- The processing timeout for the video after download is 45 seconds
Authentication
Stream Cloud is only available to registered users. All API calls must contain the Authorization HTTP header
For the commands below, make sure to replace YOUR_API_TOKEN
with your API Token. For example, Authorization: Token 3a0effff73919f898b69ac65a32dc12347769564
.
HTTP Request
POST https://api.platerecognizer.com/v1/stream/video-upload/
The CORS
policy of this endpoint allows requests from all origins.
POST Parameters
Parameter | Required | Description |
---|---|---|
upload_url | No | The url of file to be uploaded. This parameter is to be used as an alternative to upload parameter. |
regions | No | Match the license plate pattern of specific state(s) or country(ies). Best practice is to indicate the top 3-4 states/countries of vehicle plates that camera will be observing. This optimizes the engine to correctly decode zero vs letter O, one vs letter I, etc. Note that even if a foreign vehicle arrives, engine will still decode that foreign vehicle correctly. Accepts multiple arguments or comma-separated values. See list of states and countries. |
camera_id | No | Unique camera identifier. |
mmc | No | Predict vehicle make, model, orientation and color. This feature is available for an additional fee. Set parameter to true (mmc=true) if you have this feature enabled/purchased to get vehicle make, model and color. Possible values are true or false. |
Free test video url: https://app.platerecognizer.com/static/demo.mp4
Api call samples process test video url:
curl -X POST -F upload_url="https://app.platerecognizer.com/static/demo.mp4" \
-H "Authorization: Token YOUR_API_TOKEN" \
https://api.platerecognizer.com/v1/stream/video-upload/
curl -X POST -F upload_url="https://app.platerecognizer.com/static/demo.mp4" \
-F camera_id=camera123 \
-H "Authorization: Token YOUR_API_TOKEN" \
https://api.platerecognizer.com/v1/stream/video-upload/
HTTP Response
The response is immediate and contains configuration parameters used to initiate the processing.
The video will be downloaded from the URL, processed then results will be sent out as Stream webhooks to specified targets.
HTTP 201 Created
Allow: POST, OPTIONS
Content-Type: application/json
Vary: Accept
{
"regions": [],
"upload_url": "https://app.platerecognizer.com/static/demo.mp4",
"mmc": "yes",
"camera_id": "camera123"
}
Response camera_id
and mmc
will come from license configuration if unspecified.
Errors
Error Code | Meaning |
---|---|
403 | Forbidden: API Token is wrong. |
400 | You don't have Video upload enabled or configured correctly. |
429 | Indicates the user has sent too many requests in a given amount of time. |