Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Write Data to Channel

Use the REST and MQTT APIs to update channels with software or devices

ThingSpeak™ is an IoT platform that uses channels to store data sent from apps or devices. You can write data to your ThingSpeak channels in several ways: HTTP calls from the REST API, MQTT Publish method, and the thingSpeakWrite function from MATLAB. Learn more about how to Choose Between REST API and MQTT API to update a channel.

expand all

Write DataUpdate channel data with HTTP GET or POST
Bulk Write JSON DataWrite many entries to a channel in JSON format with a single HTTP POST
Bulk Write CSV DataWrite many entries to a channel in CSV format with a single HTTP POST.
Publish to a Channel FeedPublish message to update multiple channel fields simultaneously
Publish to a Channel Field FeedPublish message to update single channel field
thingSpeakWriteWrite data to ThingSpeak channel

Topics

Ways to Collect Data into a Channel

Collect data in your channel with hardware or software on devices or computers using the REST API, MQTT, or MATLAB®.

Choose Between REST API and MQTT API

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

Prototyping with Sonar Proximity Sensor

Use ThingSpeak to prototype Arduino® based development.

Moisture Sensor with HTTP POST to Channel

Wake from deep sleep to post to ThingSpeak using a wireless client library and the POST HTTP command.

Publish to a Channel Using Arduino Client

Publish data to a ThingSpeak channel using an Arduino device.

Publish to a Channel Using Desktop MQTT Client

Publish to a channel using desktop MQTT client such as MQTT.fx.

Bulk-Update a ThingSpeak Channel Using a Raspberry Pi Board

Collect CPU temperature and utilization data in JSON format every 15 seconds, and update the channel once every two minutes using Raspberry Pi™ board running Python® 2.7.

Bulk-Update a ThingSpeak Channel Using a Particle Photon Board

Collect data in CSV format every 15 seconds, and update channel once every two minutes using absolute timestamps.

Bulk-Update a ThingSpeak Channel Using an Arduino or an ESP8266

Collect Wi-Fi® signal strength in JSON format every 15 seconds, and update channel once every two minutes using relative timestamps.

Related Information

Troubleshooting

Error Codes

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

Troubleshoot MQTT Publish

Get help to resolve common mistakes when using MQTT publish.