API rate limiting
To protect the OECD Data Explorer API network, help manage traffic and ensure a responsive experience for all users, API rate limiting was introduced in November 2024.
Users are restricted to a maximum of 20 queries per minute and 20 data download per hour. Exceeding this limit will result in a temporary block. Traffic from VPNs or anonymised sources is not allowed.
API best practices
Find here suggestions for optimising your API queries, particularly if you frequently fetch the same data. Please note that, with few exceptions for high frequency economic data, most OECD datasets are updated only once or twice a year, meaning the API responses remain relatively static over time.
1. Use the contentconstraint query
- This query provides a ValidFrom timestamp, indicating the last update time, and an Annotation with the total observation count.
- It also ensures you receive the latest version of the dataset, allowing you to verify if the dataset version has changed.
Example: https://sdmx.oecd.org/public/rest/contentconstraint/OECD.ELS.SPD/CR_A_DSD_SOCX_AGG@DF_SOCX_AGG/
https://sdmx.oecd.org/public/rest/ + contentconstraint/ + AGENCY_ID + CR_A_ + DATASET_ID
2. Consider the use of the UpdatedAfter parameter
- This parameter allows you to retrieve only the observations that have been inserted/updated or deleted since a specified point in time (the ACTION column returns values D=Deleted, R=Replaced)
- The point in time value can be expressed in dateTime format, including the client’s time zone (e.g., 2015-12-31T23:59:59.9999-01:00).
- Using this parameter is highly recommended, as it reduces the volume of data transferred and improves efficiency for frequent database synchronizations.
- When using UpdatedAfter prefer the CSV format (other formats may not deliver the attributes attached at higher than timeseries levels) by adding the following http-header to your call:
Accept = application/vnd.sdmx.data+csv;version=2.0
Example: https://sdmx.oecd.org/public/rest/data/OECD.SDD.TPS,DSD_ALFS@DF_SUMTAB/?dimensionAtObservation=AllDimensions&UpdatedAfter=2024-11-15
3. Cache your results locally
- If you or multiple users within the same organisation frequently fetch the same data, store results locally in a database or file.
- This avoids redundant requests, reduces server load, and prevents you from hitting API usage limits.
4. Optimize query sizes
- Run larger, consolidated queries whenever possible, rather than multiple smaller ones.
- For very large datasets (e.g., those with over 10 million records), consider breaking the queries into smaller slices for better manageability.
Thank you for following these best practices to ensure efficient and reliable use of the API.