Home > Uncategorized > Car Registration API available as a #Go #Package

Car Registration API available as a #Go #Package

6884317034_b20d1d86e5_z

Following on from my earlier post on making an authenticated HTTP request in GO, I’ve packaged up the code, and published it to github for Go developers to easily import a wrapper for the http://www.vehicleregistrationapi.com API into their GO code.

The Repo lives at https://github.com/infiniteloopltd/GoCarRegistrationAPI

Here’s the documentation if you want to use the code –

 

GoCarRegistrationAPI

A wrapper for the Car Registration API in Go. To use this package you will need a username and password from http://www.vehicleregistrationapi.com

Usage

package main
import "github.com/infiniteloopltd/GoCarRegistrationAPI"
import "fmt"

func main() {  
    data := car_registration.Australia_lookup("YHC14Y","NSW","***Your Username***","***Your Password***")
    m := data.(map[string]interface{})
    //fmt.Printf("%+v", m)
    fmt.Println(m["Description"])
}

The methods of car_registration are Australia_lookup, USA_lookup and European_lookup, all methods reuturn an interface{}, which can be cast to a string map as shown above.

Australia_lookup

Australia lookup accepts four parameters, the registration number, the state, and your username and password, in that order.

USA_lookup

USA lookup accepts four parameters, the registration number, the state, and your username and password, in that order.

European_lookup

European lookup accepts four parameters, the endpoint, the registration number, and your username and password, in that order, where the endpoint can be one of:

  • 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
Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: