Main Content

Read Last Entry Age

Read number of seconds since last entry in channel with HTTP GET

Request

HTTP Method

GET

URL

https://api.thingspeak.com/channels/<channel_id>/feeds/last_data_age.<format>

URL Parameters

NameDescription

<channel_id>

(Required) Channel ID for the channel of interest.

<format>

(Required) Format for the HTTP response, specified as json, xml, csv, or txt.

Example URL: https://api.thingspeak.com/channels/266256/feeds/last_data_age.json

Query String Parameters

There are no available parameters for this request.

Response

Success

HTTP Status Code

200 OK

Body
GET https://api.thingspeak.com/channels/12397/feeds/last_data_age.json

The response is a JSON object with the age of the most recent value,in seconds:

{
    "last_data_age": "174",
    "last_data_age_units": "s"
}
GET https://api.thingspeak.com/channels/12397/feeds/last_data_age.xml

The response is an XML object with the age of the most recent feed, in seconds:

<?xml version="1.0"?>
<feed>
  <last_data_age type="integer">174</last_data_age>
  <last_data_age_units type="string">s</last_data_age_units>
</feed>
GET https://api.thingspeak.com/channels/12397/feeds/last_data_age.csv

The response is a CSV object with the age of the most recent feed, in seconds:

created_at,entry_id,field1,field2
2017-10-10 20:49:15 UTC,13031235,428,65.138004246284495
2017-10-10 20:49:28 UTC,13031236,442,66.496815286624198
GET https://api.thingspeak.com/channels/12397/feeds/last_data_age.txt

The response is the age of the most recent value, in seconds:

174

Error

For the full list, see Error Codes.

If you do not have access to the channel, the response is -1.