The SDK provides convenient access to the MOT History API for applications written in the Go Programming Language.
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)
}
You can use this support form to request an API Key.
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.
This project is licensed under the MIT License.
(c) 2023 Finbarrs Oketunji.
The MOT History API Go SDK is Licensed under the Open Government Licence v3.0