# Get Exchange Rate

<mark style="color:blue;">`POST`</mark> `{{base_url}}/business/rate`

#### Headers

| Name                                            | Type   | Description                      |
| ----------------------------------------------- | ------ | -------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Set value to `Bearer PUBLIC_KEY` |

Take a look at how you might do this:

{% tabs %}
{% tab title="cURL" %}

```
curl --location '{{base_url}}/business/rate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer PUBLIC_KEY' \
--data '{
    "currencypair": "USDRWF"
}'
```

{% endtab %}

{% tab title="NodeJs" %}

```json
const axios = require('axios');
let data = JSON.stringify({
  "currencypair": "NGNKES"
});

let config = {
  method: 'post',
  url: '{{base_url}}/business/rate',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer PUBLIC_KEY', 
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}

{% tab title="PHP - cURL" %}

```json
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => '{{base_url}}/business/rate,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "currencypair": "USDNGN"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer PUBLIC_KEY'
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="Dart" %}

```
var headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer PUBLIC_KEY'
};
var request = http.Request('POST', Uri.parse('{{base_url}}/business/rate'));
request.body = json.encode({
  "currencypair": "USDNGN"
});
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
  print(await response.stream.bytesToString());
}
else {
  print(response.reasonPhrase);
}

```

{% endtab %}
{% endtabs %}

### Sample Response

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "status": true,
    "message": "Exchange rate fetched successfully",
    "data": {
        "minAmount": 0.1,
        "maxAmount": 10000,
        "exchangeRate": 1429
    }
}
```

{% endtab %}
{% endtabs %}


---

# 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://docs.1app.online/get-exchange-rate.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.
