How to download the files
Requesting the files
To request the files, make a GET request to the /v1/trade/vehicles/bulk-download
endpoint. Pass the API key and access token as HTTP headers.
Example request
curl -X GET https://history.mot.api.gov.uk/v1/trade/vehicles/bulk-download \
-H "Authorization": "Bearer { issued access token }"
-H "X-API-Key": "{ issued api key }"
Response
The response will be a JSON object containing URLs for each file that you can download.
For example, if you call the API endpoint on Wednesday, you will be sent 5 URLs. There will be:
- 1 URL for the bulk file generated the previous Sunday
- 4 URLs for the delta files generated on the Sunday, Monday, Tuesday and Wednesday
Files will be available from 8am.
Delta files will contain data from the past 24 hours. For example, Tuesday’s file will contain tests completed on Monday. If something goes wrong when generating a delta file, the data for the missing export will be included in a later export.
Here is an example of the response:
{
"bulk": [
{
"filename": "v1/public/bulk/year=2023/month=12/day=3/bulk-light-vehicle_03-12-2023.zip",
"downloadUrl": "https://s3.example.com/v1/public/bulk/year=2023/month=12/day=3/bulk-light-vehicle_03-12-2023.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F2023-12-07%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=2023-12-07T110808Z&X-Amz-Expires=300&X-Amz-Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc963176630326f1024&X-Amz-SignedHeaders=host",
"fileSize": 19778478487,
"fileCreatedOn": "2023-12-03"
}
],
"delta": [
{
"filename": "v1/public/delta/year=2023/month=12/day=3/delta-light-vehicle_03-12-2023.zip",
"downloadUrl": "https://s3.example.com/v1/public/delta/year=2023/month=12/day=3/delta-light-vehicle_03-12-2023.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F2023-12-07%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=2023-12-07T110808Z&X-Amz-Expires=300&X-Amz-Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc963176630326f1024&X-Amz-SignedHeaders=host",
"fileSize": 19778478487,
"fileCreatedOn": "2023-12-03"
},
{
"filename": "v1/public/delta/year=2023/month=12/day=4/delta-light-vehicle_04-12-2023.zip",
"downloadUrl": "https://s3.example.com/v1/public/delta/year=2023/month=12/day=4/delta-light-vehicle_04-12-2023.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F2023-12-07%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=2023-12-07T110808Z&X-Amz-Expires=300&X-Amz-Signature=8d9b5998d2419d0191a8a9f3069b530ee4f2f137e6b8c0f59cfc232b4028d2d2&X-Amz-SignedHeaders=host",
"fileSize": 16616,
"fileCreatedOn": "2023-12-04"
},
{
"filename": "v1/public/delta/year=2023/month=12/day=5/delta-light-vehicle_05-12-2023.zip",
"downloadUrl": "https://s3.example.com/v1/public/delta/year=2023/month=12/day=5/delta-light-vehicle_05-12-2023.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F2023-12-07%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=2023-12-07T110808Z&X-Amz-Expires=300&X-Amz-Signature=8d9b5998d2419d0191a8a9f3069b530ee4f2f137e6b8c0f59cfc232b4028d2d2&X-Amz-SignedHeaders=host",
"fileSize": 16616,
"fileCreatedOn": "2023-12-05"
},
{
"filename": "v1/public/delta/year=2023/month=12/day=6/delta-light-vehicle_06-12-2023.zip",
"downloadUrl": "https://s3.example.com/v1/public/delta/year=2023/month=12/day=6/delta-light-vehicle_06-12-2023.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F2023-12-07%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=2023-12-07T110808Z&X-Amz-Expires=300&X-Amz-Signature=8d9b5998d2419d0191a8a9f3069b530ee4f2f137e6b8c0f59cfc232b4028d2d2&X-Amz-SignedHeaders=host",
"fileSize": 15312,
"fileCreatedOn": "2023-12-06"
}
]
}
Downloading the files
The URLs are temporary links that let you access the files stored in S3. The links will expire 5 minutes after they are created, so download the files as soon as you get the response. If the links expire, call the API again to get new ones.
Downloads in progress will continue after the link expires.
You can use any HTTP client to download a file, such as curl, wget, or Postman. For example, to download the bulk file using curl, you can use the following command:
curl -O https://s3.example.com/v1/public/bulk/year=2023/month=12/day=5/bulk-light-vehicle_05-12-2023.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F2023-12-07%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=2023-12-07T110808Z&X-Amz-Expires=300&X-Amz-Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc963176630326f1024&X-Amz-SignedHeaders=host