Query Stellar contract events via a paginated REST API. Filter by event type, contract, transaction, and topic patterns.
/events
List events with filters and pagination
Both methods accept the same fields — GET uses query parameters, POST uses a JSON body.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of events to return (1–100, default 10) |
after | string | Return events newer than this cursor (event id) |
before | string | Return events older than this cursor (event id). Use the next field from a previous response to paginate. |
q | string or object | Filter query — a string (GET & POST) or a JSON object (POST only). See syntax below. |
q parameter)Filter events using key:value qualifiers. Space-separated qualifiers are AND'd. Use OR for alternatives. Parentheses group expressions.
| Key | Value | Example |
|---|---|---|
type | contract or system | type:contract |
contract | Stellar contract strkey (C…) | contract:CCW67... |
ledger | Ledger sequence number | ledger:58000000 |
tx | Transaction hash (requires ledger) | tx:abc123... |
topic | XDR-JSON ScVal object | topic:{"symbol":"transfer"} |
topic0…topic3 | XDR-JSON ScVal object | topic0:{"symbol":"transfer"} |
ledger:58000000 type:contract
contract:CBN3Y5KABXEF2VDO7HNNT43TXSNL3KWTJC2HQY4ENVVRSRXFJJBFNKSM topic0:{"symbol":"transfer"}
ledger:58000000 tx:7758a34695323011e177c932cb899f3ea55c5af4d95c954e946ddddaafca0296
(contract:CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA OR contract:CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75) (topic0:{"symbol":"transfer"} OR topic0:{"symbol":"mint"} OR topic0:{"symbol":"clawback"} OR topic0:{"symbol":"burn"})
contract:CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75 topic:{"address":"GABC..."}
In POST requests, q can be a structured JSON object instead of a string. The format uses and/or nodes and single-key qualifier objects. See the JSON Schema.
Every node is a JSON object with exactly one key:
| Node | Shape | Description |
|---|---|---|
| Qualifier | {"key": value} | A single filter condition. Key must be one of the qualifier keys below. |
| And | {"and": [expr, ...]} | All children must match. Array length ≥ 1. |
| Or | {"or": [expr, ...]} | At least one child must match. Array length ≥ 1. |
| Key | JSON value type | Example |
|---|---|---|
type | string ("contract", "system", "diagnostic") | {"type":"contract"} |
contract | string (Stellar contract strkey) | {"contract":"CCW67..."} |
ledger | integer | {"ledger":58000000} |
tx | string (transaction hash; requires ledger) | {"tx":"abc123..."} |
topic | any JSON (XDR-JSON ScVal, matches any position) | {"topic":{"symbol":"transfer"}} |
topic0…topic3 | any JSON (XDR-JSON ScVal, matches specific position) | {"topic0":{"symbol":"transfer"}} |
| String syntax | JSON syntax |
|---|---|
type:contract | {"type":"contract"} |
type:contract contract:CCW67... | {"and":[{"type":"contract"},{"contract":"CCW67..."}]} |
type:contract OR type:system | {"or":[{"type":"contract"},{"type":"system"}]} |
(type:contract OR type:system) contract:CCW67... | {"and":[{"or":[{"type":"contract"},{"type":"system"}]},{"contract":"CCW67..."}]} |
topic0:{"symbol":"transfer"} | {"topic0":{"symbol":"transfer"}} |
ledger:100 tx:abc | {"and":[{"ledger":100},{"tx":"abc"}]} |
A full POST request body using the JSON format:
{
"limit": 10,
"q": {
"and": [
{"or": [{"type": "contract"}, {"type": "system"}]},
{"contract": "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75"},
{"topic0": {"symbol": "transfer"}}
]
}
}
| Limit | Value |
|---|---|
| Max query length | 1,024 bytes |
| Max terms (key:value pairs) | 20 |
| Max parenthesis nesting depth | 4 |
| Max filter combinations after expansion | 20 |
Results are always returned in descending order (newest first). Use the before and after cursors to page through events.
Browsing history — page backward through older events:
GET /events?limit=10next field with a cursor.before to get the next page of older events: GET /events?limit=10&before=evt_...data is empty.Streaming new events — poll for events newer than the last seen:
id of the newest event you've seen (the first item in data).after: GET /events?after=evt_...id are returned, newest first.{
"object": "list",
"url": "/events?...",
"next": "/events?after=evt_...&...",
"data": [
{
"object": "event",
"id": "evt_yGrddDfumfmdgBDNdtycxRy",
"url": "/events/evt_yGrddDfumfmdgBDNdtycxRy",
"ledger": 58000000,
"at": "2024-01-15T12:00:00+00:00",
"tx": "abc123...",
"type": "contract",
"contract": "CABC...",
"topics": [{"symbol": "transfer"}],
"data": {"i128": {"hi": 0, "lo": 1000000}}
}
]
}
Click Submit to send a request.
Click Submit to send a request.
Click Submit to send a request.
Click Submit to send a request.
Click Submit to send a request.
q)Click Submit to send a request.
Click Submit to send a request.
/events/:id
Get a single event by ID
Returns a single event object. The :id is the opaque event ID from list responses (e.g. evt_yGrddDfumfmdgBDNdtycxRy).
{
"object": "event",
"id": "evt_yGrddDfumfmdgBDNdtycxRy",
"url": "/events/evt_yGrddDfumfmdgBDNdtycxRy",
"ledger": 58000000,
"at": "2024-01-15T12:00:00+00:00",
"tx": "abc123...",
"type": "contract",
"contract": "CABC...",
"topics": [{"symbol": "transfer"}],
"data": {"i128": {"hi": 0, "lo": 1000000}}
}
Click Submit to send a request.
/health
Health check and server status
{
"status": "ok",
"latest_ledger": 12345,
"cached_ledgers": 7200,
"network_passphrase": "..."
}
Click Submit to send a request.