<Note variant="danger">
  This API is deprecated and will be removed in the future. Please use the [Plate Decoder V2
  API](/docs/v2/plate-decoder) instead.
</Note>

The Vehicle Plate Decoder API looks up the vehicle through the database for matches and returns the VIN, make, model and year among other attributes. It can be coupled with other APIs to become even more powerful. The state is a two letter abbreviation of one of the 50 states, or DC (District of Columbia), GU (Guam), PR (Puerto Rico) or VI (Virgin Islands).

International support includes the following countries: Australia, Brazil, United Kingdom, Ireland, Italy, Spain, India, Mexico and New Zealand.

---

<Row>
  <Col>

    This endpoint allows you to retrieve vehicle information based on license plates and registration numbers.

    ## Required attributes

    <Properties>
      <Property name="key" type="string">
        Your CarsXE API key.
      </Property>
      <Property name="plate" type="string">
        The vehicle registration number or license plate number.
      </Property>
      <Property name="state" type="string">
        The two letter state code (US) such as `CA` or `NY`, Australian state (see FAQ) or Brazil `BR`, United Kingdom `UK`, Ireland `IR`, Italy `IT`, Spain `ES`, India `IND`, Mexico `MX` and New Zealand `NZ`.
      </Property>
      <Property name="country" type="string">
        Australia `AU`

        Optional for `US`.
      </Property>
    </Properties>

    ## Optional attributes

    <Properties>

      <Property name="format" type="string">
        The format of the response. One of `json` or `xml`. Defaults to `json`.
      </Property>
    </Properties>

     ---

    ## Response attributes

    <Properties>
      <Property name="vin" type="string">
        The vehicle identification number.
      </Property>
      <Property name="success" type="boolean">
        Whether the plate decoder data has been retrieved.
      </Property>
      <Property name="imageUrl" type="string">
        A stock photo of that general vehicle. (Use [Images API](/docs/v1/images) for more control)
      </Property>
      <Property name="assembly" type="string">
        Where the vehicle was assembled.
      </Property>
      <Property name="Description" type="string">
        Vehicle description of make, model and trim.
      </Property>
      <Property name="RegistrationYear" type="string">
        Year of the vehicle's registration.
      </Property>
      <Property name="CarMake" type="string">
        The vehicle make.
      </Property>
      <Property name="CarModel" type="string">
        The model of the vehicle.
      </Property>
      <Property name="BodyStyle" type="string">
        The specific vehicle body style.
      </Property>
      <Property name="EngineSize" type="string">
        The vehicle's engine size.
      </Property>
    </Properties>

    <FAQ faqs={[{ question: "What plate can I use for testing?", answer: <>You may be use the following plate for test:<ul><li>Plate: <code>7XER187</code></li><li>State: <code>CA</code></li></ul></>},{question: "How can I search Australian vehicle registrations?", answer: <>For Australia use <code>country=AU&state=NSW</code>. The list of possible Australian states are:<ul><li><code>NSW</code> (New South Wales),</li><li><code>VIC</code> (Victoria),</li><li><code>QLD</code> (Queensland incl. North Queensland),</li><li><code>SA</code> (South Australia),</li><li><code>ACT</code> (Canberra),</li><li><code>NT</code> (Northern Territory),</li><li><code>TAS</code> (Tasmania),</li><li><code>WA</code> (Western Australia),</li></ul></>},{question: "Is the Vehicle Plate Decoder API included in the free trial?", answer: <>No, The Vehicle Plate Decoder API is not included in the 7-day free trial. For more information visit our <a href='/pricing'>pricing</a> page.</>}]} hidePadding />

  </Col>
  <Col sticky>

    <CodeGroup title="Request" tag="GET" label="/platedecoder">

    ```bash
    curl -G https://api.carsxe.com/platedecoder \
      -d key=CARSXE_API_KEY \
      -d plate=7XER187 \
      -d state=CA
    ```

    ```js
    import { CarsXE } from "carsxe-api";
    const carsxe = new CarsXE("CARSXE_API_KEY");
    const plate = "7XER187";
    const state = "CA";
    try {
      const plateDecoder = await carsxe.plateDecoder({ plate, state });
      console.log(plateDecoder);
    } catch (error) {
      console.error(error);
    }
    ```

    ```python
    import asyncio
    from carsxe_api import CarsXE

    carsxe = CarsXE('CARSXE_API_KEY')
    plate = '7XER187'
    state = 'CA'

    try:
        plate_decoder = asyncio.run(carsxe.plate_decoder({"plate": plate, "state": state}))
        print(plate_decoder)
    except Exception as e:
        print(f"Error: {e}")
    ```

    ```php
    <?php
    require_once __DIR__ . '/vendor/autoload.php';
    use CarsxeDeveloper\Carsxe\Carsxe;

    $API_KEY = 'CARSXE_API_KEY';
    $carsxe = new Carsxe($API_KEY);
    $plate = '7XER187';
    $state = 'CA';

    try {
        $plateDecoder = $carsxe->plateDecoder(['plate' => $plate, 'state' => $state]);
        print_r($plateDecoder);
    } catch (Exception $error) {
        echo "Error: " . $error->getMessage();
    }
    ```

    ```ruby
    require 'carsxe'

    API_KEY = 'CARSXE_API_KEY'
    carsxe = Carsxe::CarsXE.new(api_key: API_KEY)
    plate = '7XER187'
    state = 'CA'

    begin
      plate_decoder = carsxe.plate_decoder('plate' => plate, 'state' => state)
      puts plate_decoder
    rescue StandardError => error
      puts "Error: #{error.message}"
    end
    ```

    ```go
    package main

    import (
    	"fmt"
    	"github.com/carsxe/carsxe-go-package"
    )

    func main() {
    	client := carsxe.New("CARSXE_API_KEY")
    	plate := "7XER187"
    	state := "CA"
    	plateDecoder := client.PlateDecoder(map[string]string{"plate": plate, "state": state})
    	fmt.Println(plateDecoder)
    }
    ```

    ```java
    import io.github.carsxe.CarsXE;
    import java.util.Map;
    import java.util.HashMap;

    public class Main {
        public static void main(String[] args) {
            CarsXE carsxe = new CarsXE("CARSXE_API_KEY");
            Map<String, String> params = new HashMap<>();
            params.put("plate", "7XER187");
            params.put("state", "CA");
            try {
                Map<String, Object> plateDecoder = carsxe.platedecoder(params);
                System.out.println(plateDecoder);
            } catch (Exception e) {
                System.err.println("Error: " + e.getMessage());
            }
        }
    }
    ```

    ```swift
    import carsxe

    let carsxe = CarsXE(apiKey: "CARSXE_API_KEY")
    let plate = "7XER187"
    let state = "CA"

    do {
        let plateDecoder = try carsxe.plateDecoder(["plate": plate, "state": state])
        print(plateDecoder)
    } catch {
        print("Error: \(error)")
    }
    ```

    ```csharp
    using carsxe;
    using System;
    using System.Collections.Generic;
    using System.Threading.Tasks;

    class Program
    {
        static async Task Main(string[] args)
        {
            string API_KEY = "CARSXE_API_KEY";
            CarsXE carsxe = new CarsXE(API_KEY);
            string plate = "7XER187";
            string state = "CA";
            try
            {
                var plateDecoder = await carsxe.PlateDecoder(new Dictionary<string, string> { { "plate", plate }, { "state", state } });
                Console.WriteLine(plateDecoder);
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error: {ex.Message}");
            }
        }
    }
    ```

    </CodeGroup>
    <CodeGroup title="Response">
    ```json showLineNumbers {{ title: 'Response' }}
    {
      "success": true,
      "input": {
        "plate": "7XER187",
        "state": "CA",
        "country": "US"
      },
      "vin": "3KPFK4A78HE103497",
      "assembly": "Mexico",
      "Description": "Kia Forte LX",
      "BodyStyle": "Sedan",
      "RegistrationYear": "2017",
      "EngineSize": "2.0L I4 MPI",
      "CarMake": "Kia",
      "CarModel": "Forte"
    }
    ```
    </CodeGroup>

  </Col>
</Row>
