Finer grained retrieval of most recent data than integer "days" | 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
Finer grained retrieval of most recent data than integer "days"
Avatar
rvnash
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
1
March 31, 2017 - 8:13 am
sp_Permalink sp_Print

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!

Avatar
piajola

Gold
Forum Posts: 75
sp_UserOfflineSmall Offline
2
March 31, 2017 - 3:26 pm
sp_Permalink sp_Print

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

Avatar
zoey7
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
3
September 6, 2017 - 12:22 am
sp_Permalink sp_Print

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:
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