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

# perpSnapshotTimestamp | Hyperliquid Info API

> Hyperliquid perpSnapshotTimestamp: check for a new all-positions perpSnapshots snapshot for free before downloading it.

> [card] Credit Cost
>
> 0 per call

> [card] Processing
>
> Realtime

The Hyperliquid info endpoint with `type: "perpSnapshotTimestamp"` is used to check for a new all-positions perpSnapshots snapshot for free before downloading it.

> [!TIP]
>
> Estimate your monthly cost for this API using the [Pricing Calculator](https://goldrush.dev/docs/pricing-calculator.md?endpoint=%2Fapi-reference%2Fhyperliquid-info%2Fperp-snapshot-timestamp).

> [!NOTE]
>
> * GoldRush-native. Clients that already poll a `perpSnapshotTimestamp` method get the same request and response.
> * 0 credits and no per-key rate limit, unlike `perpSnapshots` (250 credits, 5 calls per 10 minutes).
> * A new snapshot appears about every 12 minutes (every 10,000 HyperCore blocks).

Returns the `snapshot_id` and block time of the snapshot that [perpSnapshots](https://goldrush.dev/docs/api-reference/hyperliquid-info/perp-snapshots.md) would serve right now. It costs nothing and returns a few bytes, so you can poll it every few seconds and spend a rate-limited `perpSnapshots` call only when a new snapshot exists.

## Endpoint

```
POST https://hypercore.goldrushdata.com/info
Authorization: Bearer <GOLDRUSH_API_KEY>
Content-Type: application/json
```

## Request

**type** `string` *required* (default: perpSnapshotTimestamp)

Always `"perpSnapshotTimestamp"`. Other fields are ignored.

### Example

```bash cURL theme={null}
curl -X POST https://hypercore.goldrushdata.com/info \
  -H "Authorization: Bearer $GOLDRUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "perpSnapshotTimestamp"}'
```

```python Python theme={null}
import os, time, requests

URL = "https://hypercore.goldrushdata.com/info"
HEADERS = {"Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}"}

last_id = None
while True:
    ts = requests.post(URL, headers=HEADERS, json={"type": "perpSnapshotTimestamp"}).json()
    if ts.get("snapshot_id") and ts["snapshot_id"] != last_id:
        last_id = ts["snapshot_id"]
        print("new snapshot", last_id, "at", ts["timestamp"])
        # ...now call perpSnapshots
    time.sleep(10)
```

```typescript TypeScript theme={null}
let lastId: string | undefined;

setInterval(async () => {
  const res = await fetch("https://hypercore.goldrushdata.com/info", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ type: "perpSnapshotTimestamp" }),
  });
  if (!res.ok) return; // 404 / 503: no fresh snapshot yet, try again next tick
  const { snapshot_id, timestamp } = await res.json();
  if (snapshot_id !== lastId) {
    lastId = snapshot_id;
    console.log("new snapshot", snapshot_id, new Date(timestamp * 1000).toISOString());
    // ...now call perpSnapshots
  }
}, 10_000);
```

## Response

```json theme={null}
{"snapshot_id": "20261130_state_1240000000", "timestamp": 1796031360}
```

**snapshot\_id** `string`

Opaque id of the snapshot, `YYYYMMDD_state_<block height>` (UTC date of the block). Compare it for equality only: it changes exactly when the served snapshot changes.

**timestamp** `int`

Block time the snapshot was captured at, epoch **seconds** (not milliseconds). It equals the `x-snapshot-timestamp` header of `perpSnapshots`.

## Errors

| Condition | Status | Body |
| - | - | - |
| Missing or invalid key, no credits, suspended | `401` / `402` / `403` | standard auth error |
| No snapshot loaded yet | `404` | `{"error":"no_snapshot"}` |
| Newest snapshot older than 15 minutes | `503` | `{"error":"snapshot_stale","message":"…"}`, with `Retry-After: 60` |

GoldRush runs several servers, and each loads new snapshots on its own. Two calls a few seconds apart can briefly report different ids, for up to about 15 seconds after a new snapshot lands.

## Related endpoints

> [card] [perpSnapshots](https://goldrush.dev/docs/api-reference/hyperliquid-info/perp-snapshots.md)
>
> fetch every open perp position on Hyperliquid, with entry and liquidation prices, for liquidation maps and whale trackers.

> [card] [batchClearinghouseState](https://goldrush.dev/docs/api-reference/hyperliquid-info/batch-clearinghouse-state.md)
>
> fetch perpetuals account state for up to 50 wallets in a single request.

> [card] [clearinghouseState](https://goldrush.dev/docs/api-reference/hyperliquid-info/clearinghouse-state.md)
>
> fetch a single user's perpetuals account state by wallet address.

> [card] [liquidatable](https://goldrush.dev/docs/api-reference/hyperliquid-info/liquidatable.md)
>
> list accounts currently eligible for liquidation.

See all Hyperliquid endpoints: [Overview hub](https://goldrush.dev/docs/goldrush-hyperliquid/overview.md) · [Info API reference](https://goldrush.dev/docs/goldrush-hyperliquid/info-api/overview.md)

Served by the [GoldRush Hyperliquid API](https://goldrush.dev/products/hyperliquid-api/): a drop-in replacement for the public `/info` and `/ws` APIs at `hypercore.goldrushdata.com`, with no rate limits and every fill, order, trade, funding and ledger event retained from the start of HyperCore coverage.


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