The official JavaScript SDK for Vardic: UK vehicle data, company checks, sanctions screening, company monitoring, postcodes and fuel prices on one API key.
import { Vardic } from 'vardic';
const vardic = new Vardic(); // reads VARDIC_API_KEY
const car = await vardic.vehicle.get('AB12 CDE');
const co = await vardic.business.check('00445790'); // Tesco PLC
const hit = await vardic.sanctions.screen({ name: 'Example Trading Sanctioned LLC', type: 'entity' });
const area = await vardic.location.postcode('SW1A 1AA');
const fuel = await vardic.location.fuelNearest({ postcode: 'SW1A 1AA', fuel: 'E10', limit: 3 });
console.log(car.data.make, car.data.mot.status, co.data.company.name, co.data.risk);
console.log(hit.data.matchCount, area.data.areas.localAuthority.name, fuel.data.items[0].price);npm install vardicESM only, no dependencies. Needs a global fetch: Node 18+, Deno, Bun or an edge runtime. TypeScript types are included.
Get a free key at https://vardic.dev/signup. Set it as VARDIC_API_KEY, or pass it to the constructor.
One client, one namespace per product. Method names are camelCase here and snake_case in the Python SDK (fuelNearest and fuel_nearest).
| 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, screenBulk, screenCsv, listChecks, getCheck, deleteCheck, certificate, checkCsv, lists |
UK, US (OFAC) and EU sanctions lists, screening records and certificates |
vardic.monitoring |
list, create, createMany, delete, testEvent |
Signed webhooks and email digests for vehicles, companies and monitored names |
vardic.location |
postcode, fuelNearest, fuelStation, fuelHistory |
Postcode area codes, flood risk, crime and schools; UK fuel prices |
vardic |
account, status |
Plan and usage; public service status |
Every call resolves to the parsed { data, meta } response, except monitoring.delete (null), sanctions.certificate (bytes) and the CSV downloads (text).
const { data } = await vardic.vehicle.get('AB12 CDE'); // spaces and case are ignored
console.log(data.make, data.model, data.tax.status, data.mot.expiryDate);
console.log(data.mileage.anomalyFound, data.cleanAirZone?.result);
const { data: rows } = await vardic.vehicle.bulk(['AB12CDE', 'TL12OLD']); // up to 25const { data } = await vardic.business.check('00445790', { include: ['officers', 'psc'], eori: 'GB123456789000' });
for (const f of data.flags) console.log(f.severity, f.message);
await vardic.business.officers('00445790', { page: 1, size: 50 });
await vardic.business.filings('00445790', { category: 'accounts' });
await vardic.business.ownership('00445790', { depth: 2 });
await vardic.business.search('tesco');
await 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.
const { data } = await vardic.sanctions.screen({ name: 'Ivan Sandboxov', type: 'individual', dob: '1965', threshold: 85 });
for (const m of data.matches) console.log(m.score, m.list, m.matchedName);
await vardic.sanctions.screenBulk([{ name: 'A Name' }, { name: 'Another Name', country: 'RU' }]); // up to 25
const summary = await vardic.sanctions.screenCsv(csvText, { record: true });
const pdf = await vardic.sanctions.certificate(summary.data.checkId); // Uint8ArrayScreening 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.
await vardic.monitoring.create({ registration: 'AB12CDE', url: 'https://example.com/hooks/vardic', daysBefore: [30, 7, 1] });
await vardic.monitoring.create({ companyNumber: '00445790', url: 'https://example.com/hooks/vardic', emailDigest: true });
await vardic.monitoring.createMany({ companyNumbers: ['00445790', 'SC123456'], url: 'https://example.com/hooks/vardic' });
const { data: watches } = await vardic.monitoring.list();
await vardic.monitoring.delete(watches[0].id);
await vardic.monitoring.testEvent({ url: 'https://example.com/hooks/vardic', type: 'company.filing' });Watches need a live key. A sandbox key can still send a signed sample with testEvent. 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).
import { verifyWebhook } from 'vardic';
// rawBody must be the exact request body, not re-serialised JSON
const ok = await verifyWebhook(rawBody, req.headers['vardic-signature'], process.env.VARDIC_WEBHOOK_SECRET);
if (!ok) return res.writeHead(400).end();const { data } = await vardic.location.postcode('SW1A 1AA', { include: ['areas', 'flood'], schools: 3 });
const { data: cheapest } = await vardic.location.fuelNearest({ postcode: 'SW1A 1AA', fuel: 'E10', radius: 5 });
await vardic.location.fuelStation(cheapest.items[0].station.id);
await vardic.location.fuelHistory(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.
const { data } = await vardic.account(); // plans, usage this month, webhook secret
const { data: status } = await vardic.status(); // public service statusconst vardic = new Vardic({
apiKey: 'vd_live_...', // default: process.env.VARDIC_API_KEY
timeoutMs: 10000, // per attempt, default 15000
maxRetries: 2, // on 429 and 503, default 2
baseUrl: 'https://api.vardic.dev',
});Failed calls throw VardicApiError with status, code, message, requestId (from the x-request-id header; quote it if you contact support), body (the parsed error response) and retryAfter.
import { VardicApiError } from 'vardic';
try {
await vardic.vehicle.get('ZZ99ZZZ');
} catch (e) {
if (e instanceof VardicApiError) console.log(e.status, e.code, e.requestId); // 404 vehicle_not_found req_...
else throw e;
}Timeouts and network failures throw 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).
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.
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
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
- 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
- Python SDK: https://github.com/vardic-dev/vardic-python
- Examples: examples/
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Security: SECURITY.md
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.
MIT. Made by Vardic.