0xnu / mothistory

The SDK provides convenient access to the MOT History API for applications written in the Go Programming Language.

Home Page:http://finns.cc/MOTAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MOT History Go SDK

Release Go Report Card Go Reference License

The SDK provides convenient access to the MOT History API for applications written in the Go Programming Language.

Usage Example

package main

import (
	"fmt"

	mothistory "github.com/0xnu/mothistory"
)

const apiKey = "<your-api-key>"

func main() {
	client := mothistory.NewClient(apiKey)

	// Get data by registration
	json, err := client.GetByRegistration("ML58FOU")
	if err != nil {
		fmt.Printf("failed to get data by registration: %v", err)
		return
	}
	fmt.Println(json)

    // Get data by page
    json, err = client.GetByPage(2)
    if err != nil {
        fmt.Printf("failed to get data by page: %v", err)
        return
    }
    fmt.Println(json)

    // Get data by date and page
    json, err = client.GetByDateAndPage("20230201", 1)
    if err != nil {
        fmt.Printf("failed to get data by date and page: %v", err)
        return
    }
    fmt.Println(json)

    // Get data by vehicle ID
    json, err = client.GetByVehicleID("<enter your vehicle id here>")
    if err != nil {
        fmt.Printf("failed to get data by vehicle ID: %v", err)
        return
    }
    fmt.Println(json)

}

Setting up a MOT History API

You can use this support form to request an API Key.

Using the MOT History API

You can read the API documentation to understand what's possible with the MOT History API. If you need further assistance, don't hesitate to contact the DVSA.

License

This project is licensed under the MIT License.

Copyright

(c) 2023 Finbarrs Oketunji.

The MOT History API Go SDK is Licensed under the Open Government Licence v3.0

About

The SDK provides convenient access to the MOT History API for applications written in the Go Programming Language.

http://finns.cc/MOTAPI

License:MIT License


Languages

Language:Go 100.0%