Car Registration API – RUST / Crate Documentation

Getting started:

Before you start, you will need a username and password from www.vehicleregistrationapi.com 

add the following dependency to your Cargo.toml file;

[dependencies]
car_registration = “0.1.0”

Now, add the following statement to the top of your main.rs file;

extern crate car_registration;

Let’s say we want to find car information from registration number YHC14Y in New South Wales, Australia –

let registration_number = “YHC14Y”;
let state = “NSW”;
let username = “**your username**”;
let password = “**your password**”;
let json = car_registration::australian_lookup(registration_number, state, username, password);
println!(“{}”, json.to_string());

The return value is a json Value object from serde_json

You can also use the following methods

car_registration::usa_lookup

Which takes arguments registration number, state, username and password

car_registration::european_lookup

Which takes arguments endpoint, registration number, username and password, where endpoint indicates the country, and is one of the following strings;

  • Check (UK)
  • CheckBelgium
  • CheckCroatia
  • CheckCzechRepublic
  • CheckDenmark
  • CheckEstonia
  • CheckFinland
  • CheckFrance
  • CheckHungary
  • CheckIndia
  • CheckIreland
  • CheckItaly
  • CheckNetherlands
  • CheckNewZealand
  • CheckNigeria
  • CheckNorway
  • CheckPortugal
  • CheckRussia
  • CheckSlovakia
  • CheckSouthAfrica
  • CheckSpain
  • CheckSriLanka
  • CheckSweden
  • CheckUAE

The link to this package on creates.io is here: https://crates.io/crates/car_registration