All the ways to connect a camera

Camera guide · Cloud API

Connect any IP camera to the ANPR cloud API

Four ways to get a picture from your camera to /v1/detect and the plate back as JSON — from a camera that posts it by itself to a short script, a folder or your VMS. For developers building their own integration; ANPR Edge does all of this without code.

How the custom API connection works

ANPR.software is currently a cloud-based REST API. You send us an image, we return the plate data as JSON. The key question is: how do you get images from your camera to our API?

There are several approaches depending on your camera setup and technical requirements.

IP Camera

RTSP/HTTP

Image(via method below)

api.anpr.software

/v1/detect

JSON(response or webhook)

Your System

(PMS, app, dashboard)

1

Method 1: Camera HTTP Event

Recommended - Zero Server Needed

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

Many modern IP cameras can send an HTTP POST with a snapshot when they detect motion or a vehicle. You can point this directly at our API.

How to set it up:

1

Open your camera's web interface.

2

Go to Events → Motion Detection or Vehicle Detection (varies by manufacturer).

3

Set the action to HTTP Notification or Upload to HTTP Server.

4

Configure the HTTP POST to:

URL: https://api.anpr.software/v1/detect

Method: POST

Header: Authorization: Bearer YOUR_API_KEY

Body: Attach snapshot as multipart form-data, field name image

5

Save and test.

Camera-specific notes:

Axis cameras: Use ACAP Events → Recipients → add an HTTP recipient with the URL and auth header. Then create a rule that sends a snapshot on motion.

Hikvision / Dahua: Use Event → Smart Event → Line Crossing or Intrusion Detection → set upload method to HTTP with the endpoint above.

Milesight: Use Event → HTTP Notification → configure the POST URL and token.

Pros: No server or middleware needed. Camera talks directly to our cloud.

Cons: Requires a camera that supports HTTP POST events. Needs internet access from the camera.

2

Method 2: Write a Simple Script on Your Server

Best for: Any camera with an RTSP stream. Full control over capture frequency and logic.

If your camera provides an RTSP video stream (most IP cameras do), you can run a lightweight script on a local server that grabs frames and sends them to our API.

Example: Python script using OpenCV

Python
import cv2
import requests
import time
import io

API_URL = "https://api.anpr.software/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 ANPR API
    response = requests.post(
        API_URL,
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"image": ("frame.jpg", image_bytes, "image/jpeg")}
    )

    result = response.json()
    if result.get("success") and result["data"].get("plate_text"):
        print(f"Plate detected: {result['data']['plate_text']} "
              f"({result['data']['confidence']*100:.1f}% confidence)")

    time.sleep(1)  # Adjust interval as needed (1 frame per second)

cap.release()

Tips:

  • Don't send every frame - 1-2 frames per second is usually enough for parking scenarios.
  • Add motion detection (OpenCV BackgroundSubtractorMOG2) to only send frames when a vehicle is present. This saves API calls.
  • Run this on a Raspberry Pi, any Linux server, or a Windows PC on the same network as the cameras.

Pros: Works with any camera that has RTSP. Full control over logic.

Cons: Requires a server running 24/7. You write and maintain the script.

3

Method 3: FTP Snapshot Folder

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

Many cameras can be configured to save JPEG snapshots to an FTP server when they detect motion. You can write a folder watcher that picks up new images and sends them to our API.

How to set it up:

1

Configure your camera to save snapshots to a local FTP directory on event trigger.

2

Run a folder watcher script:

Python
import os
import time
import requests

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

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}
                )

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

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

    time.sleep(2)

Pros: Simple and reliable. Works with cameras that don't support HTTP POST but do support FTP.

Cons: Slight delay compared to direct HTTP. Requires FTP server setup.

4

Method 4: VMS / NVR Integration

Best for: Locations already running a Video Management System (Milestone, Genetec, Blue Iris, etc.).

If you already have a VMS, you can use its event system to trigger API calls to ANPR.software:

1

Configure your VMS to export a snapshot on vehicle/motion detection.

2

Use the VMS webhook or scripting feature to POST the image to our API.

3

Process the JSON response in your VMS or forward it to your application.

Most VMS platforms support HTTP actions on events. Refer to your VMS documentation for setting up HTTP POST actions.

Receiving Results via Webhooks

Instead of reading the API response synchronously, you can configure a webhook so that ANPR.software pushes results to your server automatically.

This is ideal for asynchronous processing where you want results delivered to your parking management system, access control software, or database.

Setting up webhooks:

1

Provide your webhook endpoint URL in your ANPR.software dashboard or API request.

2

Our system will POST the recognition result as JSON to your endpoint whenever a plate is processed.

Example webhook payload your server will receive:

JSON
{
  "event": "plate_recognized",
  "timestamp": "2026-02-17T14:23:01Z",
  "data": {
    "plate_id": 0,
    "position": {
      "x1": 421, "y1": 694,
      "x2": 583, "y2": 736
    },
    "confidence": 0.876,
    "text": {
      "plate_number_en": "5309 ZSA",
      "plate_number_ar": "م ص أ ٥٣٩",
      "plate_code_en": "AA",
      "plate_code_ar": "أأ"
    },
    "attributes": {
      "country": "uae",
      "emirate": "abudhabi",
      "color": "red",
      "type": "private",
      "size": "long"
    }
  }
}

For full webhook configuration details, see our API documentation.

Recommended Camera Setup Tips

For best recognition accuracy with GCC plates:

Resolution

Minimum 1080p (1920x1080). The plate should be at least 100 pixels wide in the image.

Angle

Mount the camera at a slight downward angle (15-30). Avoid extreme side angles.

Distance

For parking barriers, 3-5 meters from the plate works best.

Lighting

Use cameras with IR illumination for night operation. LED-based illumination gives the best results for Arabic plates.

Image format

JPEG at 80%+ quality. PNG also supported but file sizes are larger.

Frame rate

1-2 FPS is sufficient for parking. For highway/toll use cases, contact us for guidance.

What's Coming Next

We're developing an installable on-premise agent that you can deploy directly on your servers or edge devices. This will:

  • Connect to your cameras via RTSP - no coding needed
  • Process plates locally for lower latency
  • Work without constant internet connectivity
  • Support multiple camera streams simultaneously
  • Push results via webhooks to your systems

If you'd like early access, contact us or reach out on WhatsApp.

Need Help?