# Retrieve balance

This will show the number of credits available on your account.

```
GET https://api.clickatell.com/rest/account/balance
```

{% hint style="info" %}
The REST API may respond with various HTTP status codes. See the full list [here](broken://pages/g4LnbcQA4XA3TRKvmBGV).
{% endhint %}

### **JSON**

#### **Request**

```
GET /rest/account/balance HTTP/1.1
HOST: api.clickatell.com
X-Version: 1
Authorization: Bearer [Your Authorization Token]
Accept: application/json
```

#### **Response**

```
HTTP/1.1 200 OK
Content-Type: application/json
 
{
 "data":{
   "balance":"300.50"
  }
}
```

### **XML**

#### **Request**

{% code lineNumbers="true" %}

```
GET /rest/account/balance HTTP/1.1
HOST: api.clickatell.com
X-Version: 1
Authorization: Bearer [Your Authorization Token]
Accept: application/xml
```

{% endcode %}

#### **Response**

{% code lineNumbers="true" %}

```
HTTP/1.1 200 OK
Content-Type: application/xml
 
<?xml version="1.0"?>
<response>
    <data>
        <balance>300.50</balance>
    </data>
</response>
```

{% endcode %}

### **Sample code**

#### **cURL**

```
authToken=""
 
curl -X GET \
-H "X-Version: 1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $authToken" \
https://api.clickatell.com/rest/account/balance
```

#### **Python**

{% code lineNumbers="true" %}

```
import httplib2, json
 
authToken = "place auth token here"
 
resp, content = httplib2.Http().request(
    "https://api.clickatell.com/rest/account/balance",
    "GET",
    headers={
        "X-Version" : "1",
        "Accept" : "application/json",
        "Authorization" : "Bearer " + authToken
    }
)
```

{% endcode %}

#### **PHP**

{% code lineNumbers="true" %}

```
<?php
 
$authToken = "<place auth token here>";
 
$ch = curl_init();
 
curl_setopt($ch, CURLOPT_URL,            "https://api.clickatell.com/rest/account/balance");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER,     array(
    "X-Version: 1",
    "Accept: application/json",
    "Authorization: Bearer $authToken"
));
 
$result = curl_exec ($ch);
 
?>
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.clickatell.com/developers-api-reference/developers-archive/sms-rest-api-overview/retrieve-balance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
