# Gloom Perpetuals Market History

> Gloom Perpetuals Market History is a paid API for AI agents from api.gloom.sh, paid per call via x402, $0.06/call, status unknown (last checked 2026-11-01).

Retrieves historical trading data for a specific perpetuals (perps) market on the Gloom finance terminal

## Facts

- Endpoint: GET https://api.gloom.sh/v1/perps/markets/%7BmarketId%7D/history?utm_source=zero.xyz
- Price: $0.06/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gloom-perpetuals-market-history-658efeb4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QGSh5lYfYS5dL6EZFhMq1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability gloom-perpetuals-market-history-658efeb4
```

Example prompt: Pull the historical trading data for the BTC-PERP market from Gloom so I can see how price has moved over time.

## When to prefer this

Use this endpoint when you need historical time-series data specifically for perpetuals (derivatives) markets tracked by the Gloom open-source finance terminal. Prefer this over spot market endpoints when analyzing leveraged derivatives instruments. It is most useful for backtesting, charting, and volatility analysis of crypto perps pairs.

## Known failure modes

- Invalid or unknown marketId returns empty data array or 404
- Malformed request with missing marketId path parameter returns error
- Payment failure (x402) if USDC funds are insufficient for the $0.06 per-call cost
- Rate limiting or service unavailability returning 5xx errors
- No historical data available for newly listed markets returning empty data array

## How this service works

Gloom is a free, open-source finance terminal for desktop and TUI with charts, news, filings, portfolios, alerts, and plugins.

## Output

Returns a JSON object with a `data` array containing historical records for the specified perpetuals market, likely including timestamps, prices, volumes, or funding rate snapshots.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "properties": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gloom-perpetuals-market-history-658efeb4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.gloom.sh](https://www.zero.xyz/host/api.gloom.sh/llms.txt)
