Free requests: create an account, it is instant and needs no card.Then create your key in My account.
Create my free accountAuthentication
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
| Route | What it returns | Counts toward the quota |
|---|---|---|
GET /v1/projects | Search projects (filters below), newest first. | Yes |
GET /v1/projects/{id} | One full project, with every published stage (date, excerpt, link). | Yes |
GET /v1/reference | Accepted values: trades (with their services), stages, cantons and regions, project types. | No |
GET /v1/account | Your 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.
| Parameter | Form | Default |
|---|---|---|
keywords | 1 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 |
trades | Trade identifiers, for example chauffage (heating), sanitaire (plumbing), electricite (electrical). | all |
cantons | Two-letter codes (VD, BE, ZH…), plus CH for federal projects. | all |
municipality | Municipality name; accents and case are ignored. | none |
stages | Stage identifiers, for example credit_construction, mise_a_l_enquete, appel_d_offres. | all except adjudication |
include_awarded | true or false: include contract awards. | false |
project_types | Among public, private, unknown. | public |
published_since | Date YYYY-MM-DD: published on or after. | none |
published_until | Date YYYY-MM-DD: published on or before. | none |
page | Integer from 1 to 50. | 1 |
lang | fr, 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
| Field | Content |
|---|---|
id | Project identifier, for GET /v1/projects/{id}. |
title | Title of the official document. |
trade, service | Trade and service: {"id", "label"}. |
stage | Stage read in the document: {"id", "label"}. |
project_type | public, private or unknown. |
municipality, canton | Municipality and canton. |
published_on | Publication date of the document. |
excerpt | Exact excerpt from the official document: the proof. |
amount_chf, deadline | Amount and deadline, when the document states them (otherwise null). |
language | Language of the document: fr, de or it. |
official_url | Link to the official document. Cite it every time. |
source | Publishing 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:
{"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.
| Code | HTTP | What happened |
|---|---|---|
unauthorized | 401 | Key missing, wrong or revoked. |
account_inactive | 403 | Account suspended: write to contact@onima.ch. |
not_found | 404 | No project with this identifier. |
invalid_argument | 422 | A parameter is unknown or out of range; the message names it and lists the accepted values. |
quota_exceeded | 429 | Monthly limit reached; the answer gives resets_on, the reset date. |
rate_limited | 429 | Too 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"
{
"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
{"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_urlnext 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.