Skip to content

About

Python client for UK vehicle data: DVLA record and MOT history in one call, with mileage checks and ULEZ estimate.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

UK vehicle data API for Python

PyPI CI Licence: MIT

Look up any UK registration and get the DVLA record and full DVSA MOT history in one call, with mileage checks, an estimated ULEZ status and MOT and tax countdowns.

from uk_vehicle_data import VehicleData

api = VehicleData()  # reads VARDIC_API_KEY
v = api.lookup("AB12 CDE")["data"]

print(v["make"], v["model"], v["colour"], v["fuelType"])
print("MOT expires", v["mot"]["expiryDate"], f'({v["mot"]["daysUntilExpiry"]} days)')
print("Tax", v["tax"]["status"], v["tax"]["dueDate"])
print("ULEZ (estimate)", (v["cleanAirZone"] or {}).get("result"))
for a in v["mileage"]["anomalies"]:
    print(a["type"], a["detail"])

Install

pip install vardic-uk-vehicle-data

Python 3.9+, standard library only.

What you get

  • Vehicle record from the DVLA: make, colour, fuel, engine size, CO2, Euro status, first registration, tax status and due date.
  • MOT history from the DVSA: every test with result, mileage, expiry and defects.
  • Mileage checks: readings over time, average miles a year and anomalies such as a reading that went down.
  • Clean air zone estimate: likely_compliant, likely_non_compliant, uncertain or unknown, with the basis for it.
  • Bulk lookups (bulk): up to 25 registrations in one call.
  • Expiry webhooks (watch): signed events before MOT or tax runs out, and when a new MOT test is recorded.

Sandbox key

Every account gets a vd_test_ key as well as a live key. It returns made-up data for any registration and is never counted. ZZ99ZZZ returns vehicle_not_found and TL12OLD returns an old diesel whose mileage went down.

Webhooks

api.watch("AB12CDE", "https://example.com/hooks/vardic", days_before=[30, 7, 1])

from uk_vehicle_data import verify_webhook
ok = verify_webhook(request.body, request.headers["vardic-signature"], WEBHOOK_SECRET)

Watches need a live key. Pass the raw request body as bytes. Event types and payloads: https://vardic.dev/docs/webhooks

Errors

Failed calls raise VardicApiError with .status and .code, for example vehicle_not_found (404), quota_exceeded (429) or upstream_unavailable (503). Calls that fail with 503 are not counted.

Pricing

Free plan: 100 lookups a month, no card needed. Paid plans start at £59 a month for 2,000 lookups. See https://vardic.dev/pricing

Links

Data

Contains public sector information licensed under the Open Government Licence v3.0. Not affiliated with or endorsed by the DVLA or DVSA. Clean air zone results are estimates: check the official TfL or GOV.UK vehicle checker before relying on one.

Licence

MIT. Made by Vardic.

About

Python client for UK vehicle data: DVLA record and MOT history in one call, with mileage checks and ULEZ estimate.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages