get_sdmx_key_for_dimension
Generate a ready-to-use OR key string of all leaf member IDs for a dimension, enabling direct use in get_sdmx_data without manual metadata parsing.
Instructions
Return all leaf member IDs for a single dimension as a ready-to-use OR key string.
Use this before get_sdmx_data when a dimension has many codes (e.g. 162 NOC minor groups, hundreds of CMA geographies). Avoids the need to call get_cube_metadata and manually parse a large JSON response.
Leaf codes are codes with no children — the lowest-level members in a hierarchy. For flat (non-hierarchical) codelists every code is a leaf.
Example: get_sdmx_key_for_dimension(productId=98100452, dimension_position=6) → { "dimension_id": "Occupation_...", "dimension_name": "Occupation - Minor group - NOC 2021", "position": 6, "leaf_count": 162, "total_count": 309, "or_key": "7+11+12+13+16+18+21+23+...", "note": "Paste or_key at position 6 in your get_sdmx_data key." }
Then use the or_key directly: get_sdmx_data(productId=98100452, key="7.3.1.1.1..1", ...)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| productId | Yes | ||
| dimension_position | Yes | 1-based position of the dimension in the SDMX key (use get_sdmx_structure to find positions). E.g. position=6 for the 6th dot-separated slot. |