# National Bank of Poland API

> Returns Polish zloty exchange rate tables, currency rates, bid and ask rates, and gold prices.

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

The latest exchange rate table of the National Bank of Poland, with the middle rate of each currency.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `table` | string | no | Table A holds the common currencies, table B the rest. (one of A, B; default A; e.g. A) |
| `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: `effectiveDate` (string), `items` (Rate[]), `items[].code` (string), `items[].currency` (string), `items[].mid` (number (double)), `no` (string), `table` (string)

```bash
curl "https://api.hoshime.com/v1/nbp/tables?table=A" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nbp/rate

The recent middle rates of one currency in table A, newest first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | Three-letter currency code, such as USD. (e.g. USD) |
| `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), `currency` (string), `items` (DayRate[]), `items[].effectiveDate` (string), `items[].mid` (number (double)), `items[].no` (string)

```bash
curl "https://api.hoshime.com/v1/nbp/rate?code=USD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nbp/gold

The price of one gram of gold in zloty on a day, or the latest price.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `date` | string | no | Day in YYYY-MM-DD form. Omit it for the latest price. (e.g. 2024-01-02) |
| `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: `date` (string), `price` (string)

```bash
curl "https://api.hoshime.com/v1/nbp/gold?date=2024-01-02" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nbp/tableOn

A rate table of the National Bank of Poland on one day: table A or B, with the middle rate of each currency.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `table` | string | no | Table A holds the common currencies, table B the rest. (one of A, B; default A; e.g. A) |
| `date` | string | yes | Day in YYYY-MM-DD form, from 2002-01-02. (e.g. 2024-01-02) |
| `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: `effectiveDate` (string), `items` (Rate[]), `items[].code` (string), `items[].currency` (string), `items[].mid` (number (double)), `no` (string), `table` (string)

```bash
curl "https://api.hoshime.com/v1/nbp/tableOn?table=A&date=2024-01-02" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nbp/rateRange

The middle rates of one currency in table A between two days, oldest first. The range is at most 93 days.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | Three-letter currency code, such as USD. (e.g. USD) |
| `start` | string | yes | First day in YYYY-MM-DD form. (e.g. 2024-01-02) |
| `end` | string | yes | Last day in YYYY-MM-DD form. (e.g. 2024-01-05) |
| `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), `currency` (string), `items` (DayRate[]), `items[].effectiveDate` (string), `items[].mid` (number (double)), `items[].no` (string)

```bash
curl "https://api.hoshime.com/v1/nbp/rateRange?code=USD&start=2024-01-02&end=2024-01-05" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nbp/bidAsk

The buy and sell rates of one currency in table C on a day, from 2002-01-02. Omit the date for the latest day.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | Three-letter currency code, such as EUR. (e.g. EUR) |
| `date` | string | no | Day in YYYY-MM-DD form. Omit it for the latest rates. (e.g. 2024-01-02) |
| `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: `ask` (number (double)), `bid` (number (double)), `code` (string), `currency` (string), `effectiveDate` (string), `no` (string)

```bash
curl "https://api.hoshime.com/v1/nbp/bidAsk?code=EUR&date=2024-01-02" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nbp/goldRange

The price of one gram of gold in zloty for each day between two days, oldest first. The range is at most 93 days.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `start` | string | yes | First day in YYYY-MM-DD form. (e.g. 2024-01-02) |
| `end` | string | yes | Last day in YYYY-MM-DD form. (e.g. 2024-01-04) |
| `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: `date` (string), `price` (string)

```bash
curl "https://api.hoshime.com/v1/nbp/goldRange?start=2024-01-02&end=2024-01-04" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
