What this is
From 18 February 2027, every EV, LMT and industrial battery over 2 kWh placed on the EU market needs a Digital Product Passport: roughly 80β100 Annex XIII attributes, a unique identifier, a scannable data carrier, and access control that shows different data to different audiences. This API turns the free, Commission-published data models into three calls β create β register β resolve.
π Create
Validate attributes against Annex XIII, mint an ISO/IEC 15459 UID, get back a scannable carrier. Anonymous β no key needed.
ποΈ Register
Submit the UID and registration data to the EU DPP Registry test environment. Production cutover is configuration only.
π Resolve
The public URL behind the QR/NFC carrier, filtered to the caller's tier β the part everyone gets wrong.
Live demo β create a battery passport
Builds a real POST /v1/passports request and validates it in your
browser using this project's bundled library β the same code the server runs. Toggle the tiers
to see exactly which attributes each audience receives.
UID:
Status:
Resolve URL:
Missing for issuance:
Access tier filter
The same filterByTier function the server applies, running
here in the page β so the decision is reproducible offline.
Access tiers β the hard part, done right
Every attribute in the data model carries a tier drawn from Battery Regulation (EU) 2023/1542.
Resolution at /dpp/{uid} returns only what the caller is entitled to, and names
the groups it withheld β never their values. Default-deny: an attribute with
no explicit tier is treated as competent-authority, so a newly added field can
never leak before someone classifies it.
public
Anyone scanning the QR or NFC carrier. No credential. General info, carbon footprint, end-of-life, safety labels, capacity and energy.
legitimate-interest
Suppliers, recyclers, repairers, second-life operators, notified bodies. Bearer key with
scope legitimate-interest. Adds cell chemistry, supply chain, hazardous
substances, state-of-health and electrochemical data.
competent-authority
National market-surveillance authorities and the European Commission. Bearer key with
scope competent-authority. Everything, including declarations, test reports
and EORI.
Call the API
Base URL: https://apis.allanninal.dev/dpp
Validates against the versioned Annex XIII model, mints the UID, and returns the carrier
and resolve URL. Incomplete attributes return status: "draft" rather than an
error. Pass your issuer key if you intend to register β a passport created
anonymously has no owner and can never be amended or registered.
curl -s -X POST https://apis.allanninal.dev/dpp/v1/passports \
-H "content-type: application/json" \
-d '{
"category": "battery-ev",
"carrier": "qr",
"attributes": {
"manufacturerName": "ACME Cells GmbH",
"batteryModel": "ACME-EV-75",
"batteryCategory": "EV",
"batteryStatus": "original",
"manufacturingDate": "2027-03-01",
"ratedCapacityKwh": 75,
"nominalVoltage": 400,
"chemistry": "NMC811",
"stateOfHealth": 100
}
}'
Resolves by UID. No credential returns the public attributes only; a scoped key returns
more. GET /dpp/{uid} serves the same data as a human-readable page β that is
the URL inside the carrier.
# Public tier (anyone):
curl https://apis.allanninal.dev/dpp/v1/dpp/urn%3Adpp%3Aapis.allanninal.dev%3A000000000001
# Legitimate-interest tier:
curl -H "authorization: Bearer $DPP_LEGIT_KEY" \
https://apis.allanninal.dev/dpp/v1/dpp/urn%3Adpp%3A...
# Competent-authority tier:
curl -H "authorization: Bearer $DPP_AUTHORITY_KEY" \
https://apis.allanninal.dev/dpp/v1/dpp/urn%3Adpp%3A...
Submits the UID and mandatory registration data to the registry β test environment by default. Idempotent per (passport, environment), and registry errors are returned verbatim rather than masked as success.
curl -X POST https://apis.allanninal.dev/dpp/v1/passports/{passportId}/register \
-H "authorization: Bearer $DPP_ISSUER_KEY" \
-H "content-type: application/json" \
-d '{ "registryEnv": "test" }'
A real symbol, not a picture of one: qr is ISO/IEC 18004 byte mode at
error-correction level M with full ReedβSolomon correction and penalty-scored masking;
datamatrix is ISO/IEC 16022 ECC 200; nfc is an NDEF URI record
as hex, ready to write to a tag. Deterministic β the same passport always yields a
byte-identical symbol.
Also available: GET /v1/passports (list), GET /v1/passports/{id}
(full, owner only), PATCH /v1/passports/{id} (draft update or versioned
amendment), and GET /v1/usage. Full contract in
openapi.yaml.
Access & rate limits
Creating and publicly resolving passports are free and anonymous. Managing, registering and
resolving above the public tier need a scoped key sent as
Authorization: Bearer dpp_... β the scope is what decides the tier you receive.
issuer | Create, list, fetch in full, amend and register your own passports. |
legitimate-interest | Resolve any passport at the legitimate-interest tier. |
competent-authority | Resolve any passport at the full tier. |
Anonymous callers get 60 requests/minute and 5,000/day per client IP; key holders get 5Γ the
minute budget and 10Γ the daily one. Every response carries RateLimit-Limit,
RateLimit-Remaining and RateLimit-Reset; throttled requests return
429 with Retry-After.
Reference data (static, no auth)
- /api/v1/index.json β endpoint catalogue
- /api/v1/meta.json β regulations, key dates, registry environment, dataset versions
- /api/v1/categories.json β supported categories
- /api/v1/data-models/{category}.json β Annex XIII attributes, each with its access tier
- /api/v1/access-tiers.json β tier definitions and the group β tier map
- /api/v1/carriers.json β carrier and identifier standards
- /api/v1/schemas/ β JSON Schemas
- openapi.yaml β OpenAPI 3.1
FAQ
When does the battery passport become mandatory?
18 February 2027, for every EV, LMT and industrial battery over 2 kWh placed on the EU market β Regulation (EU) 2023/1542, Article 77 and Annex XIII.
Is this the official EU DPP Registry?
No. The Commission's registry was established by Implementing Regulation (EU) 2026/1778 and went live on 20 July 2026. This API is a client of it and defaults to the test environment. Registering for real also requires enrolling as a verified economic operator (an eIDAS identity check) with the Commission β that step happens outside this API.
Which categories are covered?
Version 1 is the battery passport: battery-ev, battery-lmt and
battery-industrial. Other ESPR categories β textiles, electronics, furniture β
arrive as new versioned data models as their delegated acts finalise, with no code change.
Do the QR codes actually scan?
Yes. The encoders are full implementations, and every symbol the test suite generates is rasterised and read back with two independent decoders across every version and size, so a regression fails the build instead of shipping a label nobody can scan.
How much does it cost?
Nothing. The reference data is free and open, creating and resolving are free with rate limiting, the code is MIT-licensed, and the data comes from free Commission publications with attribution.
Not technical? Here's the whole idea in simple words
Imagine a restaurant π½οΈ. You don't march into the kitchen and start cooking. You tell the waiter what you'd like, and a few minutes later your dish arrives. An API is that waiter β but for software. One app asks for something, the API goes and gets it, and hands back a tidy answer. Nobody has to touch the messy kitchen.
1 What an API actually is
API stands for "Application Programming Interface," but you can forget those words. The useful idea is this: it's a polite, reliable messenger that sits between two systems so they can work together without knowing each other's secrets.
Maps in an app
A ride app asks a maps API "where is this address?"
Card payments
A shop asks a payment API "is this card good?"
Weather widget
A site asks a weather API "what's it like today?"
"Log in withβ¦"
One app asks another "is this really them?"
2 Why it matters for your business
Most businesses lose time and money in the gaps between tools β someone exports a spreadsheet here, retypes numbers there, emails a file to a partner, and hopes nobody made a typo. An API closes those gaps.
β±οΈ Save time
Work that took hours by hand happens in a blink, on its own.
β Fewer mistakes
No more typos from copying numbers between apps.
π Grow easily
Ten customers or ten thousand β it keeps up without extra staff.
πΆ New income
You can even sell access β partners pay to use your API.
π Always on
It answers day and night, weekends and holidays included.
π€ Better partnerships
Give partners a clean, safe door instead of raw access.
3 The parts that make one
A door
A clear, documented place to ask for things.
A guard
Keys and limits so only allowed callers get in.
A brain
The rules and logic that do the real work.
A memory
Where your data safely lives and is looked up.
4 The process, step by step
- 1
π¬ Talk
You describe the problem in everyday words. No spec, no tech vocabulary required.
- 2
βοΈ Plan
I sketch a simple plan and agree on what "done" looks like, so there are no surprises.
- 3
π¨ Build
I build a small, working slice quickly β something you can actually see and try.
- 4
π§ͺ Test
I check it against real cases so it behaves correctly, safely, and fast.
- 5
π Live
I ship it, keep it running, and it's ready for your apps and partners.
5 What you actually get
6 Built to a secure, professional standard
A public API is part of your brand β it's a front door the whole internet can knock on. So it's built the way a bank builds a vault, not the way a hobby project throws something online. Every API in this family is shipped to the same standard:
π Encrypted by default
HTTPS everywhere with automatic certificates and HSTS β data is never sent in the clear.
π¦ Abuse-resistant
Per-caller rate limits at the gateway stop floods and keep it fair and available for everyone.
π§° Standards-based
A documented OpenAPI contract, predictable JSON, and clear status codes β the conventions every developer already expects.
π‘οΈ Hardened surface
Locked-down servers, no version banners to probe, input validated, and no secrets in the code.
π§Ύ Provable & auditable
Versioned data and reproducible results, so an answer can be traced back to its source and defended.
β Tested & monitored
Automated tests prove behaviour before release, and health checks keep it honest in production.
Why that's good for your brand online
A clean, reliable, well-documented API is a quiet but powerful marketing asset. It tells partners and customers you're serious β and it earns trust that spreads on its own:
πͺͺ A real example: this DPP API
This isn't theory β the page you're on is served by a real API I built. It tackles a concrete problem from the EU Digital Product Passport: from 18 February 2027, every EV, LMT and industrial battery over 2 kWh sold in the EU must carry a passport that a phone can scan, that is registered with the Commission, and that shows different data to different people.
The question your app asks:
POST /v1/passports
{ "category": "battery-ev", "attributes": { β¦ } }
The clean answer it hands back: a unique identifier, a scannable QR code, and a public web address for that exact battery β plus one call to register it with the EU registry, and a resolver that quietly hides the confidential attributes from anyone who isn't entitled to see them.
The same building blocks β a door, a guard, a brain, a memory β pointed at one real problem. The same kit can become an API for your idea.
π Want an API for your idea?
This API was designed and built by Allan NiΓ±al, an AI & software engineer who ships friendly, well-made, developer-first APIs and data products. Tell me the problem in plain words β product passports, compliance, traceability, or anything else β and I'll turn it into something that works.