API

The read-only JSON API of knxprod-index.

Base URL of the hosted instance: https://index.tinkerbus.org. The API is read only (GET), answers JSON, and allows cross-origin requests from any site. GET /openapi.json describes it as OpenAPI 3.

Endpoints

RequestAnswer
GET /v1/search?q=&ets=&manufacturer=&source=&limit=&offset=&include={total, limit, offset, results[]}
GET /v1/entries/{id}One entry
GET /v1/entries/{id}/fileThe stored copy of the file
GET /v1/entries/{id}/productsWhat the file contains: products and application programs
GET /v1/entries/{id}/go302 redirect to the file on the manufacturer’s site
GET /v1/manufacturers?q=&withFiles=&limit=&offset=The registry of KNX manufacturers with the number of indexed files
GET /v1/sourcesThe pages that are read and the result of the last crawl
GET /v1/statusCounts and the last runs of the scheduled jobs
GET /healthzLiveness and database check
GET /openapi.jsonThe OpenAPI document
ParameterMeaning
qWords, at most 200 characters. Every word has to match, as a prefix, the name, article or order number, product names, application names, series, version, category, file name or manufacturer id.
etsOnly files for this ETS major version, for example 6.
manufacturerManufacturer id, for example M-0083.
sourceSource id, as listed by /v1/sources.
include=allAlso files that are gone from the manufacturer’s page or whose link is broken.
limitDefault 20, at most 100.
offsetDefault 0.
curl 'https://index.tinkerbus.org/v1/search?q=JAL-0410&ets=6&limit=5'

Entries

An entry has id, status, sha256, storedSize, download (the API path of the stored copy), productCount, applicationCount, minEts and manufacturerId (taken from the file once it was read), next to what the page said (name, version, releaseDate, fileUrl, pageUrl and so on). Other timestamps: firstSeen, lastSeen, lastChecked, fetchedAt.

status is:

  • ok: the manufacturer’s page still lists the file;
  • gone: it left the page. The entry and its copy are kept for 30 days;
  • error: the link failed three checks in a row.

The file endpoint

/v1/entries/{id}/file serves the stored copy with ETag and X-Content-SHA256 (both are the checksum of the content), supports Range requests, and sets X-Source-Status and X-Source-Page, which say what the manufacturer’s page says now. It answers 404 when no copy is stored, with a message pointing to /go.

/v1/entries/{id}/go redirects to the file on the manufacturer’s site, or answers 410 if the page no longer offers it.

Status codes

CodeMeaning
200, 206Success, partial content for Range requests
302Redirect (/go)
400A bad parameter
404Unknown id, or no stored copy
410The manufacturer’s page no longer offers the file
405Any method other than GET, HEAD or OPTIONS
429Rate limit exceeded. The answer carries Retry-After: 30
503/healthz: the database is not readable

Rate limits

Requests are limited per client address. The default is 120 requests per minute, with a burst of half that, refilled continuously. A file download costs five requests, and /healthz is not limited. Responses carry Cache-Control: five minutes for most answers, a day for stored files.

Checking what you get

Tinkerbus checks the SHA-256 and size of every download against the entry, and refuses redirects to another host. If you write your own client, do the same: compare X-Content-SHA256 with sha256 of the entry.