Difference between revisions of "Data Availability Web Service"
(→Retrieve valid code selections based on the current query) |
|||
Line 2: | Line 2: | ||
=Overview= | =Overview= | ||
− | The Data Availability API is the | + | The Data Availability API is used to determine what Dimension values exist for specific Dataflows, and can take into account the state of current filters applied to the data query. This is very useful in supporting the user case of a data query builder which prevents a user from selecting a combination of Dimension filters which result in no data being returned. |
− | The API | + | The API specification was updated in SDMX v3.0.0 to align with other changes made to the data query. This page documents the [https://github.com/sdmx-twg/sdmx-rest/blob/v1.5.0/v2_1/ws/rest/docs/4_6_1_other_queries.md v1 specification] and [https://github.com/sdmx-twg/sdmx-rest/blob/master/doc/availability.md v2 specification of the API]. |
− | = | + | =Example API Version 2.0.0= |
+ | |||
+ | |||
+ | =Example API Version 1.5.0= | ||
====Availability of EUR exchange rate data for Danish Krone (from ECB EXR)==== | ====Availability of EUR exchange rate data for Danish Krone (from ECB EXR)==== | ||
Revision as of 06:26, 16 February 2022
Contents
Overview
The Data Availability API is used to determine what Dimension values exist for specific Dataflows, and can take into account the state of current filters applied to the data query. This is very useful in supporting the user case of a data query builder which prevents a user from selecting a combination of Dimension filters which result in no data being returned.
The API specification was updated in SDMX v3.0.0 to align with other changes made to the data query. This page documents the v1 specification and v2 specification of the API.
Example API Version 2.0.0
Example API Version 1.5.0
Availability of EUR exchange rate data for Danish Krone (from ECB EXR)
The response is a content constraint which describes the values for each dimension that have data, given that CURRENCY is fixed to DKK in the query. In particular it shows there are series for frequencies A, Q, D, H and M. There’s also a ‘series_count’ annotation which tells us the query would return 8 series if run.
Retrieve valid code selections based on the current query
By switching from mode=exact to mode=available the response changes, it no longer shows what data will come back from the query - it shows what code options remain valid for all the Dimensions of the DSD. A valid choice is one which will result in data being returned, in the context of the current query. This is useful to prevent a user from building a data query which results in 'no data' due to an invalid combination of dimension selections.
Availability of EUR exchange rate data for the Egyptian Pound (ECB EXR again)
The same query as above, but this time querying for EUR vs EGP exchange rates. Here only series with frequencies A, Q and M are available. And the ‘series_count’ annotation tells us we would get 3 series.