# `CCXT.RateLimiter.Headers`
[🔗](https://github.com/ZenHive/ccxt_client/blob/main/lib/ccxt/rate_limiter/headers.ex#L1)

Parses rate limit status headers from exchange API responses.

Exchanges return rate limit information with every response, not just 429s.
This module detects the header pattern and extracts normalized rate limit data.

## Supported Patterns

Patterns are tried in order; the first match wins:

1. **Binance** -- `x-mbx-used-weight-1m` or `x-sapi-used-ip-weight-1m`
2. **Bybit** -- `x-bapi-limit`, `x-bapi-limit-status`, `x-bapi-limit-reset-timestamp`
3. **Standard** -- `x-ratelimit-limit`, `x-ratelimit-remaining`, `x-ratelimit-reset`

Exchanges without custom rate limit headers (OKX, Kraken) return `:none`.

# `parse`

```elixir
@spec parse(String.t(), %{required(String.t()) =&gt; [String.t()]}, number() | nil) ::
  {:ok, CCXT.RateLimiter.Info.t()} | :none
```

Parses rate limit headers from a response.

Headers are in Req format: `%{String.t() => [String.t()]}` with lowercase keys.

`spec_rate_limit` is the exchange's `rate_limit_ms` value (milliseconds between
requests). Converted to max requests per minute (`60_000 / rate_limit_ms`) to
derive `limit` when the exchange only reports `used` (e.g., Binance).

Returns `{:ok, %Info{}}` if rate limit headers are found, `:none` otherwise.

---

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