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
Note: If no filter parameters are provided, only 100 records are returned. More information below.
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-Sinceheaders with304 Not Modifiedresponses - Customer filtering — use the optional
customerIdsquery parameter to filter data by customer
Note: If no filter parameters are provided, only 100 records are returned. More information below.
Filtering by CPO (recommended)
To narrow results to a specific Charge Point Operator (CPO), include the cpoId query parameter in your requests. This limits the result set to sites and assets associated with the specified operator.
Single CPO ID:
GET /v2/afir/energy-infrastructure-tables?cpoId=42
GET /v2/afir/energy-infrastructure-statuses?cpoId=42
Use the CPO ID assigned to your business. Contact your Spirii representative if you are unsure which ID to use.
Filtering by customer
To ensure you receive locations that belong to one or several customers 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
Contact your Spirii representative if you are unsure which ID(s) to use.
Filtering by country
To restrict results to one or more countries, include the countryIsos query parameter in your requests. Country codes must follow the ISO 3166-1 alpha-2 standard (2-letter codes, e.g. DK, FR, DE).
Single country ISO:
GET /v2/afir/energy-infrastructure-tables?countryIsos=DK
GET /v2/afir/energy-infrastructure-statuses?countryIsos=DK
Multiple country ISOs (comma-separated):
GET /v2/afir/energy-infrastructure-tables?countryIsos=DK,FR,DE
GET /v2/afir/energy-infrastructure-statuses?countryIsos=DK,FR,DE
Combining filters
The customerIds, cpoId, and countryIsos query parameters can be combined to further refine the result set. When multiple filters are provided, only sites and assets matching all specified criteria are returned.
Example:
GET /v2/afir/energy-infrastructure-tables?customerIds=1233&cpoId=42&countryIsos=DK,FR
GET /v2/afir/energy-infrastructure-statuses?customerIds=1233&cpoId=42&countryIsos=DK,FR
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.
Updated 6 days ago