> For the complete documentation index, see [llms.txt](https://docs.luganodes.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luganodes.com/tron-energy/energy-rental-api/check-an-address.md).

# Check an address

GET /v1/accounts/{address}: activation, free bandwidth and energy of an address.

Use this endpoint before you create a rental to confirm the address is activated, or to see whether it already has a `pending` or `active` rental.

## At a glance

| Item            | Detail                                                                                                                                    |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Method and path | `GET /v1/accounts/{address}`                                                                                                              |
| Authentication  | Signed request. See [Authentication and signing](https://docs.luganodes.com/tron-energy/energy-rental-api/making-requests.md)             |
| Retry-safe      | Yes. The request only reads data                                                                                                          |
| Rate limit      | Per API key. See [Conventions and limits](https://docs.luganodes.com/tron-energy/energy-rental-api/conventions-and-limits.md#rate-limits) |

## Path parameters

| Name      | Type   | Required | Default | Description                                   |
| --------- | ------ | -------- | ------- | --------------------------------------------- |
| `address` | string | Yes      | None    | The TRON address to check, in Base58 (`T...`) |

## Sample request

Sample IDs, addresses and hashes are illustrative.

{% tabs %}
{% tab title="cURL" %}
{% code title="check-an-address.sh" %}

```bash
TIMESTAMP=$(date +%s)
REQUEST_PATH="/v1/accounts/TJdhGqPPUGMhLWxZdMU87f7muvoN14LPpg"
BODY=""
SIGNATURE=$(printf '%s\n%s\n%s\n%s' "GET" "$REQUEST_PATH" "$TIMESTAMP" "$BODY" | openssl dgst -sha256 -hmac "$API_SECRET" | sed 's/^.* //')
curl -X GET "$BASE_URL$REQUEST_PATH" \
  -H "X-API-Key: $API_KEY" \
  -H "X-Timestamp: $TIMESTAMP" \
  -H "X-Signature: $SIGNATURE"
```

{% endcode %}

The request is signed inline. It needs `BASE_URL`, `API_KEY` and `API_SECRET` in your environment.
{% endtab %}

{% tab title="Node.js" %}
{% code title="check-an-address.mjs" %}

```javascript
import { signedRequest } from "./tron_energy.mjs";

const address = "TJdhGqPPUGMhLWxZdMU87f7muvoN14LPpg";
const { status, data } = await signedRequest("GET", `/v1/accounts/${address}`);
console.log(status, data);
```

{% endcode %}

`signedRequest` is the helper from [Authentication and signing](https://docs.luganodes.com/tron-energy/energy-rental-api/making-requests.md), saved as `tron_energy.mjs`.
{% endtab %}

{% tab title="Python" %}
{% code title="check\_an\_address.py" %}

```python
from tron_energy import signed_request

address = "TJdhGqPPUGMhLWxZdMU87f7muvoN14LPpg"
status, data = signed_request("GET", f"/v1/accounts/{address}")
print(status, data)
```

{% endcode %}

`signed_request` is the helper from [Authentication and signing](https://docs.luganodes.com/tron-energy/energy-rental-api/making-requests.md), saved as `tron_energy.py`.
{% endtab %}
{% endtabs %}

## Responses

{% code title="200 OK" %}

```json
{
  "address": "TJdhGqPPUGMhLWxZdMU87f7muvoN14LPpg",
  "activated": true,
  "free_bandwidth_left": 600,
  "energy_available": 48,
  "active_rental_id": null
}
```

{% endcode %}

## Response fields

| Field                 | Type           | Description                                                                        |
| --------------------- | -------------- | ---------------------------------------------------------------------------------- |
| `address`             | string         | The address that was checked                                                       |
| `activated`           | boolean        | Whether the address is activated on chain                                          |
| `free_bandwidth_left` | integer        | Free bandwidth left today                                                          |
| `energy_available`    | integer        | Energy currently on the address                                                    |
| `active_rental_id`    | string or null | ID of your `pending` or `active` rental on this address. `null` when there is none |

## Errors

The full list is in [Errors](https://docs.luganodes.com/tron-energy/energy-rental-api/errors.md).

| HTTP | Code                  | When                                          | Action                                  | Retry?                   |
| ---- | --------------------- | --------------------------------------------- | --------------------------------------- | ------------------------ |
| 400  | `INVALID_ADDRESS`     | The address has an invalid format or checksum | Fix the address                         | No                       |
| 401  | `UNAUTHORIZED`        | Invalid API key, signature or timestamp       | Check your credentials and server clock | After a fix              |
| 429  | `RATE_LIMITED`        | Too many requests                             | Retry after `Retry-After`               | Yes, after `Retry-After` |
| 503  | `SERVICE_UNAVAILABLE` | Planned maintenance or an outage              | Retry after `Retry-After`               | Yes, after `Retry-After` |

## Related

* [Create a rental](https://docs.luganodes.com/tron-energy/energy-rental-api/create-a-rental.md): delegate energy to an activated address.
