Skip to content

Public API

Consom'Action data in your applications

A read-only JSON API: aggregate results, barometers and trust scores, indices, open data catalogue. Free, no sign-up needed for moderate use.

Getting started

All routes answer GET requests in JSON (English keys). Labels are in French by default; add ?lang=en or the Accept-Language: en header for English.

curl "https://dev.consomaction.bf/api/v1/results?lang=en"
curl -H "Authorization: Bearer YOUR_KEY" "https://dev.consomaction.bf/api/v1/barometers"

Base URL: https://dev.consomaction.bf/api/v1

OpenAPI 3.1 description: https://dev.consomaction.bf/api/v1/openapi.json

Available routes

Available routes
MethodPathDescription
GET /api/v1/meta Licence, version, contact, last update, upcoming release calendar.
GET /api/v1/themes Topics and number of public items.
GET /api/v1/surveys Surveys open to the public (title, topic, duration, number of questions and participants, link).
GET /api/v1/results Published results (provisional or final); filters theme, from, to, status.
GET /api/v1/results/{slug} Full result: methodology, published questions, distributions and statistics.
GET /api/v1/results/{slug}/questions/{code} One published question and its distribution.
GET /api/v1/barometers Public barometers.
GET /api/v1/barometers/{slug} Waves, trend of recurring questions, trust scores by operator.
GET /api/v1/indices Published indices; filters code, geography, from, to.
GET /api/v1/datasets Open data catalogue; filters theme, source_type, from, to.
GET /api/v1/datasets/{slug} Dataset details: licence, formats and download links, methodology, citation.

Conventions

  • Pagination: page and per_page parameters (100 at most); response with data, links and meta.
  • Dates in ISO 8601; from and to filters as YYYY-MM-DD.
  • Public identifiers only: uuid and slug. No internal identifier.
  • Aggregates only: no individual answer; test participations and excluded answers are left out.
  • HTTP cache: public Cache-Control of 10 minutes and ETag (304 response when If-None-Match matches).
  • CORS open for reading (GET): callable from a browser.
  • Errors: 404 { "error": { "code": "not_found" } }, 401 invalid key, 422 invalid parameter, 429 quota exceeded (Retry-After header).

Quotas

Without a key: 60 requests per minute per IP address. With a key: 600 requests per minute (adjustable). Beyond that, the API answers 429.