---
title: "Migrate from CarAPI.dev"
description: "Move CarAPI.dev VIN lookups to CarsXE International VIN Decoding and update how you handle sparse registration and specification data."
canonical_url: "https://docs.carsxe.com/docs/guides/migrate/carapi-dev"
markdown_url: "https://docs.carsxe.com/docs/guides/migrate/carapi-dev.md"
last_updated: "1980-01-01"
x_farming_labs_generated_preamble: true
agent:
  task: "Move a non-US VIN lookup from CarAPI.dev to CarsXE International VIN Decoding."
  outcome: "The CarsXE request returns HTTP 200 and the client reads vehicle identity from attributes."
  appliesTo:
    version:
      - "CarAPI.dev VIN Decode v1 and CarsXE International VIN Decoding v1"
  prerequisites:
    - "A CarAPI.dev token, a CarsXE API key, and representative non-US VINs."
  verification:
    - "Run the public Ford sample and confirm attributes.make is \"Ford\" and attributes.model is \"Galaxy\"."
    - "Compare required fields on the same VINs from the markets your application serves."
  failureModes:
    - symptom: "CarAPI.dev returns HTTP 403 with invalid_token, or CarsXE returns HTTP 400 for a missing VIN."
      resolution: "Check that the CarAPI.dev request uses token and the CarsXE query sends both key and vin."
    - symptom: "The CarsXE rollout breaches the agreed no-data, latency, or field-completeness thresholds."
      resolution: "Route traffic back to the CarAPI.dev client with its original credentials."
---

# Migrate from CarAPI.dev
URL: /docs/guides/migrate/carapi-dev
LLM index: /llms.txt
Description: Move CarAPI.dev VIN lookups to CarsXE International VIN Decoding and update how you handle sparse registration and specification data.
Related: /docs/guides/migrate, /docs/products/international-vin-decoder, /docs/guides/errors

<!-- farming-labs:agent-contract:start -->
## Agent Contract

Task: Move a non-US VIN lookup from CarAPI.dev to CarsXE International VIN Decoding.
Outcome: The CarsXE request returns HTTP 200 and the client reads vehicle identity from attributes.

### Applies To

- Version: `CarAPI.dev VIN Decode v1 and CarsXE International VIN Decoding v1`

### Prerequisites

- A CarAPI.dev token, a CarsXE API key, and representative non-US VINs.

### Verification

- Run the public Ford sample and confirm attributes.make is "Ford" and attributes.model is "Galaxy".
- Compare required fields on the same VINs from the markets your application serves.

### Failure Modes

- CarAPI.dev returns HTTP 403 with invalid_token, or CarsXE returns HTTP 400 for a missing VIN. — Recovery: Check that the CarAPI.dev request uses token and the CarsXE query sends both key and vin.
- The CarsXE rollout breaches the agreed no-data, latency, or field-completeness thresholds. — Recovery: Route traffic back to the CarAPI.dev client with its original credentials.
<!-- farming-labs:agent-contract:end -->

Use this guide if your client calls `api.carapi.dev/v1/vin-decode` to identify a vehicle. Start with make, model, and fuel type. Test more detailed fields against the markets you serve.

## Prerequisites

