https://github.com/0xnu/mothistory
The SDK provides convenient access to the MOT History API for applications written in the Go Programming Language.
https://github.com/0xnu/mothistory
autonomous-vehicles dft dvsa dvsa-mot-api go golang government govuk mot mot-history transport transportation
Last synced: 10 months ago
JSON representation
The SDK provides convenient access to the MOT History API for applications written in the Go Programming Language.
- Host: GitHub
- URL: https://github.com/0xnu/mothistory
- Owner: 0xnu
- License: mit
- Created: 2023-03-04T04:41:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-19T03:50:45.000Z (11 months ago)
- Last Synced: 2025-07-19T08:51:55.947Z (11 months ago)
- Topics: autonomous-vehicles, dft, dvsa, dvsa-mot-api, go, golang, government, govuk, mot, mot-history, transport, transportation
- Language: Go
- Homepage: https://safo.dev/NEWMOTAPI
- Size: 79.1 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
## MOT History Go SDK
[](https://github.com/0xnu/mothistory/actions/workflows/test.yaml)
[](https://github.com/0xnu/mothistory/releases/latest)
[](https://goreportcard.com/report/github.com/0xnu/mothistory)
[](https://pkg.go.dev/github.com/0xnu/mothistory)
[](/LICENSE)
The SDK provides convenient access to the [MOT History API](https://documentation.history.mot.api.gov.uk/) for applications written in the [Go](https://go.dev/) Programming Language.
### Tests
Execute this command: `go test -v`
### Integration Example
```go
package main
import (
"encoding/json"
"fmt"
"log"
mothistory "github.com/0xnu/mothistory"
)
const (
clientID = "enter_your_client_id>"
clientSecret = "enter_your_client_secret>"
apiKey = "enter_your_api_key"
)
func main() {
config := mothistory.ClientConfig{
ClientID: clientID,
ClientSecret: clientSecret,
APIKey: apiKey,
}
client := mothistory.NewClient(config, nil)
// Get data by registration
data, err := client.GetByRegistration("ML58FOU")
if err != nil {
log.Fatalf("failed to get data by registration: %v", err)
}
printJSON(data)
// Get data by VIN
data, err = client.GetByVIN("AISXXXTEST1239617")
if err != nil {
log.Fatalf("failed to get data by VIN: %v", err)
}
printJSON(data)
// Get bulk download data
data, err = client.GetBulkDownload()
if err != nil {
log.Fatalf("failed to get bulk download data: %v", err)
}
printJSON(data)
// Renew credentials
data, err = client.RenewCredentials(apiKey, "firstname.lastname@example.com")
if err != nil {
log.Fatalf("failed to renew credentials: %v", err)
}
printJSON(data)
}
func printJSON[T any](data *T) {
prettyData, err := json.MarshalIndent(data, "", " ")
if err != nil {
log.Fatalf("failed to marshal vehicle data: %v", err)
}
fmt.Println(string(prettyData))
}
```
### Setting up a MOT History API
You can use this support form to request an [API Key](https://documentation.history.mot.api.gov.uk/mot-history-api/register).
### Using the MOT History API
You can read the [API documentation](https://documentation.history.mot.api.gov.uk/) to understand what's possible with the MOT History API. If you need further assistance, don't hesitate to [contact the DVSA](https://documentation.history.mot.api.gov.uk/mot-history-api/support).
### License
This project is licensed under the [MIT License](./LICENSE).
### Copyright
(c) 2023 - 2025 [Finbarrs Oketunji](https://finbarrs.eu).
The MOT History API Go SDK is Licensed under the [Open Government Licence v3.0](
https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)