Integration Guide

Connecting Your Camera to the API

Your IP camera captures the images — the API reads the plates. This guide covers the most common ways to connect existing camera infrastructure for real-time license plate recognition, from zero-code camera triggers to full RTSP pipelines.

How It Works

The recognition service is a cloud REST API: you send an image to POST /v1/detect, it returns the plate data as JSON in under 200ms. The only architectural question is how frames get from your camera to the API.

There are four practical approaches, depending on your cameras and how much control you want. Most deployments start with Method 1 or 2 and never need anything more.

IP Camera

RTSP / HTTP / FTP

image

Recognition API

POST /v1/detect

JSON

Your System

PMS, app, dashboard

Snapshot-on-Trigger vs. Continuous Capture

Before picking a method, decide when frames should be sent. This choice drives both accuracy and cost.

Snapshot on trigger

The camera (or a sensor, loop, or VMS rule) fires one snapshot when a vehicle is detected, and only that frame goes to the API.

  • One API call per vehicle — the cheapest and cleanest option
  • Ideal for gates, barriers, and drive-up lanes with a natural stop point
  • Works with the camera's built-in motion or vehicle detection

Continuous / interval capture

A script samples the RTSP stream at a fixed rate (typically 1 – 2 frames per second) and sends each frame — optionally gated by motion detection.

  • Catches vehicles that never stop — free-flow lanes and drive-bys
  • Higher API volume; add motion filtering to keep costs proportional to traffic
  • 1 – 2 FPS is enough for parking scenarios; more only for fast lanes

Four Ways to Send Frames

Method 1 · Recommended — zero server needed

Camera HTTP Event

Best for: Axis, Hikvision, Dahua, Milesight, and other cameras with HTTP event actions.

Many modern IP cameras can send an HTTP POST with a snapshot when they detect motion or a vehicle. Point that action directly at the API and you have plate recognition with no server, no middleware, and no code.

  1. 01 Open your camera's web interface.
  2. 02 Go to Events → Motion Detection or Vehicle Detection (naming varies by manufacturer).
  3. 03 Set the action to HTTP Notification or Upload to HTTP Server.
  4. 04 Configure the POST target as shown below, attaching the snapshot as multipart form-data in a field named "image".
  5. 05 Save, drive a car through, and check the response log.

URL: https://api.example.com/v1/detect

Method: POST

Header: Authorization: Bearer YOUR_API_KEY

Body: multipart form-data, image file in field "image"

  • Axis: Events → Recipients → add an HTTP recipient with the URL and Authorization header, then a rule that sends a snapshot on motion.
  • Hikvision / Dahua: Event → Smart Event → Line Crossing or Intrusion Detection → set the upload method to HTTP with the endpoint below.
  • Milesight: Event → HTTP Notification → configure the POST URL and token.

Pros: No server or middleware — the camera talks directly to the cloud.

Cons: Requires a camera with HTTP POST events and internet access from the camera network.

Method 2

RTSP Stream + a Small Script

Best for: Any camera with an RTSP stream — which is nearly every IP camera made in the last decade.

Run a lightweight script on any machine on the camera network — a Raspberry Pi, a spare PC, or an existing server. It grabs frames from the RTSP stream and posts them to the API. You get full control over capture frequency, motion gating, and what happens with each result.

Python + OpenCV example

import cv2
import requests
import time
import io

API_URL = "https://api.example.com/v1/detect"
API_KEY = "YOUR_API_KEY"
CAMERA_RTSP = "rtsp://admin:[email protected]:554/stream"

cap = cv2.VideoCapture(CAMERA_RTSP)

while True:
    ret, frame = cap.read()
    if not ret:
        continue

    # Encode frame as JPEG
    _, buffer = cv2.imencode('.jpg', frame)
    image_bytes = io.BytesIO(buffer.tobytes())

    # Send to the recognition API
    response = requests.post(
        API_URL,
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"image": ("frame.jpg", image_bytes, "image/jpeg")},
    )

    result = response.json()
    for plate in result.get("plates", []):
        print(f"Plate: {plate['text']} "
              f"({plate['confidence'] * 100:.1f}% confidence)")

    time.sleep(1)  # 1 frame per second is enough for parking

