Determine number of records availble in a ThingSpeak channel

5 views (last 30 days)
Using the REST API, I would like to be able to query for the number of records of data stored in a ThingSpeak channel before reading that data.
Is there a way to do this?
  2 Comments
DL KA
DL KA on 30 Nov 2020
I need to make decisions based on the number of records available before I read the quantity of records I need to operate on.

Sign in to comment.

Answers (1)

Vinod
Vinod on 3 Dec 2020
Edited: Vinod on 3 Dec 2020
I'd recommend the best solution is to retrieve data based on date range. Again, keep in mind the response will contain at most 8000 points. So, you will want to pick your date range based on how frequently your channel is updated. See more details here.
  3 Comments
Christopher Stapels
Christopher Stapels on 11 Dec 2020
You could also update the channel and look at the response. ThingSpeak returns the number of records in the channel However, after you update the channel to see if there is anything in it, you would have to clear it again or it would look like there are records in the channel. :)

Sign in to comment.

Communities

More Answers in the  ThingSpeak Community

Categories

Find more on Configure Accounts and Channels in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!