Main Content

Read Status

Read status field of channel with HTTP GET

Request

HTTP Method

GET

URL

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

URL Parameters

NameDescription

<channel_id>

(Required) Channel ID for the channel of interest.

<format>

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

Example: https://api.thingspeak.com/channels/266256/status.json

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.

string

results

(Optional) Number of entries to retrieve, 8000 max.

integer

days

(Optional) Number of 24-hour periods before now to include in response. The default is 1.

integer

timezone

(Optional) Identifier from Time Zones Reference for this request.

string

offset

(Optional) Timezone offset that results are displayed in. Use the timezone parameter for greater accuracy.

integer

Tip

The results parameter determines the maximum number of entries to be retrieved for a query, up to 8000. The default time span is limited to 1 day (24 hours). To get results from more than 1 day and limit the entries, use both the results and days parameters together.

Response

Success

HTTP Status Code

200 OK

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

Body

 JSON Example

 XML Example

 CSV Example

Error

For the full list, see Error Codes.

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

Examples

You can use your web browser to complete GET HTTP requests to the RESTful API for ThingSpeak™. To see the format for an HTTP response, click the link or copy it to your browser.

Read Three Status Results in JSON Format

Channel 276330 stores soil moisture information for an office plant. You can read data from this public channel. The format for the response occurs at the end of the URL, before any query string parameters. This example returns the last status entry from channel 276330 in JSON format. Append the first parameter after a question mark ?. You can use the results parameter to control the number of entries returned, up to 8000.

https://api.thingspeak.com/channels/276330/status.json?results=3

Read Four Status Results in XML Format

In this example, the format is specified as XML. The results parameter is used to return a set number of entries, in this case four. The first parameter is appended after a question mark ?.

https://api.thingspeak.com/channels/276330/status.xml?results=4

Read Five Status Results From a Private Channel in CSV Format

When you request the output in csv format, the file returned is a comma-separated variable format. Depending on your computer configuration, your browser can open additional software to display this format. To read data from a private channel, supply the Read API Key after the parameter api_key. Append the first parameter after a question mark ?. Use an ampersand & to append the second parameter. In this case, the results parameter is used to return five results.

https://api.thingspeak.com/channels/276330/status.csv?api_key=E52AWRAV1RSXQQJW&results=5