Finer grained retrieval of most recent data than integer "days" | ThingSpeak API | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Finer grained retrieval of most recent data than integer "days"
No permission to create posts
March 31, 2017
8:13 am
Avatar
rvnash
New Member
Members
Forum Posts: 4
Member Since:
October 5, 2016
sp_UserOfflineSmall Offline

I would like to use the API on Channels and Channel Fields to request the most recent N minutes or seconds of data. However, the API only allows integer days. Is there a reason for this restriction. Can a future update include "minutes=N" or "seconds=N"?

Thanks!

March 31, 2017
3:26 pm
Avatar
piajola

Gold
Members
Forum Posts: 87
Member Since:
October 12, 2015
sp_UserOfflineSmall Offline

Hello rvnash,

You can click this link

thingspeak.com/channels/9/charts/1?bgcolor=a2a2a2&color=444444&dynamic=false&type=spline&width=auto&height=auto&round=2&start=2017-03-31 00:00:00&end=2017-03-31 00:01:00&offset=-05.00

it is channel 9 field 1 chart for today since midnight for a lapse of 1 minute showing some points about each 15 seconds, checked in Chrome-W10 but I believe any modern browser will do.

In a plug-in the javascript code to pick the needed points is something like this

$.getJSON('https://api.thingspeak.com/channels/' + channel_id + '/fields/' + field_number + '.json?offset=0&round=2&results=' + results + '&api_key=' + api_key, function( .... etc, etc

Hope this very little information is of some help Smile

September 6, 2017
12:22 am
Avatar
zoey7
New Member
Members
Forum Posts: 2
Member Since:
September 6, 2017
sp_UserOfflineSmall Offline

Thank you, piajola. It does help me a lot!

This is also useful: javascript obfuscator

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

harriettlf60, ShaToow, Aleftinfenny, DiaBentee, hugo11dom@gmail.com, Pisaruk530

Administrators: Hans: 387, lee: 457