Retrieve the the stored value from a field from an hour ago. | ThingSpeak API | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
Retrieve the the stored value from a field from an hour ago.
Avatar
viiartz

Silver
Forum Posts: 9
sp_UserOfflineSmall Offline
1
August 23, 2017 - 10:47 am
sp_Permalink sp_Print

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

Avatar
cstapels

Gold
Forum Posts: 83
sp_UserOfflineSmall Offline
2
August 23, 2017 - 1:40 pm
sp_Permalink sp_Print

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:
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 250

Vinod: 154

cstapels: 83

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

webone

KMVp

aamir786

sugengprayogi

vickysam@gmail.com

farmerkjs

Forum Stats:

Groups: 4

Forums: 17

Topics: 1289

Posts: 4481

 

Member Stats:

Guest Posters: 1

Members: 5652

Moderators: 0

Admins: 2

Administrators: Hans, lee