Setting a timescale only works for a timescale of 1440. No other timescale produces desired results.

Perky Whale on 19 Feb 2024
Latest activity Reply by Christopher Stapels on 20 Feb 2024

I have a channel updating every 10 minutes. The last 8000 entries therefore go back to late December (around 55 days). I want to extend the range of data downloaded by setting a timescale between results, so say if I request a timescale of 20 minutes should I not be able to get data from twice as long ago? e.g.
https://api.thingspeak.com/channels/xxxxxx/fields/1.json?api_key=XXXXXXXXXXX&timescale=20&start=2022-12-30%2022:00:00
No matter what timescale or averaging I use, the last 8000 entries are the only ones processed for the downloaded data, so I just get fewer results. Unless I use a timescale of 1440; then I can download results from the very first entry in 2022. A timescale of 720 or lower however will only go back 55 days.
So I see the desired result when I use a timescale of 1440, but no other timescale will work. Is this a bug?
Christopher Stapels
Christopher Stapels on 20 Feb 2024
In general, ThingSpeak does not guarantee that it will process more than 8000 data points read. Occasionally it may be possible to extend the range by playing with the parameters, but they aren’t sure to always work.
If you want to extend the range of a query, the recommended way tis to create a derived channel and use a time control to preprocess the data and store the chunks that you want to read in that channel. Alternatively, you can make multiple read requests in the same code, but you need to remember to put a pause in between to avoid slamming the server.