# Currency API (jsDelivr) API

> Returns currency and crypto codes, current exchange rates of a base currency, and historical rates from 2024-03-06.

Category: Finance & Crypto. Region: global. 3 endpoints at `https://api.hoshime.com/v1/fxjsdelivr/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/fxjsdelivr
## GET /v1/fxjsdelivr/currencies

The currency and crypto codes the API publishes, with their names.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/fxjsdelivr/currencies" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/fxjsdelivr/rates

The value of one unit of a base currency in every other currency, or in the listed ones.

Scope: `social:read` · Units: 1 · Cached: 30 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `base` | string | no | Base currency or crypto code, such as usd or btc. (default usd; e.g. usd) |
| `symbols` | string | no | Comma-separated codes to return, such as eur,gbp. Omit it for every code. (e.g. eur,gbp) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `base` (string), `date` (string), `items` (Rate[]), `items[].code` (string), `items[].rate` (number (double))

```bash
curl "https://api.hoshime.com/v1/fxjsdelivr/rates?base=usd&symbols=eur%2Cgbp" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/fxjsdelivr/historical

The value of one unit of a base currency in every other currency on one past day, from 2024-03-06.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `date` | string | yes | Day in YYYY-MM-DD form, from 2024-03-06 to today. (e.g. 2024-03-06) |
| `base` | string | no | Base currency or crypto code, such as usd or btc. (default usd; e.g. eur) |
| `symbols` | string | no | Comma-separated codes to return, such as eur,gbp. Omit it for every code. (e.g. usd,gbp) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `base` (string), `date` (string), `items` (Rate[]), `items[].code` (string), `items[].rate` (number (double))

```bash
curl "https://api.hoshime.com/v1/fxjsdelivr/historical?date=2024-03-06&base=eur&symbols=usd%2Cgbp" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
