Skip to main content
The EU’s Alternative Fuels Infrastructure Regulation (AFIR), Article 20, requires operators and owners of publicly available recharging stations to make specified static and dynamic data about their infrastructure available — free, unrestricted, and via an API. Spirii provides dedicated endpoints that return this data in DATEX II v3, ready to feed to your member state’s National Access Point (NAP).

Before you start

This playbook is for operators and owners of public charging in an AFIR member state. Each member state has its own NAP, so check its integration requirements first — in particular whether it consumes DATEX II (covered below) or OCPI (see the note at the end). You’ll also want the CPO ID or customer IDs whose data you’re publishing; contact your Spirii representative if you’re unsure which to use.

The DATEX II endpoints

Two endpoints return AFIR data in DATEX II v3, the exchange format most National Access Points use:
  • Static dataGET /v2/afir/energy-infrastructure-tables returns infrastructure metadata: sites and stations (locations and charge boxes), refill points and connectors, operating hours, and tariff information.
  • Dynamic dataGET /v2/afir/energy-infrastructure-statuses returns real-time availability and status, with tariff information.
Both are public — no API key — and built for a data feed: responses are gzip-encoded, and they support conditional caching, so a request with an If-Modified-Since header returns 304 Not Modified when nothing has changed.
Poll the statuses endpoint more often than the tables endpoint — availability changes constantly, while the infrastructure itself rarely does — and use If-Modified-Since on both to avoid re-fetching unchanged data.

Filter to the data you publish

Three filters scope the response, and can be combined — when you pass more than one, only assets matching all of them are returned.
With no filter, each endpoint returns only 100 records. Always filter by your cpoId or customerIds so you publish your complete infrastructure rather than a truncated sample.

If your NAP uses OCPI

Where a National Access Point consumes OCPI rather than DATEX II, the same AFIR-required data is available through the OCPI-formatted Locations endpoint, with the Tariffs endpoint supplying the ad-hoc price breakdown (Article 20, paragraph 2(f)(3)). Unlike the DATEX II endpoints, this route uses your API key.

AFIR static data

The DATEX II v3 infrastructure tables endpoint.

AFIR dynamic data

The DATEX II v3 real-time status endpoint.

Locations

The site data behind both the DATEX II and OCPI routes.