Read Data from Channel

Use the REST and MQTT APIs to read channels using software or devices

ThingSpeak™ is an IoT platform that uses channels to store data sent from apps or devices. You can read data from your ThingSpeak channels using the HTTP calls and the REST API. You can use the MQTT subscribe method to receive messages whenever the channel is updated. And you can use thingSpeakRead to read data from your channel in desktop MATLAB. Learn more about when to Choose Between REST API and MQTT API to update a channel.

REST API

expand all

Read DataRead data from all fields in a channel with HTTP GET
Read FieldRead data from a single field of a channel with HTTP GET
Read StatusRead status field of a channel with HTTP GET
Read Last EntryRead the last entry in a channel with HTTP GET
Read Last Field EntryRead the last entry in a field of a channel with HTTP GET
Read Last StatusRead the last status of a channel with HTTP GET
Read Last Entry AgeRead the number of seconds since the last entry in a channel with HTTP GET
Read Last Field Entry AgeRead the number of seconds since the last entry in a field with HTTP GET

MQTT API

expand all

Subscribe to a Channel FeedSubscribe to updates from a channel feed with MQTT
Subscribe to a Channel Field FeedSubscribe to channel updates from a particular field of a channel with MQTT

Functions

expand all

thingSpeakReadRead data stored in a ThingSpeak channel

Topics

Choose How to Read Data

Choose Between REST API and MQTT API

Learn when to use REST and MQTT to update a channel.

Subscribe to Channel Updates Using Desktop MQTT Client

This example shows how to use a desktop MQTT client to subscribe to a channel.

Read Data with Arduino or Particle Photon

Prototyping with Sonar Proximity Sensor

This example shows how to prototype with ThingSpeak™ using a Wi-Fi connected Arduino® board.

Read Data with ESP8266

Post Temperature Data and Read from Channel

This example shows how to collect environmental data from a device and post it from your device to a ThingSpeak™ channel.

Moisture Sensor using HTTP POST Requests to Channel

This example shows how to post multiple fields of data to a ThingSpeak™ channel from a device that wakes from deep sleep.

Bulk-Update Using an Arduino or an ESP8266

This example shows how to use either an Arduino® MKR1000 board or an ESP8266 board connected to a Wi-Fi® network to continuously collect Wi-Fi signal strength and bulk-update a ThingSpeak™ channel.

Read Data with ESP32

Wireless Network Signal Strength with ESP32 with Arduino IDE

This example shows how to use the wireless network functionality of ESP32 to post data to ThingSpeak™.

Troubleshooting

Error Codes

See the details of ThingSpeak REST API error messages and corresponding HTTP status codes.

Troubleshoot MQTT Subscribe

Common mistakes and problem resolution for subscribing to ThingSpeak

Featured Examples