← Back to all sparks
M

melodi

INFRA · APIS
Velocity0.0

Retrieve Data from the Insee Melodi APIs

INSEE's statistics API gets a French R client that keeps meeting its edge cases

official-statisticsapi-clientinseefranceopen-data
Current state
Rmelodi is InseeFrLab's R client for the Melodi APIs, which serve French official statistics. It reached 1.0.0 in February 2026 with the technical call parameters moved out of function arguments and into options(), and a per-request row limit raised to 100,000 on the server side. Everything since has been dataset-specific: field names that vary between datasets, geography labels, performance.
Where it's heading
The work is convergence with an API that is still moving. Version 0.3.0 added label lookups so codes become readable; 1.0.0 centralised configuration; 1.0.1 and 1.0.2 each fix a place where a real dataset does not match the assumed shape — get_range_geo() needing an extra label field, then the consumer price index series naming its value column differently from every other dataset. Release notes are in French, which is consistent with the audience.
Prediction
The 1.0.x pattern is one dataset-shape exception per release, which suggests the client is still discovering how much the Melodi datasets vary rather than converging on a general parser. Expect more of the same until the variation is handled generically.

Recent moves

  1. 5mo ago

    get_data() handles value columns not named OBS_VALUE_NIVEAU

    Another dataset-shape exception: the consumer price index series names its observation value column differently from what get_data() assumed. Small, and the third consecutive release to be one of these.

    View source ↗
  2. 6mo ago

    Geography labels added and the lookup loop vectorised

    get_range_geo() returns GEO_OBJECT_LABEL alongside the codes and drops its explicit loops for purrr, which is both a completeness fix and a speed one for the label lookups added at 0.3.0.

    View source ↗
  3. 6mo ago

    Call parameters move from arguments into options()

    The 1.0.0 release is configuration hygiene rather than new capability: technical API parameters that were function arguments or hidden defaults become options() a user sets once. The row ceiling for get_data() also rises to 100,000, a change on the API side.

    View source ↗
  4. 7mo ago

    Broken documentation examples and vcr 2 test migration

    Housekeeping ahead of 1.0.0 — examples that no longer ran are fixed and the recorded HTTP fixtures are regenerated for vcr 2.

    View source ↗
  5. 8mo ago

    Code label lookups for geography and every other dimension

    get_range_geo() and get_range() retrieve the labels behind a dataset's codes, which is what makes a Melodi extract readable without a separate reference table. The two releases after this one are both fixes to these same functions.

    View source ↗