Can I change the frequency of the data that I download using the API?
Note that each data feed on Nasdaq Data Link is delivered through one of the following Nasdaq data Link APIs:
- Streaming API for real-time data
- REST API for real-time or delayed data
- REST API for time-series
- REST API for tables
You can learn more about these APIs, data formats and authentication here.
For the Streaming API for real-time data, the frequency of the data cannot be changed.
For the REST API for real-time or delayed data, there is a parameter called "offset" which can be changed to "realtime" or "delayed". For more information on how to use this offset, please see the information on POST and GET endpoints here.
For the REST API for time-series or tables, please see below:
To change the sample frequency of a time-series, please use the collapse= parameter, like so:
The above call takes the XNAS/ACIW time-series which shows daily data, and converts it to monthly.
Collapse can be "daily","weekly", "monthly", "quarterly" or "annual".
Note that the conversion process is very simple:
Nasdaq Data Link simply takes the last observation in the day/month/week/quarter/year and uses that as the daily/monthly/weekly/quarterly/annual datum.
This simple conversion process does not work well for time-series that contain percentage changes, period averages/totals (e.g., trading volume) or period extremes (e.g., high/low or OHLC for security prices). For such time-series, we recommend downloading the raw data and carrying out the required frequency transformation using your own analytics tool.
Note also that you can only convert a time-series to a less granular frequency (e.g., daily to monthly) and never the other way around to a more granular frequency (e.g., annual to daily).
There is no collapse parameter for data in tables format. For tables, we recommend downloading the raw data and carrying out the required frequency transformation using your own analytics tool.