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.

Read Data

Read data from all fields in a channel with HTTP GET


HTTP Method



URL Parameters



(Required) Channel ID for the channel of interest.


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


Query String Parameters


(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.



(Optional) Number of entries to retrieve. The maximum number is 8,000.



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


minutes(Optional) Number of 60-second periods before now to include in response. The default is 1440.



(Optional) Start date in format YYYY-MM-DD%20HH:NN:SS.



(Optional) End date in format YYYY-MM-DD%20HH:NN:SS.



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



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



(Optional) Include status updates in feed by setting "status=true".



(Optional) Include metadata for a channel by setting "metadata=true".



(Optional) Include latitude, longitude, and elevation in feed by setting "location=true".



(Optional) Minimum value to include in response.


max(Optional) Maximum value to include in response.



(Optional) Round to this many decimal places.



(Optional) Get first value in this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily".

<integer> or <string>


(Optional) Get sum of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily".

<integer> or <string>


(Optional) Get average of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily".

<integer> or <string>


(Optional) Get median of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily".

<integer> or <string>

callback(Optional) Function name to be used for JSONP cross-domain requests.<string>


The results parameter has the highest precedence. Using results with the parameters min, max, timescale, sum, average, or median can cause less than 8000 records to be returned. The results parameter determines the maximum number of entries to be used for a query, up to 8000. For example, consider a channel with one update per minute. A read request to that channel with the parameters ?results=120&sum=60 returns only two records, and not 120. See the example Read Two Hours of Entries in JSON Format and Average.


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 Entries in JSON Format

Channel 9 contains information from several home environment sensors. 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. 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.

Read Four Entries 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 ?.

Read Five Entries from a Private Channel in JSON Format

To read data from a private channel, supply the Read API Key with the parameter api_key. Append the first parameter after a question mark ?. Append the second parameter after an ampersand &. In this case, results is used to request five results.

Read a Date Range of Events 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 start additional software to display this format. In this example, the start and end parameters are used to specify date limits for the requested data.



HTTP Status Code

200 OK


 JSON Example

 XML Example

 CSV Example


For the full list, see Error Codes.

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