Skip to content
FR

The API

Everything the site shows can be read as JSON. Access is free, but goes through a token tied to a confirmed account.

Why a token

An API open to anyone without an account is an open door to bots that submit a thousand projects or vote in a loop. The token ties every call to a confirmed address: one vote stays one vote per person, and the load stays reasonable.

Getting a token

  1. Sign in with your email address: you receive a six-digit code by email, no password.
  2. In My account, create a token. It is shown only once; we keep only a hash of it.
  3. Send it with every request: Authorization: Bearer maub_…

Up to 5 tokens per account, revocable at any time. 600 calls per hour per account, and 5 contributions per hour. Beyond that, the response is 429 with a Retry-After header. Without a valid token: 401.

The API returns the directory's original French text. Project, theme and need objects, and a need's steps, also carry a traductions field holding the English version when there is one.

Reading

RequestReturns
GET /api/moiyour account, to check a token
GET /api/themesthe directory's themes
GET /api/projetspublished projects. Filters theme, q, mis_en_avant; tri=une|votes|recents
GET /api/projets/{slug}a project's full entry
GET /api/besoinspublic needs. theme, tri=soutiens|recents
GET /api/besoins/{slug}a need, its status, its supporters and its work in progress
GET /api/articlesthe articles
GET /api/articles/{slug}an article, rendered as HTML

A need's work in progress

A need under study or in development has a work space (chantier), and keeps it once delivered. Needs carry it in the fields below; while chantier is false, they are empty.

FieldContent
chantiertrue once the work space is open, even before anything is written in it
cahierthe brief, as plain text; null until it is written
rolesthe skills wanted, among code, donnees (data) and terrain (field work)
depotthe code repository's address, once it exists
etapesthe steps, oldest first: jour (YYYY-MM-DD), titre, texte, traductions
traductionsthe English version of the brief: {"en": {"cahier": "…"}}

Who supports a need and who receives its steps by email stays private: the API only gives their number, nb_soutiens.

Taking part

RequestEffect
POST /api/projetssuggests a project, published after review
PUT /api/projets/{slug}/votevotes for a project. One vote per account: repeating it changes nothing
DELETE /api/projets/{slug}/voteremoves your vote
POST /api/besoinsdescribes a need, published after review
PUT /api/besoins/{slug}/soutiensupports a need, once per account
DELETE /api/besoins/{slug}/soutienremoves your support

Examples

export MAUB_JETON=maub_…

curl -s -H "Authorization: Bearer $MAUB_JETON" \
  "https://maub.subalpine.it/api/projets?theme=biodiversite&tri=votes"

curl -s -X PUT -H "Authorization: Bearer $MAUB_JETON" \
  https://maub.subalpine.it/api/projets/plantnet/vote

curl -s -X POST -H "Authorization: Bearer $MAUB_JETON" \
  -H 'Content-Type: application/json' \
  -d '{"titre": "Map drinking water points", "description": "…", "theme": "sante"}' \
  https://maub.subalpine.it/api/besoins

The full schema is published in OpenAPI format: /api/openapi.json. Published data can be reused freely, with credit to MAUB.

Atom feeds

To follow what gets published without a token or an account, add one of these Atom feeds to a feed reader or a monitoring tool:

The French versions are at /flux/.