In SDMX API v2, structure queries allow developers to retrieve metadata that defines how data is organised and classified. These structures include Data Structure Definitions (DSDs), code lists, concept schemes, dataflows, categorisations, and content constraints. Understanding and using structure queries is essential for interpreting data correctly and building dynamic, metadata-driven applications.
Structure queries use RESTful endpoints and can be filtered by identifiers, agency IDs, and version numbers. For example, you can query a specific DSD, retrieve a list of all dataflows, or retrieve all code lists used in a dataflow. The API supports responses in multiple formats, including SDMX-ML and JSON, making it adaptable to different technical environments.
Options like references=children, references=parents, or references=all allow you to control the scope of related metadata included in the response—useful for fetching a DSD, along with its associated code lists and concepts in a single call. Query parameters like detail=full or detail=referencepartial help adjust the level of detail returned.
These structure queries are critical for building flexible data integration tools, validating data, or creating user interfaces that dynamically adapt to available dimensions and indicators. Overall, SDMX API v2 provides a powerful and standardised way to programmatically explore and consume statistical metadata.
In this unit, we'll take a closer look at structure queries, providing realistic examples. Then we'll explain how the Fusion Metadata Registry (FMR) supports these queries. Finally, we'll introduce you to two programming languages that allow you to retrieve structural metadata and automate.
When it comes to structure queries, the SDMX API allows the following:
Select each item below to discover more.
Let's look at a few examples of structure queries. The image below illustrates the components of the structure query URL, emphasising how to identify the resource to be returned.
Select the image to enlarge.
The image below shows the parts of the structure query URL that allow you to filter or provide additional information about the results.
Select the image to enlarge.
FMR is primarily concerned with structural metadata and therefore supports structure queries but does not support data queries. The FMR implements a subset of the SDMX RESTful API specification, as illustrated here.
Select the table to enlarge.
The FMR API provides additional functions that are necessary for a practical registry implementation, but not explicitly provided for in SDMX standard REST specification.
The table below provides more details regarding FMR API function and purpose.
Select the table to enlarge.
Please see the References section at the end of this module for more information.
An easy way to become familiar with retrieving structural metadata and the various options available is to try various parameters using the UI in publicly available registries like SDMX Global Registry and SDMX.IO Sandbox Registry.
On the next couple of screens, we'll cover two programming languages that allow you to retrieve structural metadata and automate.
Automate using CURL, a command-line tool in Windows, MacOS, and Linux:
curl -X GET "copy-paste-QUERY-URL-from-registry"
Automate using PYTHON. The "requests" library works very well.
import requests
response = requests.get("copy-paste-QUERY-URL-from-registry")
print (response.text)
Now, let's take a look at a few examples of structure queries in action presented in this short video.
Select Play to begin.
To access the code presented in this video, click here.
Let's complete one final question before concluding. Which of the following statements are true?
Select all that apply and then select Submit.
All statements are correct except statement 3. FMR is primarily concerned with structural metadata and therefore supports structure queries but does not support data queries.
The correct answers are options 1, 2 and 4.
All statements are correct except statement 3. FMR is primarily concerned with structural metadata and therefore supports structure queries but does not support data queries.
The correct answers are options 1, 2 and 4.
All statements are correct except statement 3. FMR is primarily concerned with structural metadata and therefore supports structure queries but does not support data queries.
The queries below are included for completeness, but they are out of scope for this introductory course.
Note: host = = entryURL
Data validity:
https://host/schema/context/agency/id/version?dimensionAtObservation
&explicitMeasure
Data availability:
https://host/availability/context/agency/id/version/key/componentId?c
&updatedAfter
&references
&mode
Metadata:
https://host/metadata/metadataset/provider/id/version?detail
https://host/metadata/metadataflow/agency/id/version/provider?detail
https://host/metadata/structure/type/agency/id/version/provider?detail
Need help finding something? I am an AI Assistant that's here to help!
What are you looking for?
By using this AI-powered service ("Service"), you acknowledge and agree to the following:
This Service uses generative AI to assist with statistical analysis and research. While the Service strives to deliver useful information, the output ("Output") may contain inaccuracies, omissions, or biases. The Output is provided for informational purposes only and should not be considered professional advice. You remain responsible for how you interpret and use the Output.
The BIS makes no warranties regarding the accuracy or completeness of the Output and accepts no liability for any loss or damage resulting from its use.
Do not include or share personal, private, confidential or proprietary information when using the Service.
By using this technology, you agree to the Terms and Conditions.
Ask and get clear explanations about SDMX standards.
Find tools and documentation on website quickly.
Ask about API, software and libraries supporting SDMX.
Locate technical guides, specifications, and FAQs.