---
updatedAt: 2025-04-21T20:50:40.000Z
agentTools:
  projectIndex: https://docs.ubidots.com/llms.txt
---

# Get all Variables

This endpoint retrieves all Variables.

## Request

To retrieve all Variables please make a GET request to the following URL:

| HTTP Method | URL                                                      |
| :---------- | :------------------------------------------------------- |
| GET         | `https://industrial.api.ubidots.com/api/v2.0/variables/` |

To retrieve all Variables of a Device please make a GET request to the following URL:

| HTTP Method | URL                                                                           |
| :---------- | :---------------------------------------------------------------------------- |
| GET         | `https://industrial.api.ubidots.com/api/v2.0/devices/<device_key>/variables/` |

> 📘 lastActivity only for Get All Variables by Device Endpoint
>
> Please note: The query parameter lastActivity is only available for the endpoint\
> `Get All Variables by Device`\
> `https://industrial.api.ubidots.com/api/v2.0/devices/<device_key>/variables/`

## Header

| Parameter    | Required? | Description                                                  |
| :----------- | :-------- | :----------------------------------------------------------- |
| X-Auth-Token | Yes       | [Authentication Token](/reference/authentication) of account |

```curl cURL (Request)
$ curl -X GET 'https://industrial.api.ubidots.com/api/v2.0/variables/' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
```

```json 200 OK
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "createdAt": "2019-12-18T14:38:38.354415Z",
            "syntheticExpression": "",
            "description": "",
            "device": {
                "id": "6e309da44fc8455a9cceb5aa",
                "label": "first-device",
                "name": "First Device",
                "url": "http://industrial.ubidots.com/api/v2.0/devices/6e309da44fc8455a9cceb5aa"
            },
            "icon": "",
            "id": "781b33e657aa5dfa39e69391",
            "label": "first-variable",
            "lastActivity": null,
            "lastValue": {},
            "name": "First Variable",
            "properties": {
              	"any": "thing"
            },
            "tags": [],
            "type": "raw",
            "unit": null,
            "url": "http://industrial.ubidots.com/api/v2.0/variables/781b33e657aa5dfa39e69391",
            "valuesUrl": "http://industrial.ubidots.com/api/v1.6/variables/781b33e657aa5dfa39e69391/values"
        }
    ]
}
```
```json 400 Bad Request
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
```
```json 401 Unauthorized
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}
```

## Response

An object with an array `results` containing all Variables.