Works out when a Spanish vehicle's next ITV is due from its number plate alone. No API key, no lookup service, no network call.
Works out when a vehicle's next roadworthiness inspection is due from its number plate alone.
Spanish plates have been issued in one strict national sequence since September 2000, so the plate encodes roughly when the car was registered. Feed that into the ITV schedule and you get the due date and the window you can present it in.
$ itv 9420MYF
9420MYF ES / ITV
Registered 4 Feb 2025 (series start published to the day)
Series span 3 Feb 2025 to 5 Feb 2025
Age 1y 6m
Next ITV 4 Feb 2029 (first)
Window from 5 Jan 2029 (30 days early, keeps the same expiry)
go install github.com/jgalea/itv-cli/cmd/itv@latest
itv <plate> Spanish plate, e.g. itv 9420MYF
itv -t furgoneta <plate> van and light-commercial schedule
itv -d 2023-04-12 from a known registration date, skipping the plate
itv update refresh the series table from the DGT daily feed
itv rules list the ITV schedules
itv dataset describe the embedded data
itv -json <plate> machine-readable output
Series run BBB, BBC, BBD … with vowels, Q and Ñ left out, the rightmost letter moving first, and 10,000 numbers per series. A plate's position in that sequence is exact arithmetic. Turning a position into a date needs a table of when each series started, and the tool interpolates within a series by the plate's number, since about 10,000 registrations take two or three working days.
The embedded table covers every series from BBB to the present. Around a quarter of them carry a published day; the rest are known only to the month, and their day is interpolated between the nearest exact anchors, then clamped inside the published month. Output labels which case applies.
The estimate is good to within a few days where an exact anchor exists and to within a few weeks otherwise. Three things it cannot know:
The date that legally counts is the fecha de primera matriculación on the permiso de circulación. Check that if you need the exact day.
A car first registered abroad and later re-plated in Spain keeps its original foreign registration date. The plate says nothing about this and the estimate will be wrong, usually too late.
A plate carries no vehicle category, so the schedule has to be chosen with -t. The default is a private car.
For your own vehicle the DGT's informe reducido is free and authoritative, and the informe de datos técnicos carries the actual ITV history. Both need Cl@ve or a certificado digital, so there is no anonymous route to them and no API this tool could use.
The daily registration microdata the DGT publishes opens with the letters of the last plate series assigned that day, which is the only authoritative public link between a series and a date. itv update reads that feed and writes what it learns to ~/.itv/series_overlay.json, which takes precedence over the embedded table.
The DGT only keeps roughly the current and previous month online, so the feed cannot reconstruct history. The embedded table was therefore built once by scraping the series pages at matriculasdelmundo.com, which is the source of the month-only entries. Rebuild it with cmd/buildseries.
The microdata carries no plate field at all: registration date, make, model, variant, engine, power, body, owner count and more, but never the plate itself. Since February 2025 the DGT also stopped publishing complete VINs there.
MIT.