Skip to content

Data hosted in Switzerland

Documentation

API reference

Swiss construction projects in your own tools: one key, four routes, JSON answers. Every project carries the excerpt from the official document and its link.

Updated on

Free requests: create an account, it is instant and needs no card.Then create your key in My account.

Create my free account

Authentication

Create a key in My account. It starts with onima_ and is shown only once: store it right away. Up to three active keys per account; you can revoke one at any time.

Send it with every request in this header:

Authorization: Bearer onima_YOUR_KEY

Base address: https://api.onima.ch/v1/. Machine-readable description (OpenAPI): https://api.onima.ch/openapi.json. The API is made for your servers and scripts: it does not answer calls from a web page (no CORS headers).

The four routes

RouteWhat it returnsCounts toward the quota
GET /v1/projectsSearch projects (filters below), newest first.Yes
GET /v1/projects/{id}One full project, with every published stage (date, excerpt, link).Yes
GET /v1/referenceAccepted values: trades (with their services), stages, cantons and regions, project types.No
GET /v1/accountYour account: monthly usage, preferences.No

Parameters of GET /v1/projects

All optional. Lists are comma separated. Trade and stage identifiers are listed by GET /v1/reference.

ParameterFormDefault
keywords1 to 5 terms of 2 to 80 characters. A project matches if one of the terms is found: add the French and German synonyms.none
tradesTrade identifiers, for example chauffage (heating), sanitaire (plumbing), electricite (electrical).all
cantonsTwo-letter codes (VD, BE, ZH…), plus CH for federal projects.all
municipalityMunicipality name; accents and case are ignored.none
stagesStage identifiers, for example credit_construction, mise_a_l_enquete, appel_d_offres.all except adjudication
include_awardedtrue or false: include contract awards.false
project_typesAmong public, private, unknown.public
published_sinceDate YYYY-MM-DD: published on or after.none
published_untilDate YYYY-MM-DD: published on or before.none
pageInteger from 1 to 50.1
langfr, de or it: language of the labels (trade, stage). Excerpts stay in the language of the document.account language, else fr

The database covers the last 12 months. GET /v1/projects/{id} and GET /v1/reference also accept lang. Identifiers are in French because the labels are; use GET /v1/reference to read them.

The shape of a project

FieldContent
idProject identifier, for GET /v1/projects/{id}.
titleTitle of the official document.
trade, serviceTrade and service: {"id", "label"}.
stageStage read in the document: {"id", "label"}.
project_typepublic, private or unknown.
municipality, cantonMunicipality and canton.
published_onPublication date of the document.
excerptExact excerpt from the official document: the proof.
amount_chf, deadlineAmount and deadline, when the document states them (otherwise null).
languageLanguage of the document: fr, de or it.
official_urlLink to the official document. Cite it every time.
sourcePublishing authority.

A search returns {"projects": [...], "total", "page", "pages", "usage"}. A single project adds stages: every published stage of the same project, with its date, title, excerpt and link, and current: true on the most advanced one. If you ask for an identifier filed under another project, you get the project that was kept.

Your usage

Every answer that counts toward the quota carries usage; GET /v1/account returns it at any time:

Example
{"plan": "free", "month": {"used": 12, "limit": 50, "percent": 24, "resets_on": "2027-01-01"}}

The counter resets on the first day of each month (Zurich time). The figures above are an example, not your limit: it is shown in My account.

Errors

Always the same shape: {"error": {"code": "...", "message": "..."}}. The message says what to do.

CodeHTTPWhat happened
unauthorized401Key missing, wrong or revoked.
account_inactive403Account suspended: write to contact@onima.ch.
not_found404No project with this identifier.
invalid_argument422A parameter is unknown or out of range; the message names it and lists the accepted values.
quota_exceeded429Monthly limit reached; the answer gives resets_on, the reset date.
rate_limited429Too many requests in a short time: wait a minute.

Examples to copy

1. Heating projects in the canton of Vaud

curl -s "https://api.onima.ch/v1/projects?trades=chauffage&cantons=VD" \
  -H "Authorization: Bearer onima_YOUR_KEY"
Example answer, shortened
{
  "projects": [
    {
      "id": "d-12b0c4f7b17eac57:chauffage:1",
      "title": "Préavis 10.2026, annexe 1",
      "trade": {"id": "chauffage", "label": "Chauffage"},
      "service": {"id": "chauffage_bois", "label": "Chauffage au bois"},
      "stage": {"id": "preavis_depose", "label": "Crédit demandé"},
      "project_type": "public",
      "municipality": "Bretonnières", "canton": "VD",
      "published_on": "2026-11-24",
      "excerpt": "Auberge communale - chauffage à pellets 120 000.00",
      "amount_chf": 120000, "deadline": null,
      "language": "fr",
      "official_url": "https://bretonnieres.ch/download/65/2026/4096/preavis-10-2026_annexe-1.pdf",
      "source": "Commune de Bretonnières"
    }
  ],
  "total": 56, "page": 1, "pages": 6,
  "usage": {"plan": "free", "month": {"used": 13, "limit": 50, "percent": 26, "resets_on": "2027-01-01"}}
}

2. Words in the languages of the documents

curl -s -G "https://api.onima.ch/v1/projects" \
  --data-urlencode "keywords=Wärmepumpe,Erdsonde,pompe à chaleur" \
  --data-urlencode "cantons=BE" \
  -H "Authorization: Bearer onima_YOUR_KEY"

3. Construction credits voted in Zurich since 1 November

curl -s "https://api.onima.ch/v1/projects?cantons=ZH&stages=credit_construction&published_since=2026-11-01&lang=de" \
  -H "Authorization: Bearer onima_YOUR_KEY"

4. One full project, with all its stages

curl -s "https://api.onima.ch/v1/projects/d-12b0c4f7b17eac57:chauffage:1" \
  -H "Authorization: Bearer onima_YOUR_KEY"

5. Accepted values (trades, stages, cantons)

curl -s "https://api.onima.ch/v1/reference?lang=fr" \
  -H "Authorization: Bearer onima_YOUR_KEY"

6. Your usage this month

curl -s "https://api.onima.ch/v1/account" \
  -H "Authorization: Bearer onima_YOUR_KEY"

7. An error, to see its shape

Example answer
{"error": {"code": "invalid_argument", "message": "cantons: \"XX\" is not a canton. Accepted values: AG, AI, AR, BE, BL, BS, CH, FR, GE, GL, GR, JU, LU, NE, NW, OW, SG, SH, SO, SZ, TG, TI, UR, VD, VS, ZG, ZH."}}

The answers shown are shortened examples: usage figures and totals vary.

Good use

  • Always cite official_url next to a project: it is the proof.
  • Do not present the excerpt as Onima’s text: it is a quotation from the official document.
  • Questions: contact@onima.ch.

Updated on 4 December 2026. To connect an assistant (Claude, ChatGPT) without a key: Connect your assistant.