Live updates (server-sent events)
GET /v1/stream- quién puede llamarla
- Cualquiera
- A
User-Agentthat claims a search or AI crawler is refused with 403. - qué cuesta
- 1 petición de la cuota
- Counted once, when the stream opens; its events are not counted. How many streams a caller holds at once is capped by tier. · niveles y claves
- cuán reciente
- Nunca en caché
- cada respuesta lleva la altura del índice y la del nodo
- Herramienta MCP
- Ninguna
En esta página
One server-sent event stream of the tip, the mempool, the projection, the fees and the state of up to 16 transactions, from the mempool engine. Each event's data is one JSON object (the Stream* schemas) whose at is when the engine applied the change.
- The stream opens with
retry: 3000and onesnapshotper topic and per transaction whose state is known. - Then
block,mempool,projectedandfees(each only when it changed, at most one per reprojection) andtx. - Every event has an
idof<boot>-<seq>. There is no replay:Last-Event-IDis ignored and a reconnect gets a fresh snapshot. - A comment line goes out every 15 s. The stream closes after six hours, or once the client falls 16 events behind, and the client reconnects.
- Concurrent streams per caller: t0 2, t1 4, t2 and t3 10, t4 50, under a server-wide cap. Opening a stream counts as one request of the quota; events do not.
- The stream is for browsers and for agents with a key: a request whose
User-Agentclaims a search or AI crawler is refused with 403forbidden; a crawler reads the page.
Parámetros
| Nombre | Dónde | Tipo | Obligatorio | Qué hace |
|---|---|---|---|---|
topics | consulta | string | opcional | Comma-separated: block, mempool, projected, fees. A stream needs topics or tx (400 otherwise). |
tx | consulta | string | opcional | Up to 16 comma-separated txids. |
Qué responde
200 · text/event-stream
The stream. Events: snapshot (StreamSnapshot), block (StreamBlockEvent), mempool (StreamMempoolEvent), projected (StreamProjectedEvent), fees (StreamFeesEvent), tx (StreamTxEvent).
Cabeceras: Cache-Control, X-Accel-Buffering
esquema
array de uno de — The stream as a sequence of events; each item is one event's data, named by its event: line.
Ausente y vacío
| El caso | En la respuesta |
|---|---|
| A transaction asked for that the engine does not know: never seen, or in a block before the stream opened. | No snapshot for it; read GET /v1/tx/{txid}. |
Errores
| Estado | Código | Cuándo |
|---|---|---|
| 400 | invalid_input | Malformed input (invalid_input). |
| 403 | forbidden | forbidden: the User-Agent claims a search or AI crawler; the stream is for browsers and for agents with a key. |
| 429 | quota_exceeded | quota_exceeded: the caller or the server holds as many streams as allowed (Retry-After: 30), or the caller's request quota ran out. |
| 501 | not_configured | not_configured: the mempool engine is not enabled (BITCOIN_ZMQ_SEQUENCE unset), or the stream is off (STREAM_MAX_CLIENTS=0). |
| 503 | index_unavailable | index_unavailable: the mempool engine is bootstrapping; retry shortly. |
Cada uno llega en el sobre de error único, y ninguno se guarda en caché: un error lleva Cache-Control: no-store.
Ejemplo
Solo curl: -N imprime cada evento según llega. Detenlo con Ctrl-C.
curl -sN 'https://api.btcintel.io/v1/stream?topics=block,fees'