Skip to main content

The SDK provides convenient access to the MOT History API for applications written in the Python programming language.

Project description

MOT History API Python SDK

The SDK provides convenient access to the MOT History API functionality from applications written in the Python programming language.

Requirements

Python 2.7 and later.

Setup

You can install this package by using the pip tool and installing:

$ pip install mot-history-api-py-sdk

Or:

$ easy_install mot-history-api-py-sdk

Usage Example

from motapi.motdata import *

api_key = "<your-api-key>" # your api key
registration = "ML58FOU" # example of a vehicle registration
page = 1 # pagination
date = "20230201" # date must be five weeks from the current date
vehicle_id = "<enter your vehicle id here>" # unique vehicle id for vehicles that have had an MOT test

reg = Registration(api_key)
reg_data = reg.get_data(registration)
if reg_data is not None:
    print(reg_data)
else:
    print("Failed to retrieve data!")

p = Page(api_key)
page_data = p.get_data(page)
if page_data is not None:
    print(page_data)
else:
    print("Failed to retrieve data!")

d = Date(api_key)
date_data = d.get_data(date, page)
if date_data is not None:
    print(date_data)
else:
    print("Failed to retrieve data!")

v = VehicleID(api_key)
vehicle_data = v.get_data(vehicle_id)
if vehicle_data is not None:
    print(vehicle_data)
else:
    print("Failed to retrieve data!")

Request MOT History API Key

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

Using the MOT History API Key

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

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mot-history-api-py-sdk-0.0.3.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

mot_history_api_py_sdk-0.0.3-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page