LMTPASS

All articles

A passport that machines can read

· 4 min read

Article 78 requires open, structured, machine-readable data. A page that shows nothing until a browser has run its code answers neither a validator, nor a search crawler, nor a link preview. What a scanner without JavaScript must see.

The battery passport is designed first for a human scanning a QR code with a phone. But it is also read by programs: the validators of the European registry, the tools of recyclers and repairers, search engine crawlers, the services that build the preview of a link shared in a messaging app. Article 78 of the regulation makes this a requirement: passport data must rest on open standards, in an interoperable, machine-readable, structured and searchable format.

What a program sees

A modern web page is often an empty shell: an HTML file of a few lines, and a JavaScript program which, once the browser runs it, fetches the data and draws the page. For a human, the difference is invisible. For a program that merely downloads the page, it is total: it receives the shell, not the content.

That is the case for most search crawlers, for every link preview, for nearly all validation tools and for most scripts a recycler might write to read hundreds of passports. The passport exists, but not for them.

Two ways to answer

An application programming interface. The passport is available as structured data, for instance JSON, at a stable address. That is the route favoured by Article 78 and by the European digital product passport standards: data, not layout. Professionals' tools plug into it directly.

A page rendered by the server. The same address as the QR code's returns, to a client that runs no code, a complete HTML page with the data already in it, plus structured metadata describing the product. Browsers keep receiving the interactive application. Each gets what it can read.

The two complement each other. The first serves integration; the second serves everything that lands on the address unannounced: the preview in a business messaging tool, the search engine, the script written in ten minutes.

The same access rules

Serving a machine-readable page changes nothing about access levels. The regulation distinguishes what is public from what is reserved to persons with a legitimate interest and to authorities. A crawler is a public reader: it receives exactly what a passer-by would, and nothing that is restricted. The JavaScript-free version must be built from the same filtering as the interactive page, not from a full export.

Two practical consequences. A draft or withdrawn passport answers crawlers with an error page that asks them not to index it. And a passport whose battery was withdrawn from the market says so at the top of the page, legibly, to humans and machines alike.

Injection, the classic risk

Rendering a page from data entered by third parties, suppliers included, exposes a well-known risk: that a field contains code instead of text. A model name containing a script tag, displayed as is, would run that script for every visitor. Every value must be escaped before it is written into the page, without exception, including in the structured metadata and in link addresses, which must only accept ordinary web URLs.

What it yields

A passport link pasted into a conversation shows the model, the manufacturer and a description. A search engine indexes the page with its title and product data. A validator receives content to validate. A recycler reading a thousand passports does not have to drive a browser. And the visitor with a phone sees no difference, except that the page exists for everyone.

Check your obligations in 30 seconds · Create a passport for free