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 structured data including the detected plate number, confidence score, and vehicle details.

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 "Authorization: Bearer YOUR_API_KEY" \
  -F "upload=@plate.jpg"

Authentication

All API requests require authentication via an API key. Include your key in the Authorization header as a Bearer token.

Authorization Header
Authorization: Bearer your-api-key-here

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 with an image file. Supported image formats are JPEG, PNG, and WebP.

Base URL

https://nprapi.com/api/v1

Request Headers

Header Value Required
Authorization Bearer {api_key} Yes
Content-Type multipart/form-data Yes

Image Requirements

  • Maximum file size: 10MB
  • Supported formats: JPEG, PNG, WebP
  • Minimum resolution: 320 × 240 pixels

Recognition API

The recognition endpoint processes an image and returns detected number plates along with confidence scores and bounding box coordinates.

POST /api/v1/recognise

Submit an image for number plate recognition.

Request Parameters

Parameter Type Description
upload file The image file to process

Response

200 OK
{
  "success": true,
  "results": [
    {
      "plate": "AB12 CDE",
      "confidence": 0.97,
      "region": "gb",
      "bounding_box": {
        "x": 120,
        "y": 340,
        "width": 200,
        "height": 60
      },
      "vehicle": {
        "make": "BMW",
        "colour": "Black",
        "year": 2021
      }
    }
  ]
}

Batch Processing

For processing multiple images at once, use the batch endpoint. Upload several images in a single request and receive results for all of them.

POST /api/v1/batch

Submit multiple images for recognition in a single request.

Example Request
curl -X POST https://nprapi.com/api/v1/batch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "images[]=@plate1.jpg" \
  -F "images[]=@plate2.jpg" \
  -F "images[]=@plate3.jpg"

Response

The batch response returns an array of results, one per image submitted. Each entry follows the same format as the single recognition response.

Batch requests support up to 20 images per request. For larger volumes, split across multiple requests.

Vehicles

When a plate is recognised, the API automatically looks up associated vehicle data where available. This includes the vehicle make, colour, year, and more.

Vehicle Object

Field Type Description
make string Vehicle manufacturer
colour string Vehicle colour
year integer Year of registration
fuel_type string Fuel type (petrol, diesel, electric, etc.)
Vehicle data availability varies by region. UK plates have the most comprehensive coverage.

Error Handling

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

Error Response Format
{
  "success": false,
  "error": {
    "code": "INVALID_IMAGE",
    "message": "The uploaded file is not a valid image."
  }
}

Status Codes

Code Meaning
200 Success
400 Bad request — invalid parameters or image
401 Unauthorised — missing or invalid API key
413 File too large — exceeds 10MB limit
422 No plates detected in the image
429 Rate limit exceeded
500 Internal server error

Error Codes

Error Code Description
INVALID_IMAGE The file is not a supported image format
IMAGE_TOO_LARGE The file exceeds the maximum size
NO_PLATES_FOUND No number plates were detected
RATE_LIMIT_EXCEEDED Too many requests in the current window
INVALID_API_KEY The API key is missing, expired, or revoked

Rate Limits

API requests are rate-limited based on your plan. Rate limit information is included in the response headers of every request.

Response Headers

Header Description
X-RateLimit-Limit Maximum requests per window
X-RateLimit-Remaining Requests remaining in current window
X-RateLimit-Reset Unix timestamp when the window resets

When you exceed the rate limit, the API responds with a 429 status code. Wait until the reset timestamp before retrying.

Need higher limits? Upgrade your plan or contact us for custom enterprise limits.
Loading…
Loading the web debug toolbar…
Attempt #