Real-time access to the RTA vehicle registration database.
Access records via GET request:
| Requirement | Value |
|---|---|
| Endpoint | /api/vehicle-data |
| Params | vehicle_no or mobile_no |
| Auth Header | Authorization: Api-Key 12345678 |
Security Note: The Api-Key prefix is case-sensitive and mandatory in the Authorization header.
<?php
$url = "http://stsacloud.com:90/api/vehicle-data?vehicle_no=21124";
$apiKey = "12345678";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Api-Key $apiKey"
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
if ($data['status'] === 'success') {
print_r($data['data']);
} else {
echo "Error: " . $data['message'];
}
?>