Read last value AND time/date from thingspeak | Arduino | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.

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
Read last value AND time/date from thingspeak
No permission to create posts
May 6, 2016
11:10 am

Forum Posts: 10
Member Since:
August 28, 2015
sp_UserOfflineSmall Offline


I'm trying to read the last value AND the date/time from a private channel to my Arduino. I can easily get the last value using the "official thingspeak library for arduino" and the "ReadPrivateChannel"-example. But what about the timestamp (date/time) for that last value? It's not a part of the Thingspeak library I think..

I can access the last value and the timestamp by a get request and get a return in JSON format (this is my privat channel...):


How do I make my Arduino to "read" this url? I been trying to make a GET request but without any success... =(




May 8, 2016
9:15 pm

Forum Posts: 279
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

Maybe you have to use readRaw() and parse the string yourself?


* @brief Read a raw response from a public ThingSpeak channel
* @param channelNumber Channel number
* @param URLSuffix Raw URL to write to ThingSpeak as a String. See the documentation at
* @return Response if successful, or empty string. Use getLastReadStatus() to get more specific information.
* @remark This is low level functionality that will not be required by most users.
* @code
void loop() {
String response = ThingSpeak.readRaw(myChannelNumber, String("feeds/days=1"));
Serial.print("Response: ");
* @endcode
May 9, 2016
10:20 am

Forum Posts: 10
Member Since:
August 28, 2015
sp_UserOfflineSmall Offline


Well, I managed to get the "age" (in seconds) of the most recent entry by adding the following code:

String response = ThingSpeak.readRaw(myChannelNumber, String(String("/fields/") + String(1) + String("/last_data_age")), myReadAPIKey);
Serial.print("Response: ");


So, I get the age in seconds although then I have to convert it into a date and time. Hmm, I would be more convinient if I just could get the time/date at once..

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

kusmumichael, petersmith99, Rambant, blakeharriss09, optisol, Niyonzima Fils

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457