Documentation
Getting started
The API is public, so it's easy to jump in and get started with a basic set of data. If you're looking for more data, then simply sign-up in order to be able to authenticate your requests. You'll then have access to a broader set of data. If you want to load media or more extensive data, then that can be arranged, drop us a line.
Access levels
Access | Data | Monthly request limit |
---|---|---|
Public | Restricted | n/a |
Registered | Standard | 100 |
Full | Full | 1000 |
Routes
The following routes are available to load data from.
/vehicles
Returns all vehicles in the database as an array of Vehicle Objects.
URL
Route: https://v1.api.leccy.net/vehicles
Method: GET
or POST
Options
The following values are supported as query string parameters.
Name | Description | Supported values | Default |
---|---|---|---|
status | Filters results by the status of the vehicle. | all , current , future , discontinued | all |
type | Filters results by the vehicle type. | all , car , truck , van | all |
manufacturer | Filters results to a specific manufacturer. | Any value present in the dataset, e.g: tesla | all |
distance | The distance units to return from the dataset. | imperial (miles), metric (kilometers) | imperial |
sort | Sorts the results by a data attribute. | name , range | name |
order | Orders or the returned results. | asc , desc | asc |
token | A valid JWT for a registered api.leccy.net user, if provided it will increase the amount of data returned. | A JSON web token. | undefined |
/vehicles/{id}
Returns a vehicle based on its leccy.net ID.
URL
Route: https://v1.api.leccy.net/vehicles/{ID}
Method: GET
or POST
Options
The following values are supported as query string parameters.
Name | Description | Supported values | Default |
---|---|---|---|
distance | The distance units to return from the dataset. | imperial (miles), metric (kilometers) | imperial |
token | A valid JWT for a registered api.leccy.net user, if provided it will increase the amount of data returned. | A JSON web token. | undefined |
/auth
Allows sign-in to the Leccy.net API using an account registered at api.leccy.net. The response will provide a JWT to use authenticate against API data requests.
URL
Route: https://v1.api.leccy.net/auth
Method: GET
or POST
Options
The following values are supported as query string parameters.
Name | Description |
---|---|
email | The email address used when registering an api.leccy.net account. |
password | The corresponding password for the api.leccy.net account. |
/auth/refresh
Generates a new JWT from a given refresh token.
URL
Route: https://v1.api.leccy.net/auth/refresh
Method: GET
or POST
Options
The following values are supported as query string parameters.
Name | Description |
---|---|
refreshToken | The refresh token (originally provided as part of authentication). |
/user/requestCount
Returns the total number of requests a given user has made in the current month, along with daily statistics.
URL
Route: https://v1.api.leccy.net/user/requestCount
Method: GET
or POST
Options
The following values are supported as query string parameters.
Name | Description |
---|---|
token | A valid JWT for a registered api.leccy.net user. |
Messages
Vehicle Object
A Vehicle Object represents a vehicle.
Key | Type | Description | Access |
---|---|---|---|
id | string | The Leccy.net ID of the vehicle. | Public |
name | string | The name of the vehicle. | Public |
manufacturer | string | The manufacturer of the vehicle. | Public |
status | string | The status of the vehicle. | Public |
type | string | The type of vehicle. | Public |
range | object | A Min-Max Object showing the minimum and maximum reported ranges of variants of this vehicle. Note that as some datasets include multiple reported range tests, priority is given in the following order: WLTP, EPA, NEDC and Estimated. | Public |
seats | object | A Min-Max Object showing the minimum and maximum number of seats available in variants of this vehicle. | Public |
variants | array | An array of Vehicle Variant Objects | Registered |
Example
{
"id": 3538,
"name": "Tesla Model 3",
"manufacturer": "Tesla",
"status": "current",
"type": "car",
"range": {
"min": 381,
"max": 600
},
"seats": {
"min": 5,
"max": 5
},
"variants": []
}
Vehicle Variant Object
A Vehicle Variant Object represents a specific version of a vehicle.
Format
Key | Type | Description | Access |
---|---|---|---|
id | integer | The Leccy.net ID of the vehicle variant. | Registered |
name | string | The name of the vehicle variant. | Registered |
year | integer | The year that the vehicle variant was released. | Registered |
range | object | A Range Object representing the range of the vehicle. | Registered |
Example
{
"id": 1930,
"name": "Performance",
"year": 2021,
"range": {
"wltp": 352
}
}
Range Object
A Range Object provides data representing the expected range of a vehicle. Not all of the various testing standards may be available for any given vehicle.
Format
Key | Type | Description |
---|---|---|
wltp | integer | The reported WLTP range for the vehicle. |
epa | integer | The reported EPA range for the vehicle. |
nedc | integer | The reported NEDC range for the vehicle. |
est | integer | An estimated range for the vehicle (normally a value reported by a manufacturer before a vehicle is tested for release). |
Example
{
"wltp": 100,
"epa": 110,
"nedc": 120,
"est": 100
}
Min-Max Object
A Min-Max Object is a simple object containing a minimum and maximum value for a given dataset.
Format
Key | Type | Description |
---|---|---|
min | integer | The lowest number in the given data. |
max | integer | The highest number in the given data. |
Example
{
"min": 250,
"max": 500
}
Request Count Object
A Request Count Object provides information about the requests a user has made in the current month.
Format
Key | Type | Description | Access |
---|---|---|---|
total | integer | The total number of requests the user has made. | Private |
days | array | An array of objects containing the date and requests - (the number of requests made on the date). | Private |
Example
{
"total": 123,
"days": [
{
"date": "2021-09-01",
"requests": 60
},
{
"date": "2021-09-02",
"requests": 63
}
...
}