https://industrial.api.ubidots.com/api/v1.6/devices/{DEVICE_LABEL}/{VARIABLE_LABEL}/values
curl -X GET "https://industrial.api.ubidots.com/api/v1.6/devices/my-device/my-variable/values/?page_size=2"
-H "X-Auth-Token: BBFF-Rfcgaxns6HlVb155WA0RhSY85xNDmB" 
-H "Content-Type: application/json"

Request

GET /api/v1.6/devices/{DEVICE_LABEL}/{VARIABLE_LABEL}/values HTTP/1.1<CR><LN>
Host: {Endpoint}<CR><LN>
User-Agent: {USER_AGENT}<CR><LN>
X-Auth-Token: {TOKEN}<CR><LN>
Content-Type: application/json<CR><LN><CR><LN>

Response

HTTP/1.1 200 OK<CR><LN>
Server: nginx<CR><LN>
Date: Tue, 04 Sep 2018 22:35:06 GMT<CR><LN>
Content-Type: application/json<CR><LN>
Transfer-Encoding: chunked<CR><LN>
Vary: Cookie<CR><LN>
Allow: GET, POST, HEAD, OPTIONS<CR><LN><CR><LN>
{PAYLOAD_LENGTH_IN_HEXADECIMAL}<CR><LN>
{"count": true, "previous": null, "results": [{PAYLOAD_WITH_VALUES}], "next": {URL_WITH_ADDITIONAL_VALUES}}<CR><LN>
0<CR><LN>

In the path specified above, replace the {DEVICE_LABEL} and {VARIABLE_LABEL} keys with the unique labels of the Ubidots device and variable you wish to retrieve data from. By default, this path returns your variable’s last 50 stored values. You can manage the number of dots to retrieve using the page_size parameter in your path:

/api/v1.6/devices/{DEVICE_LABEL}/{VARIABLE_LABEL}/values/?page_size=2

The path above retrieves the last 2 dots of your variable.

Ubidots API also allows you to filter the values to be retrieved by date range, number of dots, and more. To learn more about this kind of request, check out the Ubidots Software REST API Guide.