Code Samples

To facilitate smooth integration, Rekor CarCheck® offers a range of code samples in different programming languages. These samples serve as practical guides, demonstrating how to interact with the API effectively. Whether you are working with Bash, Python, C#, Java, or JavaScript, you will find detailed examples below to help you understand the implementation process.

Bash

curl -X POST -F image=@/car1.jpg 'https://api.openalpr.com/v3/recognize?recognize_vehicle=1&country=us&secret_key=sk_DEMODEMODEMODEMODEMODEMO'

Python

#!/usr/bin/python

import requests
import base64
import json

# Sample image file is available at http://plates.openalpr.com/ea7the.jpg
IMAGE_PATH = '/tmp/sample.jpg'
SECRET_KEY = 'sk_DEMODEMODEMODEMODEMODEMO'

with open(IMAGE_PATH, 'rb') as image_file:
    img_base64 = base64.b64encode(image_file.read())

url = 'https://api.openalpr.com/v3/recognize_bytes?recognize_vehicle=1&country=us&secret_key=%s' % (SECRET_KEY)
r = requests.post(url, data = img_base64)

print(json.dumps(r.json(), indent=2))

C#

Java

JavaScript

Results

Upon successful use of the API, the JSON response will provide detailed information in a structured format. The response includes key data points such as license plate number, vehicle make and model, color, and additional relevant information, ensuring a comprehensive overview of the recognized vehicle.

Last updated

Was this helpful?