Main Content

Read Last Entry ID

Read entry ID number for last entry with HTTP GET

Request

HTTP Method

GET

URL

https://api.thingspeak.com/channels/CHANNEL_ID/last_entry_id.FORMAT

URL Parameters

NameDescription

CHANNEL_ID

(Required) The channel ID for the channels of interest.

.FORMAT

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

Query String Parameters

NameDescriptionValue Type
api_key

(Required for private channels). Specify Read API Key for this specific channel. The Read API key is found on the API Keys tab of the channel view.

user-API-string

Read Last Entry ID Provide Results in JSON Format

Read Last Entry ID and Provide Results in XML Format

Read Last Entry ID From a Private Channel and Provide Results in text Format

Response

Success

HTTP Status Code

200 OK

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

Body

JSON ExampleXML ExampleCSV Example (same result for .TXT)
GET https://api.thingspeak.com/channels/9/last_entry_id.json?results=2
or
GET https://api.thingspeak.com/channels/9/last_entry_id.xml?results=2 
GET https://api.thingspeak.com/channels/9/last_entry_id.csv?results=2

The response is a JSON object of the channel feed, for example:

13556556

The response is a XML object of the channel feed, for example:

<xml class="last_entry_id">13556555</xml>

The response is a CSV object of the channel feed, for example:

13556548

Error

For the full list, see Error Codes.

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