
Dutch vehicle workflows often need to show when a vehicle’s APK inspection expires, but the input available to a server is usually a kenteken rather than a VIN. This guide shows how to send that plate to Vehicle API, read apk_expires from the RDW response, and handle missing data and lookup errors in Python and PHP.
Look up a Dutch plate
Send a JSON POST request to https://vehicles-api.com/api/v1/plate/nl, using plate as the request field. Authenticate with the X-API-Key header and set Content-Type to application/json.
The endpoint accepts a kenteken with or without dashes: K875HJ and K-875-HJ both work. Keep the call on your server; a key shipped in browser JavaScript can be extracted and used by someone else.
curl -X POST "https://vehicles-api.com/api/v1/plate/nl" -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"plate":"K875HJ"}'
Replace YOUR_API_KEY with your key when running the request. The plate and response values below are the documentation example; use the plate supplied to your application for a real lookup.
Read the response
A successful response uses an envelope with status, source, and data. The official example is:
{
"status": "success",
"source": "plate_nl",
"data": {
"plate": "K875HJ",
"vin": null,
"year": 2021,
"make": "TOYOTA",
"model": "AYGO",
"body": "hatchback",
"color": "GRIJS",
"doors": 4,
"seats": 4,
"vehicle_type": "Personenauto",
"engine": {
"cylinders": 3,
"displacement_cc": 998,
"fuel": "Benzine"
},
"mass_kg": 815,
"apk_expires": "2027-01-04",
"first_registration": "2021-01-04",
"open_recall": false
}
}
For an inspection workflow, the fields to read first are:
statusidentifies a successful response;sourceisplate_nlin this example.data.plateidentifies the returned kenteken. Keep it with the result so the displayed date remains associated with the lookup.data.apk_expiresis the APK expiry date. The example uses a date inYYYY-MM-DDform, not a timestamp with a time or timezone.data.first_registrationis the first registration date, not the APK expiry date. Do not substitute it whenapk_expiresis unavailable.data.vinis alwaysnullfor Dutch plates: RDW does not publish the VIN in this data.
The remaining fields can provide context beside the expiry date. For example, year, make, and model help a user identify the returned vehicle; mass_kg is in kilograms and engine.displacement_cc is in cubic centimetres. Values such as GRIJS, Personenauto, and Benzine appear as returned; an application that translates them should keep the original values available.
The example also contains an open_recall flag. It is not a list of campaigns or a substitute for a vehicle history report. Treat any nullable field as potentially unavailable rather than converting null into a date, an empty VIN, or a negative finding.
Integrate on the server
The following samples call the same endpoint as the curl request. They check the response envelope before using data and surface error.code and error.message when an API error is returned. In production, load the key from your server’s secret configuration rather than committing it to source control.
Python with requests
Use json= for this POST body; it serializes the plate as JSON. A requests GET call would use params= for query parameters, but this lookup is a POST and does not need query parameters.
import requests
url = "https://vehicles-api.com/api/v1/plate/nl"
headers = {"X-API-Key": "YOUR_API_KEY"}
try:
response = requests.post(
url,
headers=headers,
json={"plate": "K875HJ"},
timeout=7,
)
except requests.RequestException as exc:
raise RuntimeError("Plate lookup request failed") from exc
try:
result = response.json()
except ValueError as exc:
raise RuntimeError(
f"Plate lookup returned non-JSON HTTP {response.status_code}"
) from exc
if result.get("status") == "error":
error = result.get("error") or {}
raise RuntimeError(
f"Plate lookup failed: {error.get('code')} - "
f"{error.get('message')}"
)
if not response.ok or result.get("status") != "success":
raise RuntimeError(
f"Unexpected plate lookup response: HTTP {response.status_code}"
)
data = result.get("data") or {}
print("Plate:", data.get("plate"))
print("APK expires:", data.get("apk_expires"))
print("VIN:", data.get("vin"))
The timeout limits how long the application waits for the request. The code handles a transport failure separately from a response containing an API error, and it does not try to read a success payload after status is error.
PHP with cURL
The PHP version sends the same JSON body and headers. It checks for a cURL failure, invalid JSON, an API error envelope, and an unexpected HTTP or envelope status before reading the expiry date.
<?php
$url = "https://vehicles-api.com/api/v1/plate/nl";
$body = json_encode(["plate" => "K875HJ"], JSON_THROW_ON_ERROR);
$curl = curl_init($url);
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-API-Key: YOUR_API_KEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 7,
]);
$response = curl_exec($curl);
$httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$curlError = curl_error($curl);
curl_close($curl);
if ($response === false) {
throw new RuntimeException("Plate lookup request failed: " . $curlError);
}
try {
$result = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $exception) {
throw new RuntimeException(
"Plate lookup returned non-JSON HTTP " . $httpStatus,
0,
$exception
);
}
if (!is_array($result)) {
throw new RuntimeException("Unexpected plate lookup response");
}
if (($result["status"] ?? null) === "error") {
$error = $result["error"] ?? [];
throw new RuntimeException(
"Plate lookup failed: " . ($error["code"] ?? "") .
" - " . ($error["message"] ?? "")
);
}
if ($httpStatus < 200 || $httpStatus >= 300 ||
($result["status"] ?? null) !== "success") {
throw new RuntimeException(
"Unexpected plate lookup response: HTTP " . $httpStatus
);
}
$data = $result["data"] ?? [];
echo "Plate: " . ($data["plate"] ?? "unavailable") . PHP_EOL;
echo "APK expires: " . ($data["apk_expires"] ?? "unavailable") . PHP_EOL;
echo "VIN: " . ($data["vin"] ?? "unavailable") . PHP_EOL;
For a user-facing application, handle these exceptions at your server boundary. Return an appropriate message to the caller without exposing the API key or logging it alongside request details.
Operate the lookup safely
An unknown plate returns HTTP 404 with error.code set to not_found. Treat that as a lookup result to present or investigate, not as an expiry date. For other failures, inspect error.code and error.message; avoid assuming an undocumented code or retry behavior.
Rate limits and monthly quota both matter when a fleet or marketplace refreshes many records. Check the current limits for your plan in the Documentation, and account for scheduled refreshes as well as interactive searches. Handle limit-related errors without immediately retrying in a tight loop.
Cache results where that fits your workflow, but distinguish stable vehicle attributes from an inspection expiry that can change after a new inspection is recorded. Store when your application fetched the record and choose a refresh policy appropriate to the decision being made; a cached date is not proof that the current RDW record is unchanged. If you separately use VIN decoding, caching decoded VIN attributes can also reduce repeated lookups, but it cannot supply the VIN missing from this Dutch plate response.
VIN decoding works worldwide and is fullest for US-market vehicles. Vehicle API’s NHTSA recall campaigns, owner complaints, and NCAP crash ratings are US-market only and matched by make, model, and year. Do not treat those datasets as a VIN-specific history, or assume they describe a Dutch-market vehicle returned by this lookup.
This endpoint provides RDW open data, not title, accident, or ownership history. Developers building an agent can also connect through the Vehicle API MCP server; the same coverage and data limitations still matter when presenting a result.
FAQ
Does the plate need dashes?
No. The endpoint accepts both K875HJ and K-875-HJ. Keep the returned plate with the result, and avoid treating formatting differences alone as separate vehicles in your application.
Can I get a VIN from the Dutch plate response?
No. vin is always null because RDW does not publish it. A workflow that needs a VIN must obtain it separately rather than deriving it from this response.
What should I display if the APK date is null?
Display the expiry as unavailable and preserve the distinction between an unavailable value and an expired inspection. Do not use first_registration as a replacement.
What happens when a plate is not found?
The API returns HTTP 404 and error.code not_found. Let the user check the entered kenteken; do not interpret the error as a vehicle record with no expiry date.
Register to start a 7-day free trial and test the lookup on your server. Starter is $19 per month, and every plan includes the trial.