I'm trying to execute the following SDMX query using Python from the OECD's database.
https://stats.oecd.org/restsdmx/sdmx.ashx/GetData/LAND_COVER_FUA/AUS+AUT.FOREST+GRSL+WETL+SHRUBL+SPARSE_VEGETATION+CROPL+URBAN+BARE+WATER.THOUSAND_SQKM+PCNT/all?startTime=1992&endTime=2019
I've looked around but can't get this to work with the existing packages and tutorials out there (I've looked at this link for example).
Would you be able to help? I can't seem to get the various libraries (pandasdmx, cif, etc.) to work with it.
Thanks so much in advance!
Using
sdmx1:This gives output like:
A few key points to understand:
The URL you give (with
/GetData/) indicates an SDMX 2.0 API. These are very old and few tools support them.OECD provides both an SDMX-ML 2.1 and an SDMX-JSON API.
LAND_COVER_FUA) does not appear to be available from the "OECD" (SDMX-ML) source, only from the "OECD_JSON" one.Parameters like "startTime=1992" are outdated/incorrect; the current form for SDMX 2.1 and later is "startPeriod=1992".
Your key only has 3 parts, but this data flow has 4 dimensions. If you uncomment the first line above that sets
key_strexplicitly, the web service responds:If we randomly guess and put an extra period at the end (second commented
key_str), we get the error:This indicates that (a) the missing dimension is the second one and (b) it has an id "FUA". So we insert this in
key. Notice that the resulting, valid key string contains+AUT..FOREST+. These two consecutive periods (..) indicate "No specific labels/return all labels for this dimension."