> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ironflow.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Timestamps

> How timestamps work in the Ironflow API.

All timestamps in the Ironflow API are **Unix milliseconds** (`int64`).

## In requests

Use `from` and `to` parameters to scope queries to a time range:

```bash theme={null}
# Trades in a 1-hour window
curl "https://api.ironflow.sh/v1/trades?source=hyperliquid&market=BTC-PERP&from=1718398800000&to=1718402400000" \
  -H "Authorization: Bearer if_your_api_key"
```

## Converting to Unix milliseconds

<CodeGroup>
  ```typescript TypeScript theme={null}
  // Now
  const now = Date.now(); // already in milliseconds

  // Specific date
  const from = new Date("2025-07-27T00:00:00Z").getTime();

  // 24 hours ago
  const from = Date.now() - 24 * 60 * 60 * 1000;
  ```

  ```python Python theme={null}
  import time
  from datetime import datetime, timezone

  # Now
  now = int(time.time() * 1000)

  # Specific date
  from_ts = int(datetime(2025, 7, 27, tzinfo=timezone.utc).timestamp() * 1000)

  # 24 hours ago
  from_ts = int((time.time() - 86400) * 1000)
  ```

  ```bash cURL theme={null}
  # date command (macOS/Linux)
  date -u -d "2025-07-27" +%s%3N    # Linux
  date -u -j -f "%Y-%m-%d" "2025-07-27" +%s000  # macOS
  ```
</CodeGroup>

## Defaults

When `from` or `to` are omitted, the API uses sensible defaults:

| Endpoint | Default `from` | Default `to` |
| - | - | - |
| `/v1/trades`, `/v1/fills` | 24 hours ago | Now |
| `/v1/candles` | 24 hours ago | Now |
| `/v1/open-interest`, `/v1/mark-prices` | 1 hour ago | Now |

## History window

Your tier limits how far back you can query:

| Tier | History window |
| - | - |
| Free | 24 hours |
| Explorer | 90 days |
| Builder | 1 year |
| Enterprise | Full history (from July 27, 2025) |

Requests with `from` outside your history window are clamped to your tier's limit — they won't error, they'll just return data from the earliest allowed point.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.