Read status field of a channel with HTTP GET
GET
https://api.thingspeak.com/channels/
<channel_id>
/status.<format>
Name | Description |
---|---|
| (Required) Channel ID for the channel of interest. |
| (Optional) Format for the HTTP response, specified as
|
Example:
https://api.thingspeak.com/channels/266256/status.json
Name | Description | Value 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 (optional). | 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 |
200 OK
If you do not have access to the channel, the response is -1.
For the full list, see Error Codes.
If you do not have access to the channel, the response is -1.
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.
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, which is up to 8000.
https://api.thingspeak.com/channels/276330/status.json?results=3
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
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