cap.release()
  • Don't send every frame — 1 – 2 frames per second is enough for parking scenarios.
  • Add motion detection (OpenCV BackgroundSubtractorMOG2) to send frames only when a vehicle is present. This keeps API usage proportional to traffic.
  • Set plate_only=true if you don't need car brand/model/color — it's roughly 2.5x faster.

Pros: Works with any RTSP camera. Full control over logic and rate.

Cons: Requires a machine running 24/7 and a script you own.

Method 3

FTP Snapshot Folder

Best for: Cameras that save snapshots to FTP on motion or event triggers.

Many cameras can drop a JPEG onto an FTP server when they detect motion. A small folder-watcher script picks up each new file, posts it to the API, and moves it to a processed directory. Simple, robust, and easy to debug — every frame is a file you can inspect.

import os
import time
import requests

WATCH_DIR = "/path/to/ftp/snapshots"
PROCESSED_DIR = "/path/to/processed"
API_URL = "https://api.example.com/v1/detect"
API_KEY = "YOUR_API_KEY"

while True:
    for filename in os.listdir(WATCH_DIR):
        if filename.lower().endswith(('.jpg', '.jpeg', '.png')):
            filepath = os.path.join(WATCH_DIR, filename)

            with open(filepath, 'rb') as f:
                response = requests.post(
                    API_URL,
                    headers={"Authorization": f"Bearer {API_KEY}"},
                    files={"image": f},
                )

            print(f"{filename}: {response.json()}")

            # Move to processed folder
            os.rename(filepath, os.path.join(PROCESSED_DIR, filename))

    time.sleep(2)

Pros: Simple and reliable; works with cameras that support FTP but not HTTP events.

Cons: Slightly higher latency than a direct HTTP event; needs an FTP server.

Method 4

VMS / NVR Integration

Best for: Sites already running a video management system — Milestone, Genetec, Blue Iris, and similar.

Use the VMS event engine you already have: export a snapshot on vehicle or motion detection, POST it to the API from the VMS webhook or scripting feature, and route the JSON response into your application. Most VMS platforms support HTTP actions on events out of the box.

  1. 01 Configure the VMS to export a snapshot on vehicle/motion detection.
  2. 02 Use the VMS webhook or scripting action to POST the image to the API.
  3. 03 Consume the JSON response in the VMS or forward it to your application.

Pros: Reuses your existing detection rules, recording, and monitoring.

Cons: Setup details vary by VMS; consult its documentation for HTTP actions.

Receiving Results via Webhooks

Instead of reading the API response synchronously, you can register a webhook endpoint and have recognition results pushed to your server as they are produced.

This suits asynchronous pipelines — results delivered straight into your parking management system, access-control software, or database, with your capture side kept completely dumb.

For payload details and configuration, see the API documentation.

Camera Placement Tips

Recognition accuracy is decided at the camera, not in the cloud. These six rules cover almost every failed read we see:

Resolution

Minimum 1080p. The plate should be at least 100 pixels wide in the frame — zoom in with the lens, not in software.

Angle

Mount at a 15 – 30° downward angle and within about 30° horizontally of the plate. Extreme side angles compress characters and cut accuracy sharply.

Height and distance

For gates and barriers, 4 – 8 feet high and 10 – 15 feet from where vehicles stop works best. Closer than 6 feet risks the plate leaving the frame.

IR at night

Use cameras with built-in IR illumination for 24/7 operation. Plates are retroreflective — a modest IR source at the right angle outperforms any megapixel upgrade after dark.

Shutter speed

Motion blur is the top cause of failed reads on moving vehicles. Set a fixed shutter of 1/500s or faster for rolling traffic (1/1000s for faster lanes) rather than leaving auto-exposure to choose.

Image format

Send JPEG at 80%+ quality (PNG and WebP also accepted, max 10MB, min 640x480). Avoid heavy compression — artifacts around characters read as strokes.

Point a camera at it and see

Get an API key, send a snapshot from your own camera, and read the JSON — 150 free calls per month, no credit card required.