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

AccessDataMonthly request limit
PublicRestrictedn/a
RegisteredStandard100
FullFull1000

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.

NameDescriptionSupported valuesDefault
nameFilters results to a specific Charging Network.Any value present in the dataset, e.g: teslaall
orderOrders or the returned results.asc, descasc
tokenA 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.

NameDescriptionSupported valuesDefault
speedsFilters the Charging Network's available Services by the speeds they offer.all, slow, fast, rapid, ultraall
statusFilters the Charging Network's available Services by the status of the Service.all, current, discontinuedcurrent

/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.

NameDescriptionSupported valuesDefault
statusFilters results by the status of the vehicle.all, current, future, discontinuedall
typeFilters results by the vehicle type.all, car, truck, vanall
manufacturerFilters results to a specific manufacturer.Any value present in the dataset, e.g: teslaall
distanceThe distance units to return from the dataset.imperial (miles), metric (kilometers)imperial
sortSorts the results by a data attribute.name, rangename
orderOrders or the returned results.asc, descasc
tokenA 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.

NameDescriptionSupported valuesDefault
distanceThe distance units to return from the dataset.imperial (miles), metric (kilometers)imperial
tokenA 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.

NameDescription
emailThe email address used when registering an api.leccy.net account.
passwordThe 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.

NameDescription
refreshTokenThe 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.

NameDescription
tokenA valid JWT for a registered api.leccy.net user.

Messages

Network Object

A Network Object represents a Public EV Charging Network.

KeyTypeDescriptionAccess
idstringThe Leccy.net ID of the Charging Network.Public
namestringThe name of the Charging Network.Public
urlsarrayURL resources for further information on the Charging Network.Public
servicesarrayAn array of Service Objects.Public
logostringA 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.

KeyTypeDescriptionAccess
idstringThe Leccy.net ID of the Service.Public
networkstringThe name of the Charging Network that operates this Service. This is only included on the /services/{id} endpoint.Public
namestringThe name of this Service.Public
supportedSpeedsarrayAn array of available charging speeds available with this service. Can be any of the following: slow, fast, rapid or ultra.Public
maxPowerobjectA Max Power Object showing the maximum reported power output for the this Service.Public
ratesarrayAn 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.

KeyTypeDescriptionAccess
idstringThe Leccy.net ID of the Rate.Public
namestringA reference name of this Rate.Public
lastUpdatedobjectA Date Object showing when the prices for this Rate were last updated.Public
costsobjectA Cost Object showing the recorded costs for the Service.Public
energyIncludedintegerThe amount of energy in kilowat hours (kWh) that are included for this rate. 0 indicates there is no usage limit.Public
locationsarrayAn array of Location Rate Objects showing the recorded costs for the Service at different locations.Registered

Vehicle Object

A Vehicle Object represents a vehicle.

KeyTypeDescriptionAccess
idstringThe Leccy.net ID of the vehicle.Public
namestringThe name of the vehicle.Public
manufacturerstringThe manufacturer of the vehicle.Public
statusstringThe status of the vehicle.Public
typestringThe type of vehicle.Public
rangeobjectA 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
seatsobjectA Min-Max Object showing the minimum and maximum number of seats available in variants of this vehicle.Public
variantsarrayAn array of Vehicle Variant ObjectsRegistered

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

KeyTypeDescriptionAccess
idintegerThe Leccy.net ID of the vehicle variant.Registered
namestringThe name of the vehicle variant.Registered
yearintegerThe year that the vehicle variant was released.Registered
rangeobjectA 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

KeyTypeDescriptionAccess
kwhintegerThe cost per kWh in pence.Public
connectionintegerThe connection cost in pence.Public
monthlyintegerThe monthly cost in penceRegistered
excessKwhintegerThe 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

KeyTypeDescriptionAccess
placestringThe name of the location this Rate was for.Public
costsobjectA 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

KeyTypeDescription
wltpintegerThe reported WLTP range for the vehicle.
epaintegerThe reported EPA range for the vehicle.
nedcintegerThe reported NEDC range for the vehicle.
estintegerAn 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

KeyTypeDescription
minintegerThe lowest number in the given data.
maxintegerThe 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

KeyTypeDescription
acintegerThe maximum reported AC power output in kW.
dcintegerThe 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

KeyTypeDescription
cstringA ISO 8601 formatted date.
uintegerSeconds 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

KeyTypeDescriptionAccess
totalintegerThe total number of requests the user has made.Private
daysarrayAn 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
      }
      ...
  }