# Retrieve Currency Rates

<mark style="color:green;">`GET`</mark> `/currencies/rates`

Returns a complete list of currency rates.

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Response**

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

```json
[
  {
    "name": "USDTBEP20",
    "rate": 1
  },
  ...
  {
    "name": "BNB",
    "rate": 672
  }
  ...
]
```

{% endtab %}
{% endtabs %}

**Examples**

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

```bash
curl -X GET "https://api.nord-pay.com/currencies/rates" \
     -H "Content-Type: application/json"
```

{% endtab %}

{% tab title="Python (requests)" %}

```python
import requests

def get_rates():
    response = requests.get(
        "https://api.nord-pay.com/currencies/rates",
        headers={
            "Content-Type": "application/json"
        }
    )
    response.raise_for_status()
    return response.json()

# usage:
rates = get_rates()
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
function getRates(): array {
    $ch = curl_init("https://api.nord-pay.com/currencies/rates");
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER     => [
            "Content-Type: application/json"
        ],
    ]);
    $response = curl_exec($ch);
    curl_close($ch);
    return json_decode($response, true);
}

// usage:
$rates = getRates();
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
async function loadRates() {
  const response = await fetch("https://api.nord-pay.com/currencies/rates", {
    method: "GET",
    headers: {
      "Content-Type": "application/json"
    }
  });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  
  const rates = await response.json();
  return rates;
}

// usage:
loadRates().then(rates => {
  // work with rates
});
```

{% endtab %}

{% tab title="Node.js (axios)" %}

```javascript
const axios = require('axios');

async function getRates() {
  const response = await axios.get('https://api.nord-pay.com/currencies/rates', {
    headers: {
      'Content-Type': 'application/json',
    }
  });
  
  const rates = response.data;
  return rates;
}

// usage:
getRates().then(rates => {
  // work with rates
});
```

{% endtab %}
{% endtabs %}
