# Real-time Rates

Both free and paid users may access real-time exchange rates using the currencylayer API's live endpoint.

Optionally, it is possible to define an additional `source` currency and specific output currencies using the `currencies` parameter. Both of these options will be discussed in detail throughout this documentation.

<mark style="color:blue;">`GET`</mark> `https://api.curexapi.com/live`

**Request Parameters**

<table><thead><tr><th width="166">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>access_key</td><td>string</td><td>Your access key</td></tr><tr><td>source</td><td>string</td><td>Source currency code<br><em>(optional) (default:USD)</em></td></tr><tr><td>currencies</td><td>string</td><td>Target currency codes<br>(optional)</td></tr></tbody></table>

**Sample Requests**

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

```bash
curl --location 'https://api.curexapi.com/live?access_key=YOUR_ACCESS_KEY&source=USD&currencies=EUR%2CGBP'
```

{% endtab %}

{% tab title="Javascript" %}

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

let config = {
  method: 'get',
  url: 'https://api.curexapi.com/live?access_key=YOUR_ACCESS_KEY&source=USD&currencies=EUR,GBP',
  headers: { }
};

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

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.curexapi.com/live?access_key=YOUR_ACCESS_KEY&source=USD&currencies=EUR%2CGBP',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.curexapi.com/live?access_key=YOUR_ACCESS_KEY&source=USD&currencies=EUR,GBP"

response = requests.request("GET", url)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Sample Response**

```json
{
    "success": true,
    "timestamp": 1672531200,
    "source": "USD",
    "date": "2023-01-01",
    "rates": {
        "EUR": 0.932,
        "GBP": 0.827
    }
}
```
