# `Geminex.API.Public`
[🔗](https://github.com/mpol1t/geminex/blob/v0.1.1/lib/geminex/api/public.ex#L1)

Public API endpoints for Gemini.

# `candles`

```elixir
@spec candles(symbol :: String.t(), time_frame :: String.t()) ::
  {:ok, [[any()]]} | {:error, any()}
```

Retrieves time-intervaled data for the provided symbol.

## Parameters

  - **symbol**: Trading pair symbol (e.g., "btcusd").
  - **time_frame**: Time range for each candle (e.g., "1m", "5m").

# `current_order_book`

```elixir
@spec current_order_book(
  symbol :: String.t(),
  opts :: [limit_bids: non_neg_integer(), limit_asks: non_neg_integer()]
) :: {:ok, map()} | {:error, any()}
```

Retrieves the current order book for the specified trading pair symbol.

## Parameters

  - **symbol** : The trading pair symbol (e.g., **"btcusd"**).
  - **opts** : A list of query parameters to customize the order book data.
    - **:limit_bids** : The maximum number of bid orders to retrieve.
    - **:limit_asks** : The maximum number of ask orders to retrieve.

## Returns

  - **{:ok, map}** on success, containing the order book data as a map.
  - **{:error, any}** on failure, with an error reason.

# `derivatives_candles`

```elixir
@spec derivatives_candles(symbol :: String.t(), time_frame :: String.t()) ::
  {:ok, [[any()]]} | {:error, any()}
```

Retrieves time-intervaled data for the provided perpetual swap symbol.

## Parameters

  - **symbol**: Perpetual swap symbol (e.g., "BTCGUSDPERP").
  - **time_frame**: Time range for each candle (e.g., "1m").

# `fee_promos`

```elixir
@spec fee_promos() :: {:ok, map()} | {:error, any()}
```

Retrieves symbols that currently have fee promos.

# `funding_amount`

```elixir
@spec funding_amount(symbol :: String.t()) :: {:ok, map()} | {:error, any()}
```

Retrieves the funding amount details for the specified symbol.

## Parameters

  - **symbol**: Trading pair symbol (e.g., "btcgusdperp").

# `funding_amount_report`

```elixir
@spec funding_amount_report(
  opts :: [
    fromDate: non_neg_integer(),
    toDate: non_neg_integer(),
    numRows: non_neg_integer()
  ]
) :: {:ok, binary()} | {:error, any()}
```

Retrieves the funding amount report file.

## Parameters

  - **opts** : A list of query parameters to customize the report.
    - **:fromDate** : The start date for the report, represented as a Unix timestamp.
    - **:toDate** : The end date for the report, represented as a Unix timestamp.
    - **:numRows** : The maximum number of rows to retrieve in the report.

## Returns

  - **{:ok, binary}** on success, containing the binary content of the report file.
  - **{:error, any}** on failure, with an error reason.

# `network`

```elixir
@spec network(token :: String.t()) :: {:ok, map()} | {:error, any()}
```

Retrieves the associated network for a requested token.

## Parameters

  - **token**: Token identifier (e.g., "eth").

# `price_feed`

```elixir
@spec price_feed() :: {:ok, [map()]} | {:error, any()}
```

Retrieves the price feed for all trading pairs.

# `symbol_details`

```elixir
@spec symbol_details(symbol :: String.t()) :: {:ok, map()} | {:error, any()}
```

Retrieves extra detail on a supported symbol.

## Parameters

  - **symbol**: Trading pair symbol (e.g., "btcusd").

# `symbols`

```elixir
@spec symbols() :: {:ok, [String.t()]} | {:error, any()}
```

Retrieves all available symbols for trading.

# `ticker`

```elixir
@spec ticker(symbol :: String.t()) :: {:ok, map()} | {:error, any()}
```

Retrieves information about recent trading activity for the symbol.

## Parameters

  - **symbol**: Trading pair symbol (e.g., "btcusd").

# `ticker_v2`

```elixir
@spec ticker_v2(symbol :: String.t()) :: {:ok, map()} | {:error, any()}
```

Retrieves information about recent trading activity for the provided symbol (V2).

## Parameters

  - **symbol**: Trading pair symbol (e.g., "btcusd").

# `trade_history`

```elixir
@spec trade_history(
  symbol :: String.t(),
  opts :: [
    timestamp: non_neg_integer(),
    since_tid: non_neg_integer(),
    limit_trades: non_neg_integer(),
    include_breaks: boolean()
  ]
) :: {:ok, [map()]} | {:error, any()}
```

Retrieves the trade history for the specified trading pair symbol.

## Parameters

  - **symbol** : The trading pair symbol (e.g., **"btcusd"**).
  - **opts** : A list of options to customize the query.
    - **:timestamp** : The starting timestamp for the trade history.
    - **:since_tid** : The trade ID from which to start fetching trades.
    - **:limit_trades** : The maximum number of trades to retrieve.
    - **:include_breaks** : Whether to include breaks between trades. Defaults to **false**.

## Returns

  - **{:ok, list(map)}** on success, containing the trade history as a list of maps.
  - **{:error, any}** on failure, with an error reason.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
