Retrieve the the stored value from a field from an hour ago. | 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
Retrieve the the stored value from a field from an hour ago.
No permission to create posts
August 23, 2017
10:47 am
Avatar
viiartz

Silver
Members
Forum Posts: 9
Member Since:
July 5, 2016
sp_UserOfflineSmall Offline

Hi, I know how to retrieve the last stored value, but how would I go about retrieving a value from an hour ago?

August 23, 2017
1:40 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 210
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

For a REST API call, from a device for example, use the start and end parameters in you rest call. The process to get a channel feed field  is shown in the doc here.  The call is a GET and looks like this

https://api.thingspeak.com/channels/1417/fields/1.json?end=2017-08-22%2013:12:12&start=2017-08-22%2012:12:12

 

The format is 

start (datetime) Start date in format YYYY-MM-DD%20HH:NN:SS (optional)

end (datetime) End date in format YYYY-MM-DD%20HH:NN:SS (optional)

You should also append your api_key if it is a private channel &api_key=xxxxxxxxxxxxxxxx.


The example for map path visualization that shows you how to do it in MATLAB, using the thingSpeakRead() function.

data = thingSpeakRead(73734,'DateRange',... [datetime('today')-caldays(10),datetime('today')],'outputFormat','table');
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