- Keep a CarAPI.dev token with VIN Decode access to run the before request. Check your quota in the CarAPI.dev dashboard.
- [Get a CarsXE account and API key](/docs/get-started#api-keys). Confirm that your account can make International VIN Decoding requests and has sufficient credits or quota. Keep both keys on the server and redact query strings from logs.
- Pick VINs from the countries and vehicle classes your app serves. The example below covers an international decode. Evaluate [Specifications](/docs/products/specifications) for US-market vehicles.

## Choose the CarsXE endpoint

| Workflow | CarAPI.dev | CarsXE | Fit |
| --- | --- | --- | --- |
| Identify a non-US vehicle from its VIN | `GET https://api.carapi.dev/v1/vin-decode/{vin}` with a 17-character VIN in the path and `token` in the query | `GET https://api.carsxe.com/v1/international-vin-decoder` with `vin` and `key` in the query | **Partial match.** The core vehicle fields overlap. Response structure, coverage, and technical details differ. |
| Read registration date, actual color, or plate from the VIN decode | `specifications.registrationDate`, `specifications.color`, `plateNumber` | No direct field in the international VIN response | **Unsupported in this workflow.** Keep a registration source where these fields are required. |

CarAPI.dev documents US and European VIN coverage. International VIN Decoding returns the fields available for the specific VIN and market. Listing search, inspection reports, financing, and ownership-cost estimates are outside this VIN migration. [CarAPI.dev VIN Decode reference](https://docs.carapi.dev/endpoints/vin-decode) · [CarsXE International VIN Decoding](/docs/products/international-vin-decoder)

## Before and after

**CarAPI.dev.** Set `CARAPI_TOKEN` to your key. The response excerpt is based on CarAPI.dev's published example.

```bash
curl --get 'https://api.carapi.dev/v1/vin-decode/WBAKU210X00R62021' \
  --data-urlencode "token=${CARAPI_TOKEN}"
```

```json
{
  "vin": "WBAKU210X00R62021",
  "specifications": {
    "make": "BMW",
    "model": "X6",
    "fuel": "petrol",
    "enginePower": 225,
    "enginePowerUnit": "kW"
  }
}
```

**CarsXE.** Set `CARSXE_API_KEY` to the literal `YOUR_CARSXE_API_KEY` to try the public sample VIN. For a coverage check, repeat both requests on the same VIN with real keys.

```bash
curl --get 'https://api.carsxe.com/v1/international-vin-decoder' \
  --data-urlencode "key=${CARSXE_API_KEY}" \
  --data-urlencode 'vin=WF0MXXGBWM8R43240'
```

```json
{
  "success": true,
  "attributes": {
    "make": "Ford",
    "model": "Galaxy",
    "year": "2008",
    "fuel_type": "Diesel",
    "body": "Wagon"
  }
}
```

## Map the response fields

| Application field | CarAPI.dev | CarsXE | Migration change |
| --- | --- | --- | --- |
| VIN | `vin` (string) | `input.vin` (string) | Keep the requested VIN in your application record. |
| Make and model | `specifications.make`, `specifications.model` (strings) | `attributes.make`, `attributes.model` (strings when present) | Read from `attributes` and review spelling differences before joining to a catalog. |
| Fuel and body | `specifications.fuel`, `specifications.bodyStyle` (strings when present) | `attributes.fuel_type`, `attributes.body` (strings when present) | **Partial match.** Normalize vocabulary, such as petrol and gasoline, to your own enums. |
| Model year | First registration date is a separate field | `attributes.year` (string when present) | Use the model year as its own field. Keep first registration date unknown if you lack a registration source. |
| Engine power | `specifications.enginePower` (number or null) and `enginePowerUnit` (string or null) | No power or unit field | **Unsupported.** Keep kW unknown unless a separate source supplies a value and its unit. |

## Adapt your client and test failures

Move the VIN from the path into the query string and change `token` to `key`. Read the identity fields from `attributes` and return a no-result state on `404`.

```js
async function decodeInternationalVin(vin, key) {
  const url = new URL("https://api.carsxe.com/v1/international-vin-decoder");
  url.search = new URLSearchParams({ key, vin }).toString();
  const response = await fetch(url, { signal: AbortSignal.timeout(10_000) });
  if (response.status === 404) return null;
  if (!response.ok) throw new Error(`CarsXE VIN decode returned HTTP ${response.status}`);

  const result = await response.json();
  if (result.success !== true) throw new Error("CarsXE VIN decode was unsuccessful");

  const fields = result.attributes ?? {};
  return {
    vin,
    make: fields.make?.trim() || null,
    model: fields.model?.trim() || null,
    fuelType: fields.fuel_type?.trim().toLowerCase() || null,
  };
}
```

Replacing the CarAPI.dev token in the before request with `YOUR_CARAPI_TOKEN` returned HTTP `403` with `{"code":"invalid_token","error":"Invalid or missing API token"}`. Handle that separately from a lookup miss. For CarsXE, omit `vin` in the after request to test the documented HTTP `400` validation path. CarAPI.dev exposes quota remaining and reset headers and can return `429`; check CarsXE's account usage and handle its quota and credit failures separately. [CarAPI.dev rate limits](https://docs.carapi.dev/) · [CarsXE errors](/docs/guides/errors) · [CarsXE rate limits and quotas](/docs/guides/rate-limits)

## Cut over production traffic

- [ ] Run both providers on the same VINs from your main markets, including an invalid VIN, a missing record, and a sparse decode.
- [ ] Compare normalized make and model, fuel labels, and missing fields. Keep workflows that require actual color or registration dates on their existing source.
- [ ] Send a small share of traffic to CarsXE. Track no-data and error rates, required-field completeness, latency, and usage.
- [ ] Keep the original client and credentials ready. Switch back if the rollout breaches your thresholds.

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
