Getting Started

Everything you need to integrate NPR API into your application.

NPR API provides a simple REST API for number plate recognition. Upload an image containing a vehicle and receive the detected plate registration along with a confidence score. Results can optionally be enriched with DVSA vehicle data and AI scene intelligence.

Quick Start

  1. Create an account and navigate to Settings → API Keys
  2. Generate a new API key
  3. Make your first recognition request using the key
Example Request
curl -X POST https://nprapi.com/api/v1/recognise \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "image=@plate.jpg"
Example Response
{
  "success": true,
  "registration": "AB12 CDE",
  "confidence": 95,
  "credits_used": 1,
  "processing_time_ms": 1420
}

Authentication

All API requests require authentication via an API key. Include your key in the X-API-Key header on every request.

Authentication Header
X-API-Key: your-api-key-here

Requests without a key, or with a key that has been deactivated, receive a 401 response:

401 Unauthorised
{
  "success": false,
  "error": "Invalid or inactive API key"
}

Managing API Keys

You can create and revoke API keys from your dashboard under Settings → API Keys. Each key can be given a descriptive name to help you identify its purpose.

Keep your API keys secure. Never expose them in client-side code or public repositories.

Making Requests

The API accepts multipart/form-data requests. Images can be sent either as file uploads or as base64-encoded form fields.

Base URL

https://nprapi.com/api/v1

Request Headers

Header Value Required
X-API-Key {api_key} Yes
Content-Type multipart/form-data Set automatically by most HTTP clients

Image Requirements

  • Supported formats: JPEG, PNG, WebP, HEIC, AVIF
  • For best results, ensure the plate is clearly visible and in focus

Recognition API

The recognition endpoint processes a single image synchronously and returns the detected number plate with a confidence score. Optionally, each result can be enriched with DVSA vehicle data (make, model, colour, fuel type, engine size) and scene intelligence (an AI analysis of the image itself).

POST /api/v1/recognise

Submit an image for number plate recognition. Provide either image or image_base64.

Request Parameters

Parameter Type Description
image file The image file to process
image_base64 string Base64-encoded image data, as an alternative to image
multiple boolean Optional. Detect all visible plates instead of only the most prominent one. Defaults to false
vehicle boolean Optional. Include DVSA vehicle data (make, model, colour, fuel type, engine size) for each detected plate. Costs 1 extra credit. Defaults to false
scene boolean Optional. Include AI scene intelligence (vehicle type, environment, time of day, weather and a short description). Costs 1 extra credit. Defaults to false

Response

200 OK
{
  "success": true,
  "registration": "AB12 CDE",
  "confidence": 95,
  "credits_used": 1,
  "processing_time_ms": 1420
}

When multiple is enabled, the response contains a plates array instead:

200 OK (multiple=true)
{
  "success": true,
  "plates": [
    {
      "registration": "AB12 CDE",
      "confidence": 95,
      "country": "GB"
    },
    {
      "registration": "XY21 ZZZ",
      "confidence": 88,
      "country": "GB"
    }
  ],
  "processing_time_ms": 1650
}

Vehicle Data & Scene Intelligence

Enable vehicle and/or scene to enrich the result. Each adds 1 credit to the request — see Credits & Usage. The flags can be sent as form fields or query string parameters:

Example Request
curl -X POST https://nprapi.com/api/v1/recognise \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "image=@plate.jpg" \
  -F "vehicle=true" \
  -F "scene=true"

The response then includes the requested data. Vehicle data is null where DVSA holds no record for the registration:

200 OK (vehicle=true&scene=true)
{
  "success": true,
  "registration": "AB12 CDE",
  "confidence": 95,
  "vehicle": {
    "make": "FORD",
    "model": "FOCUS",
    "colour": "BLUE",
    "fuel_type": "PETROL",
    "engine_size": "999cc"
  },
  "scene": {
    "vehicle_type": "car",
    "make": "Ford",
    "model": "Focus",
    "colour": "blue",
    "environment": "street",
    "time_of_day": "day",
    "weather": "clear",
    "vehicles_visible": 1,
    "description": "A blue hatchback parked on a residential street."
  },
  "credits_used": 3,
  "processing_time_ms": 1685
}

In multiple mode the vehicle object appears on each entry in the plates array instead. The scene object always describes the image as a whole, so it appears once at the top level. The scene fields are:

