Vardic for Python
The official Python SDK for Vardic: UK vehicle data, company checks, sanctions screening, company monitoring, postcodes and fuel prices on one API key.
from vardic import Vardic
vardic = Vardic() # reads VARDIC_API_KEY
car = vardic.vehicle.get("AB12 CDE")
co = vardic.business.check("00445790") # Tesco PLC
hit = vardic.sanctions.screen({"name": "Example Trading Sanctioned LLC", "type": "entity"})
area = vardic.location.postcode("SW1A 1AA")
fuel = vardic.location.fuel_nearest(postcode="SW1A 1AA", fuel="E10", limit=3)
print(car["data"]["make"], car["data"]["mot"]["status"], co["data"]["company"]["name"], co["data"]["risk"])
print(hit["data"]["matchCount"], area["data"]["areas"]["localAuthority"]["name"], fuel["data"]["items"][0]["price"])
Install
pip install vardic
Python 3.9+, standard library only. Type hints are included (py.typed).
Get a free key at https://vardic.dev/signup. Set it as VARDIC_API_KEY, or pass it to the constructor.
What is covered
One client, one namespace per product. Method names are snake_case here and camelCase in the JavaScript SDK (fuel_nearest and fuelNearest).
| Namespace | Methods | API |
|---|---|---|
vardic.vehicle |
get, bulk |
DVLA vehicle record, DVSA MOT history, mileage checks, estimated clean air zone status |
vardic.business |
check, officers, psc, charges, filings, ownership, search, eori, vat |
Companies House, charity status, EORI, risk flags |
vardic.sanctions |
screen, screen_bulk, screen_csv, list_checks, get_check, delete_check, certificate, check_csv, lists |
UK, US (OFAC) and EU sanctions lists, screening records and certificates |
vardic.monitoring |
list, create, create_many, delete, test_event |
Signed webhooks and email digests for vehicles, companies and monitored names |
vardic.location |
postcode, fuel_nearest, fuel_station, fuel_history |
Postcode area codes, flood risk, crime and schools; UK fuel prices |
vardic |
account, status |
Plan and usage; public service status |
Every call returns the parsed {"data": ..., "meta": ...} response, except monitoring.delete (None), sanctions.certificate (bytes) and the CSV downloads (text).
Vehicles
car = vardic.vehicle.get("AB12 CDE")["data"] # spaces and case are ignored
print(car["make"], car["model"], car["tax"]["status"], car["mot"]["expiryDate"])
print(car["mileage"]["anomalyFound"], (car["cleanAirZone"] or {}).get("result"))
rows = vardic.vehicle.bulk(["AB12CDE", "TL12OLD"])["data"] # up to 25
Business checks
data = vardic.business.check("00445790", include=["officers", "psc"], eori="GB123456789000")["data"]
for f in data["flags"]:
print(f["severity"], f["message"])
vardic.business.officers("00445790", page=1, size=50)
vardic.business.filings("00445790", category="accounts")
vardic.business.ownership("00445790", depth=2)
vardic.business.search("tesco")
vardic.business.eori("GB123456789000")
UK VAT number checks are not open yet: until they are, vardic.business.vat() fails with a 503 upstream_unavailable that is not counted, and vat in a company check is null. EORI checks cover UK (GB) numbers only.
Sanctions screening
data = vardic.sanctions.screen({"name": "Ivan Sandboxov", "type": "individual", "dob": "1965", "threshold": 85})["data"]
for m in data["matches"]:
print(m["score"], m["list"], m["matchedName"])
vardic.sanctions.screen_bulk([{"name": "A Name"}, {"name": "Another Name", "country": "RU"}]) # up to 25
summary = vardic.sanctions.screen_csv(csv_text, record=True)
pdf = vardic.sanctions.certificate(summary["data"]["checkId"]) # bytes
Screening is a screening aid, not legal advice: review every potential match. Names are never logged; they are stored only when you ask for a screening record.
Monitoring and webhooks
vardic.monitoring.create(registration="AB12CDE", url="https://example.com/hooks/vardic", days_before=[30, 7, 1])
vardic.monitoring.create(company_number="00445790", url="https://example.com/hooks/vardic", email_digest=True)
vardic.monitoring.create_many(["00445790", "SC123456"], url="https://example.com/hooks/vardic")
watches = vardic.monitoring.list()["data"]
vardic.monitoring.delete(watches[0]["id"])
vardic.monitoring.test_event("https://example.com/hooks/vardic", type="company.filing")
Watches need a live key. A sandbox key can still send a signed sample with test_event. Event types and payloads: https://vardic.dev/docs/webhooks
Verify every delivery with the vardic-signature header and your webhook secret (from vardic.account()). Reject anything older than five minutes (the default tolerance).
from vardic import verify_webhook
# raw_body must be the exact bytes received, not re-serialised JSON
ok = verify_webhook(raw_body, request.headers["vardic-signature"], WEBHOOK_SECRET)
if not ok:
abort(400)
Postcodes and fuel
data = vardic.location.postcode("SW1A 1AA", include=["areas", "flood"], schools=3)["data"]
cheapest = vardic.location.fuel_nearest(postcode="SW1A 1AA", fuel="E10", radius=5)["data"]
vardic.location.fuel_station(cheapest["items"][0]["station"]["id"])
vardic.location.fuel_history(cheapest["items"][0]["station"]["id"], days=30)
Postcode checks cover Great Britain; a Northern Ireland, Channel Islands or Isle of Man postcode fails with unsupported_region.
Account and status
account = vardic.account()["data"] # plans, usage this month, webhook secret
status = vardic.status()["data"] # public service status
Options
vardic = Vardic(
api_key="vd_live_...", # default: the VARDIC_API_KEY environment variable
timeout=10.0, # seconds, per attempt, default 15
max_retries=2, # on 429 and 503, default 2
base_url="https://api.vardic.dev",
)
Errors
Failed calls raise VardicApiError with status, code, message, request_id (from the x-request-id header; quote it if you contact support), body (the parsed error response) and retry_after.
from vardic import VardicApiError
try:
vardic.vehicle.get("ZZ99ZZZ")
except VardicApiError as e:
print(e.status, e.code, e.request_id) # 404 vehicle_not_found req_...
Timeouts and network failures raise the same class with status 0 and code timeout or network_error. The full code list is at https://vardic.dev/docs/errors, for example invalid_registration (400), vehicle_not_found (404), quota_exceeded (429) and upstream_unavailable (503).
Retries
The SDK retries 429 and 503 responses up to twice, waiting for the Retry-After header (or 0.5 s then 1 s without one). It never retries quota_exceeded or coming_soon, which retrying cannot fix, and it gives up at once when Retry-After is longer than 30 seconds. 400, 401 and 404 are never retried. Failed calls that return 429 or 503 are not counted against your allowance.
Sandbox keys
Every account gets a vd_test_ key as well as a live key. It returns realistic made-up data for any input, never counts towards your allowance and allows 5 requests a second. Special values:
- Vehicle
ZZ99ZZZreturnsvehicle_not_found;TL12OLDreturns a 2012 diesel with a mileage reading that went down. - Company
00000000returnscompany_not_found. - Sanctions names
Example Trading Sanctioned LLC,Ivan SandboxovandSandbox Example Bankreturn fictional matches; any other name returns none. - Postcode
ZZ1 1ZZreturnspostcode_not_found.
All sandbox values: https://vardic.dev/docs/sandbox
Pricing
Every product has a free monthly allowance on one key, no card needed: 100 vehicle lookups, 50 business checks, 50 sanctions screens, 5 watched companies, 100 postcode checks and 1,000 fuel requests. Paid plans and prices: https://vardic.dev/pricing
Links
- Get a free key: https://vardic.dev/signup
- API docs: https://vardic.dev/docs
- OpenAPI files: https://vardic.dev/docs/openapi
- Service status: https://vardic.dev/status
- JavaScript SDK: https://github.com/vardic-dev/vardic-node
- Examples: examples/
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Security: SECURITY.md
Data
Contains public sector information licensed under the Open Government Licence v3.0, from the DVLA, DVSA, Companies House, the Charity Commission, the Environment Agency, the Office for National Statistics, police.uk and Fuel Finder. EORI data from HMRC. Sanctions lists are published by the UK, US (OFAC) and EU authorities; screening results are a screening aid, not legal advice. Each response carries its licence text in meta.attribution: show it wherever you display the data to others. Not affiliated with or endorsed by any of the government bodies whose data we use. Clean air zone results are estimates: check the official TfL or GOV.UK vehicle checker before relying on one.
Licence
MIT. Made by Vardic.
Metadata
Release files for vardic 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vardic-1.0.0.tar.gz | 24.1 kB | Without provenance | Details for vardic-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vardic-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for vardic-1.0.0-py3-none-any.whl |
Total release size: 36.1 kB
Release files / vardic-1.0.0.tar.gz
| Download URL | vardic-1.0.0.tar.gz |
|---|---|
| Size | 24.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7a6010e2cda15b97594df671618bb636b7a1aa15c9b294d719a2b81e99f79da
|
|
BLAKE2b-256 checksum How to use checksums |
ff7c67cab496a254684bb05945cc45b6cdf2866f8222c0eeab37bfeb890fbfa6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Release files / vardic-1.0.0-py3-none-any.whl
| Download URL | vardic-1.0.0-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f522bbb683782aca72f653c511c22b61d12b43d4511fb820a001a150f59da285
|
|
BLAKE2b-256 checksum How to use checksums |
11e7cf27efc88e1475907b825b8bb851bdea8eebdc1406e93ce66cf6a6f76ce2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Security for vardic 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.