# XE — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access live mid-market exchange rates, convert between any currency pair, and retrieve historical rate data and currency metadata from xe.com.

**Category:** Finance & Markets | **Website:** [xe.com/](https://xe.com/) | **Docs:** [parse.bot/marketplace/c71f6436-401a-4072-b3bf-4e5f4b428dad/xe-com-api](https://parse.bot/marketplace/c71f6436-401a-4072-b3bf-4e5f4b428dad/xe-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-xe-com-api-c71f6436/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### convert_currency

Convert a specific amount from source to target currency. Returns the same structure as get_live_exchange_rate with the specified amount applied to the mid-market rate.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `amount` | number | Yes | Amount to convert |
| `from` | string | Yes | Source currency code (e.g. EUR, GBP). Supports all codes returned by get_currency_symbols. |
| `to` | string | Yes | Target currency code (e.g. USD, JPY). Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-xe-com-api-c71f6436/convert_currency \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":"<number>","from":"<string>","to":"<string>"}'
```

### get_all_rates

Get all mid-market exchange rates relative to USD. Returns a timestamp and a rates object mapping every supported currency code to its USD-relative rate. The rate sheet refreshes every few minutes.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-xe-com-api-c71f6436/get_all_rates \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_currency_details

Get the ISO 2-letter country code associated with a specific currency. Useful for mapping currencies to their issuing country.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `currency` | string | Yes | Currency code (e.g. USD, EUR, GBP). Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-xe-com-api-c71f6436/get_currency_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"currency":"<string>"}'
```

### get_currency_symbols

Get metadata and classification for all supported currencies. Each currency includes flags for obsolete status, crypto classification, and whether it is sellable or buyable on the XE platform.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-xe-com-api-c71f6436/get_currency_symbols \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_historical_chart_data

Retrieve historical exchange rate data points for a currency pair. Returns multiple time-series batches at different intervals (daily, hourly, 15-minute). Each batch contains a start time, interval in milliseconds, and an array of rate values.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `from` | string | Yes | Source currency code (e.g. USD). Supports all codes returned by get_currency_symbols. |
| `to` | string | Yes | Target currency code (e.g. EUR). Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-xe-com-api-c71f6436/get_historical_chart_data \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"<string>","to":"<string>"}'
```

### get_live_exchange_rate

Get the live mid-market exchange rate for a specific currency pair. Computes the cross-rate from USD-based rates. When amount is provided, also returns the converted value.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `amount` | number | No | Amount to convert |
| `from` | string | Yes | Source currency code (e.g. USD, EUR, GBP). Supports all codes returned by get_currency_symbols. |
| `to` | string | Yes | Target currency code (e.g. EUR, JPY, INR). Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-xe-com-api-c71f6436/get_live_exchange_rate \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":"<number>","from":"<string>","to":"<string>"}'
```

### get_popular_currency_pairings

Get popular currency pairings for a base currency with real-time rates and trend data including rate change, percentage change, and direction. Returns the most commonly tracked pairs from the given base.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `base` | string | No | Base currency code. Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-xe-com-api-c71f6436/get_popular_currency_pairings \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"base":"<string>"}'
```