Field Description
vehicle_type car, van, truck, bus, motorcycle or other
make / model / colour Visually identified details of the primary vehicle, or null where not identifiable. Independent of the DVSA vehicle data
environment street, car_park, motorway, driveway, forecourt or other
time_of_day day, night or dawn_dusk
weather clear, rain, snow, fog, overcast or unknown
vehicles_visible Number of vehicles visible in the image
description A short sentence describing the scene
If no plate is detected, a requested scene object is still returned on the 422 response — the image is fully analysed either way.

Response Fields

Field Type Description
registration string The detected plate registration
confidence integer Confidence score from 0 to 100
country string ISO 3166-1 alpha-2 country code where identifiable (multiple mode only)
vehicle object DVSA vehicle data for the plate, or null if no record exists (only when vehicle is enabled; per plate in multiple mode)
scene object Scene intelligence for the image (only when scene is enabled)
credits_used integer Credits consumed by this request — see Credits & Usage
processing_time_ms integer Server-side processing time in milliseconds

If recognition fails, the API responds with a 422 status and an error message:

422 Unprocessable Entity
{
  "success": false,
  "error": "No plate detected",
  "processing_time_ms": 980
}

Batch Processing

For processing multiple images at once, use the batch endpoint. Batches are processed asynchronously — submit your images, then poll the status endpoint for results.

POST /api/v1/batch

Submit multiple images in a single request. Provide files via images[], base64 strings via images_base64[], or a combination of both. The multiple parameter works the same as on the recognise endpoint. The vehicle and scene parameters are not currently supported on batches.

Example Request
curl -X POST https://nprapi.com/api/v1/batch \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "images[]=@plate1.jpg" \
  -F "images[]=@plate2.jpg" \
  -F "images[]=@plate3.jpg"
201 Created
{
  "success": true,
  "batch_uuid": "9c2f1a4e-6b3d-4f8a-9e01-2d7c5b8a4f10",
  "total_requests": 3
}

GET /api/v1/batch/{uuid}

Retrieve the status and results of a batch. Poll this endpoint until status is completed or failed.

Example Request
curl https://nprapi.com/api/v1/batch/9c2f1a4e-6b3d-4f8a-9e01-2d7c5b8a4f10 \
  -H "X-API-Key: YOUR_API_KEY"
200 OK
{
  "success": true,
  "batch_uuid": "9c2f1a4e-6b3d-4f8a-9e01-2d7c5b8a4f10",
  "status": "processing",
  "total_requests": 3,
  "completed_requests": 1,
  "progress_percent": 33,
  "requests": [
    {
      "uuid": "5e8b2c1d-9f4a-4b7e-8c30-6a1d9e2f5b48",
      "status": "completed",
      "registration": "AB12 CDE",
      "confidence": 95,
      "processing_time_ms": 1420,
      "success": true,
      "error": null,
      "plates": [
        {
          "registration": "AB12 CDE",
          "confidence": 95,
          "country": "GB"
        }
      ]
    }
  ]
}

Status Values

Level Values
Batch status pending, processing, completed, failed
Request status pending, processing, completed, no_result, failed
Batch status requests are only visible to the organisation that created the batch — other API keys receive a 404.

Credits & Usage

Usage is measured in credits. Every plan includes a monthly credit allowance, and each request consumes credits based on the features used:

Feature Credits
Plate recognition (including multiple) 1
Vehicle data (vehicle) +1
Scene intelligence (scene) +1

Every response includes a credits_used field, and your live usage is returned on every API response via headers:

Header Description
X-Credits-Used Credits used so far this calendar month
X-Credits-Remaining Credits remaining in your monthly allowance

When your allowance is exhausted the API responds with 429 and a usage summary. Paid plans can enable overage billing from the Plan page — requests then continue past the allowance and additional credits are billed on the 1st of the following month.

429 Too Many Requests
{
  "success": false,
  "error": "Monthly credit allowance exceeded...",
  "usage": {
    "included": 500,
    "used": 500,
    "remaining": 0
  }
}

Failed requests (server errors) are never billed. Requests where no plate is detected are billed as normal — the image is still fully processed.

Error Handling

The API uses standard HTTP status codes to indicate success or failure. All error responses include a JSON body with a human-readable message.

Error Response Format
{
  "success": false,
  "error": "No image provided"
}

Status Codes

Code Meaning
200 Success
201 Batch created
400 Bad request — no image provided or invalid base64 data
401 Unauthorised — missing, invalid, or inactive API key
404 Batch not found
402 Payment required — API access suspended due to an unpaid invoice
422 Recognition failed — see the error message for details
429 Monthly credit allowance exceeded — upgrade or enable overage billing
Questions about integrating? Contact us — we're happy to help.