how do I extract data from a single field at 12 hour intervals without hitting the 8000 datapoint limit?
5 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to extract readings from a single field on a feed at 12 hour intervals in csv fromat using a restful api GET method.
If i use the following call: http://api.thingspeak.com/channels/XXXXX9/fields/4.csv?start=2017-01-01%2000:00&end=2018-01-01%2023:59&median=daily the returned file has a years worth of entries with one reading for each day.
I had expected that if I used: http://api.thingspeak.com/channels/XXXXX9/fields/4.csv?start=2017-01-01%2000:00&end=2018-01-01%2023:59&median=720 that I would get a years worth of entries with 2 readings for each day but what I actually get is about a weeks worth of entries with 2 readings per day.
I guess that a weeks worth of entries at one minute intervals corresponds to about 8000 data points which is the download limit. The "daily" parameter seems to overcome this restriction but I would like to know if there is a way to overcome the restriction using some kind of half day or quarter day interval.
Thanks in anticipation.
0 件のコメント
回答 (1 件)
Vinod
2018 年 9 月 11 日
編集済み: Vinod
2018 年 9 月 11 日
Allan,
Can you describe your use case and application in further detail? How will this data that is older than the most recent 8000 points be used? Do the recent points not matter?
Note that when you do a median=daily, it is not the raw data but some downsampled data that you are getting. Is that sufficient for your application?
Depending on your application I can provide some useful ways to analyze the data.
-Vinod
3 件のコメント
Vinod
2018 年 9 月 11 日
編集済み: Vinod
2018 年 9 月 11 日
Sounds like a reasonable request.
Is this being done "live" or for an offline analysis that is done on demand? If it is offline analysis, could exporting the entire CSV data from the Data Import/Export tab meet your needs?
For online analysis, you could do something like
https://api.thingspeak.com/channels/_CHANNEL_ID_/fields/1.csv?api_key=_YOUR_API_KEY_&start=2017-01-20&results=8000
This will get you 8000 points from the start time. Then pick the last entry in it, look at its timestamp and determine if you need to request more data (if so, it would be the last time entry in the previous response), etc.
Another option is
https://api.thingspeak.com/channels/_CHANNEL_ID_/fields/1.csv?api_key=_YOUR_API_KEY_&start=2017-01-20&end=2017-01-21
This should give you data within the date range (assuming it is less than 8000 points in the range.)
Finally, what language are you using to do this analysis?
コミュニティ
その他の回答 ThingSpeak コミュニティ
参考
カテゴリ
Help Center および File Exchange で Read Data from Channel についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!