HomeGuidesAPI ReferenceChangelog
Log In
Guides

AFIR compliance

Alternative Fuel Infrastructure Regulation (EU) - article 20

By April 14, 2025, the European Union's Alternative Fuel Infrastructure Regulation (AFIR) article 20 mandates that all operators or owners of publicly available recharging stations shall ensure availability of specified static and dynamic data concerning their charging infrastructure, unrestricted and at no cost, via an Application Programming Interface (API).

Each member state has a National Access Point (NAP) that serves as a centralised platform where the operators or owners can connect to publish their data.

Utilizing Spirii's Developer Hub, the charge point operator or owner can connect to their national access point (NAP) to provide the required static and dynamic data.

Remember to check the integration requirements of the local NAP in your member state.

Required data

The static and dynamic data specified in AFIR's article 20 is covered primarily by the GET Locations V2 endpoint.

The Locations V2 endpoint response contains data about the location, EVSEs at the location, the operator, contact information, etc.

In addition, for the Ad hoc price data (Article 20, paragraph 2, section F, point 3), the charge point operator or owner can utilize the Tariff ID in the Locations V2 endpoint in combination with the Tariffs V2 endpoint for the detailed breakdown of the ad hoc price.

Both endpoints are formatted in accordance with the OCPI 2.3.0 protocol - the first OCPI version that complies with the AFIR requirements.

DATEX II v3 Endpoints

In addition to the OCPI-formatted Locations V2 endpoint, Spirii now provides dedicated AFIR endpoints that return data in the DATEX II v3 format — the data exchange standard used by many National Access Points across the EU.

These endpoints are designed to simplify integration with NAPs that require DATEX II formatted data.

Static data

GET /v2/afir/energy-infrastructure-tables

Returns a DATEX II v3 payload containing static energy infrastructure metadata, including:

  • Sites and stations (locations and chargeboxes in Spirii terms)
  • Refill points and connectors (connectors in Spirii terms)
  • Operating hours
  • Tariff information

Dynamic data

GET /v2/afir/energy-infrastructure-statuses

Returns a DATEX II v3 payload containing real-time energy infrastructure statuses, including:

  • Site, station, and refill point availability/status
  • Tariff information

Key features

  • Public access — both endpoints are publicly accessible and do not require authentication
  • Gzip compression — responses are gzip-encoded for optimized delivery
  • Conditional caching — supports If-Modified-Since headers with 304 Not Modified responses
  • Customer filtering — use the optional customerIds query parameter to filter data by customer

Filtering by customer (recommended)

To ensure you receive locations that belong to your company (CPO) when calling the AFIR/DATEX II endpoints, include the customerIds query parameter in your requests. This limits the result set to sites and assets associated with the specified customer(s).

Single customer ID:
GET /v2/afir/energy-infrastructure-tables?customerIds=1233
GET /v2/afir/energy-infrastructure-statuses?customerIds=1233
Multiple customer IDs (comma-separated):
GET /v2/afir/energy-infrastructure-tables?customerIds=1233,3332,553
GET /v2/afir/energy-infrastructure-statuses?customerIds=1233,3332,553

Use the customer IDs assigned to your company (CPO). Contact your Spirii representative if you are unsure which IDs to use.

Getting access

The charge point operator or owner needs to request an API key to get access to the data for their public chargers.

See the Authentication section in the API reference.

Note: The AFIR DATEX II endpoints (/v2/afir/*) are publicly accessible and do not require an API key.