# Bitfinex API

> Returns Bitfinex tickers, trading pairs, order books, recent trades, candles and platform status.

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

Last price, best bid and ask and 24-hour statistics of one trading pair.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `symbol` | string | yes | Trading pair with its t prefix, such as tBTCUSD. (e.g. tBTCUSD) |
| `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` (string), `askSize` (string), `bid` (string), `bidSize` (string), `change` (string), `changePercent` (string), `high` (string), `low` (string), `open` (string), `price` (string), `symbol` (string), `updatedAt` (string), `volume` (string)

```bash
curl "https://api.hoshime.com/v1/bitfinex/ticker?symbol=tBTCUSD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bitfinex/markets

The trading pairs of the Bitfinex exchange, sorted by symbol, with their t prefix.

Scope: `social:read` · Units: 1 · Cached: 60 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: `name` (string), `symbol` (string)

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

## GET /v1/bitfinex/orderbook

The order book of one trading pair at the finest precision, with 1, 25 or 100 levels per side.

Scope: `social:read` · Units: 1

| Parameter | Type | Required | Description |
|---|---|---|---|
| `symbol` | string | yes | Trading pair with its t prefix, such as tBTCUSD. (e.g. tBTCUSD) |
| `len` | string | no | Levels per side: 1, 25 or 100. (one of 1, 25, 100; default 25) |
| `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: `asks` (Level[]), `asks[].orders` (integer (int64)), `asks[].price` (string), `asks[].size` (string), `bids` (Level[]), `bids[].orders` (integer (int64)), `bids[].price` (string), `bids[].size` (string), `symbol` (string)

```bash
curl "https://api.hoshime.com/v1/bitfinex/orderbook?symbol=tBTCUSD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bitfinex/trades

The most recent trades of one trading pair, newest first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `symbol` | string | yes | Trading pair with its t prefix, such as tBTCUSD. (e.g. tBTCUSD) |
| `limit` | integer | no | Items per page, 1 to 10000. (default 50) |
| `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: `id` (string), `price` (string), `side` (string), `size` (string), `tradedAt` (string)

```bash
curl "https://api.hoshime.com/v1/bitfinex/trades?symbol=tBTCUSD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bitfinex/candles

Trade candles of one trading pair, oldest first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `symbol` | string | yes | Trading pair with its t prefix, such as tBTCUSD. (e.g. tBTCUSD) |
| `timeframe` | string | no | Candle length, such as 1m, 1h or 1D. (one of 1m, 5m, 15m, 30m, 1h, 3h, 6h, 12h, 1D, 7D, 14D, 1M; default 1h) |
| `limit` | integer | no | Items per page, 1 to 10000. (default 100) |
| `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: `close` (string), `high` (string), `low` (string), `open` (string), `openedAt` (string), `volume` (string)

```bash
curl "https://api.hoshime.com/v1/bitfinex/candles?symbol=tBTCUSD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bitfinex/platformStatus

Whether the Bitfinex trading platform is operative (true) or in maintenance (false).

Scope: `social:read` · Units: 1

| 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: `operative` (boolean)

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

## GET /v1/bitfinex/tickers

Bid, ask, last price and 24-hour statistics of several Bitfinex trading pairs in one call.

Scope: `social:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `symbols` | string | yes | Comma-separated trading pairs such as tBTCUSD,tETHUSD, up to 50. (e.g. tBTCUSD,tETHUSD) |
| `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` (string), `bid` (string), `change` (string), `changePercent` (string), `high` (string), `low` (string), `open` (string), `price` (string), `symbol` (string), `updatedAt` (string), `volume` (string)

```bash
curl "https://api.hoshime.com/v1/bitfinex/tickers?symbols=tBTCUSD%2CtETHUSD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bitfinex/fundingTicker

Margin funding rates of one currency on Bitfinex: the flash return rate, best lending bid and ask with their periods in days, and 24-hour statistics.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `symbol` | string | yes | Funding currency with its f prefix, such as fUSD. (e.g. fUSD) |
| `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` (string), `askPeriodDays` (integer (int64)), `askSize` (string), `bid` (string), `bidPeriodDays` (integer (int64)), `bidSize` (string), `change` (string), `changePercent` (string), `flashReturnRate` (string), `high` (string), `lastRate` (string), `low` (string), `symbol` (string), `volume` (string)

```bash
curl "https://api.hoshime.com/v1/bitfinex/fundingTicker?symbol=fUSD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bitfinex/derivativeStatus

Mark price, open interest, insurance fund and the current and next funding rate of one Bitfinex perpetual derivative.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `symbol` | string | yes | Derivative pair with its t prefix, such as tBTCF0:USTF0 for the BTC perpetual. (e.g. tBTCF0:USTF0) |
| `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: `derivativePrice` (string), `fundingRate` (string), `insuranceFundBalance` (string), `markPrice` (string), `nextFundingAt` (string), `nextFundingRate` (string), `openInterest` (string), `spotPrice` (string), `symbol` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/bitfinex/derivativeStatus?symbol=tBTCF0%3AUSTF0" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
