Mileage History

Track vehicle odometer readings and mileage history over time

GET Request
~200ms response
1 credit per request

Endpoint

GET https://api.carapi.dev/v1/mileage-history/{vin}

Parameters

ParameterTypeRequiredDescription
vinstringRequired17-character Vehicle Identification Number (URL path parameter)
tokenstringRequiredAPI authentication token (query parameter)

Request Examples

cURL

curl -X GET \
  "https://api.carapi.dev/v1/mileage-history/1HGBH41JXMN109186?token=YOUR_API_KEY"

JavaScript

// Using fetch API
const response = await fetch('https://api.carapi.dev/v1/mileage-history/1HGBH41JXMN109186?token=YOUR_API_KEY', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log(data);

Python

import requests

url = "https://api.carapi.dev/v1/mileage-history/1HGBH41JXMN109186"
params = {
    "token": "YOUR_API_KEY"
}

response = requests.get(url, params=params)
data = response.json()
print(data)

Response Examples

Success Response (200)

{
  "vin": "JHMZE2870AS223772",
  "totalRecords": 3,
  "mileageHistory": [
    {
      "mileage": 179650,
      "createdAt": "2025-09-09T13:59:09.872Z"
    },
    {
      "mileage": 179645,
      "createdAt": "2025-09-05T00:00:00.000Z"
    },
    {
      "mileage": 179647,
      "createdAt": "2025-09-05T00:00:00.000Z"
    }
  ]
}

Error Response (404)

{
  "error": "No mileage history found for this VIN"
}

Response Fields

FieldTypeDescription
vinstringThe VIN number that was searched
totalRecordsnumberTotal number of mileage records found
mileageHistoryarrayArray of mileage history records
mileageHistory[].mileagenumberOdometer reading in miles or kilometers
mileageHistory[].createdAtstringTimestamp when the mileage record was created (ISO format)

Error Codes

400

Bad Request

Invalid VIN format or missing required parameters

403

Forbidden

Invalid or missing API token

404

Not Found

No mileage history found for this VIN

500

Internal Server Error

Server encountered an error processing the request

503

Service Unavailable

External data provider temporarily unavailable

Important Notes

  • VIN must be exactly 17 characters long and contain only alphanumeric characters
  • Mileage records are sorted by date with the most recent entries first
  • Each successful request consumes 1 API credit from your monthly allowance
  • Historical data availability varies by vehicle and reporting sources
  • Useful for maintenance tracking, fraud detection, and vehicle history verification