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.
/networks
Returns a list of all Public EV Charging Networks in the database, as an array of Network Objects.
URL
Route: https://v1.api.leccy.net/networks
Method: GET
or POST
Options
The following values are supported as query string parameters.
Name | Description | Supported values | Default |
---|---|---|---|
name | Filters results to a specific Charging Network. | Any value present in the dataset, e.g: tesla | all |
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 |
/networks/{id}
Returns a Public EV Charging Network and its available services, based on its leccy.net ID.
URL
Route: https://v1.api.leccy.net/networks/{ID}
Method: GET
or POST
The following values are supported as query string parameters.
Name | Description | Supported values | Default |
---|---|---|---|
speeds | Filters the Charging Network's available Services by the speeds they offer. | all , slow , fast , rapid , ultra | all |
status | Filters the Charging Network's available Services by the status of the Service. | all , current , discontinued | current |
/services/{id}
Returns a Service that is provided by a Public EV Charging Network, based on its leccy.net ID.
URL
Route: https://v1.api.leccy.net/services/{ID}
Method: GET
or POST
/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
Network Object
A Network Object represents a Public EV Charging Network.
Key | Type | Description | Access |
---|---|---|---|
id | string | The Leccy.net ID of the Charging Network. | Public |
name | string | The name of the Charging Network. | Public |
urls | array | URL resources for further information on the Charging Network. | Public |
services | array | An array of Service Objects. | Public |
logo | string | A URL to an SVG Logo Resource for this Charging Network. | Registered |
Service Object
A Service Object represents an available service that is provided by a Public EV Charging Network.
Key | Type | Description | Access |
---|---|---|---|
id | string | The Leccy.net ID of the Service. | Public |
network | string | The name of the Charging Network that operates this Service. This is only included on the /services/{id} endpoint. | Public |
name | string | The name of this Service. | Public |
supportedSpeeds | array | An array of available charging speeds available with this service. Can be any of the following: slow , fast , rapid or ultra . | Public |
maxPower | object | A Max Power Object showing the maximum reported power output for the this Service. | Public |
rates | array | An array of Rate Objects for this Service. Note: Registered API requests will access the last 10 recorded Rates, Public API requests will only show the current Rates. | Public (Limited) |
Rate Object
A Rate Object represents the pricing for a given Charging Network's Service, that was available at a given time.
Key | Type | Description | Access |
---|---|---|---|
id | string | The Leccy.net ID of the Rate. | Public |
name | string | A reference name of this Rate. | Public |
lastUpdated | object | A Date Object showing when the prices for this Rate were last updated. | Public |
costs | object | A Cost Object showing the recorded costs for the Service. | Public |
energyIncluded | integer | The amount of energy in kilowat hours (kWh) that are included for this rate. 0 indicates there is no usage limit. | Public |
locations | array | An array of Location Rate Objects showing the recorded costs for the Service at different locations. | Registered |
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
}
}
Cost Object
A Cost Object illustrates the various costs for a Service's given Rate.
Format
Key | Type | Description | Access |
---|---|---|---|
kwh | integer | The cost per kWh in pence. | Public |
connection | integer | The connection cost in pence. | Public |
monthly | integer | The monthly cost in pence | Registered |
excessKwh | integer | The cost per kWh in pence for excess usage, when a energyIncluded value is set on the Rate. | Registered |
Example
{
"kwh": 80,
"connection": 100,
"monthly": 895,
"excessKwh": 200
}
Location Rate Object
A Location Rate Object represents the recorded costs for a given location.
Format
Key | Type | Description | Access |
---|---|---|---|
place | string | The name of the location this Rate was for. | Public |
costs | object | A Cost Object showing the recorded costs for the Service. | Public |
Example
{
"place": "Folkestone, UK",
"costs": {
"kwh": 80,
"connection": 100,
}
}
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
}
Max Power Object
A Max Power Object is a simple object containing a power output in kilowatts (kW).
Format
Key | Type | Description |
---|---|---|
ac | integer | The maximum reported AC power output in kW. |
dc | integer | The maximum reported DC power output in kW. |
Example
{
"ac": 0,
"dc": 350
}
Note: In this example, the Service in question provides DC Charging only, meaning the reported AC value is 0.
Date Object
A Date Object is a simple object containing a date in both unix timestamp and human-readable formats.
Format
Key | Type | Description |
---|---|---|
c | string | A ISO 8601 formatted date. |
u | integer | Seconds since the Unix Epoch. |
Example
{
"c": "2022-11-07T00:00:00+00:00",
"u": 1667779200
}
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
}
...
}