How to get a variable values via Rest API


I would like to know how I can get the data contained in a variable to use it in an external web application, using the Ubidots API.

I found out how to send the data by email but not how to get this data directly in response to a REST API request, in JSON object for example?


R u looking something like this? Not sure it helps.

Thank you Ali,

I finally found the URL I was looking for to load the data from Ubidots

        variable = make_web_request("GET",
                                    format(device_id, variable),

        variable_values = make_web_request("GET",
                                           variable.json()["valuesUrl"] + "?start=" + str(start_date*1000) + "&page_size=150000",

Here, the parameters of the “format” function mean: ‘device_id’ is the ID of the device the variable belongs to and ‘variable’ is the label of the variable I want to load data from

Hi @bertrandgauvreau,

I hope all is well.

The device id is a unique identifier that is used to send data, you can find it on the device vies below the API label.

All the best,

1 Like