# List events

Query past events by topic, with cursor pagination and catch-up.

> Source: https://tokenearly.com/en/developers/rest/list-events · Docs index: https://tokenearly.com/en/developers/llms.txt · OpenAPI: https://api.tokenearly.com/v1/openapi.json

`GET https://api.tokenearly.com/v1/events`

Returns the newest events first. With `after` the order flips to oldest first and you get everything after that event, which is how you catch up after a disconnect; with `before` you page further back. When `has_more` is true, pass `next_cursor` as the parameter named in `cursor_param`. The `access` object tells you which of the requested topics you may read (granted), which you may not (denied) and which do not exist (unknown). How far back you can go is set by your plan's history window.

**Requires an API key**

## Parameters

| Parameter | In | Type | required | Description |
|---|---|---|---|---|
| `topics` | query | string |  | Comma-separated, any combination (e.g. `announcement.binance,news.*`); each item is a topic or pattern: `announcement.binance`, `announcement.*`, `news.*`, `signal.*`, `twitter.*`, `*`. Omit for every topic your key can read. |
| `after` | query | string |  | Return events newer than this event id, oldest first. Use it to catch up after a disconnect. |
| `before` | query | string |  | Return events older than this event id, newest first. Use it to page backwards. |
| `updated_after` | query | integer |  | Return events that got a new revision after this Unix time (seconds), even if the event itself is older, ordered by event id. Use it to pick up updates to older events missed while offline. To page, keep `updated_after` and pass the previous `next_cursor` as `after`. Cannot be combined with `before`. Omitting it or passing 0 means it is not used (a normal newest-first list). |
| `limit` | query | integer |  | Page size, 1–200, default 50. |
| `listings_only` | query | boolean |  | Set to true to return only exchange announcements classified as new listings (`data.listing.is_listing = true`); topics of other types return nothing. Works with `after` / `before` / `updated_after`. Because it filters on the classification, a page can hold fewer than `limit` events while `has_more` is still true: keep paging with `next_cursor` until `has_more` is false. |

## Example request

**cURL**

```bash
curl "https://api.tokenearly.com/v1/events?topics=announcement.*,news.odaily&limit=5" \
  -H "Authorization: Bearer $TOKENEARLY_API_KEY"
```

**Python**

```python
import os, requests

resp = requests.get(
    "https://api.tokenearly.com/v1/events?topics=announcement.*,news.odaily&limit=5",
    headers={"Authorization": f"Bearer {os.environ['TOKENEARLY_API_KEY']}"},
    timeout=10,
)
resp.raise_for_status()
print(resp.json())
```

**Node.js**

```javascript
// Node 18+ (built-in fetch)
async function main() {
  const resp = await fetch("https://api.tokenearly.com/v1/events?topics=announcement.*,news.odaily&limit=5", {
    headers: { Authorization: `Bearer ${process.env.TOKENEARLY_API_KEY}` },
  });
  const body = await resp.json();
  if (!resp.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
  console.log(body);
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.tokenearly.com/v1/events?topics=announcement.*,news.odaily&limit=5", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("TOKENEARLY_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.Status, string(body))
}
```

## Example response

```json
{
  "events": [
    {
      "spec_version": "1.0",
      "id": "6b150c67e70ade1bb493e0e2",
      "revision": 1,
      "action": "created",
      "topic": "twitter.44196397",
      "type": "twitter",
      "source": {
        "id": "44196397",
        "name": "@elonmusk (Elon Musk)"
      },
      "published_at": 1796541539,
      "published_at_ms": 1796541539136,
      "detected_at_ms": 1796541543941,
      "data": {
        "kind": "quote",
        "tweet_id": "2129475674222317961",
        "author": {
          "id": "44196397",
          "screen_name": "elonmusk",
          "name": "Elon Musk"
        },
        "text": "Yeah",
        "lang": "en",
        "url": "https://x.com/elonmusk/status/2129475674222317961",
        "referenced_tweet_id": "2129371437043483081",
        "conversation_id": null,
        "media": [],
        "complete": true
      }
    },
    {
      "spec_version": "1.0",
      "id": "6b150bf2d0e4e92d8481211f",
      "revision": 3,
      "action": "updated",
      "topic": "news.panews",
      "type": "news",
      "source": {
        "id": "panews",
        "name": "PANews"
      },
      "published_at": 1796541408,
      "published_at_ms": 1796541408000,
      "detected_at_ms": 1796541426000,
      "data": {
        "titles": {
          "zh": "DWF Labs合伙人：比特币已挺过风暴，若Strategy没有崩盘，市场或已触底",
          "en": "DWF Labs Partner: Bitcoin Has Weathered the Storm; If Strategy Hasn't Collapsed, the Market May Have Bottomed",
          "ko": "DWF Labs 파트너: 비트코인은 폭풍을 견뎌냈으며, 만약 Strategy가 붕괴되지 않았다면 시장은 이미 바닥에 도달했을 수 있다"
        },
        "original_lang": "zh",
        "translated_langs": [
          "ko"
        ],
        "summary": "PANews 12月6日消息，DWF Labs 合伙人 Andrei Grachev 发文预测，比特币已经受住这轮市场风暴，如果 Strategy 没有崩盘，那么市场可能已经触底。",
        "url": "https://www.panewslab.com/zh/articles/01a24a36-6342-7407-b95e-475df0dce169"
      }
    },
    {
      "spec_version": "1.0",
      "id": "6b0ff643d0e4e92d84810499",
      "revision": 3,
      "action": "updated",
      "topic": "announcement.gate",
      "type": "announcement",
      "source": {
        "id": "gate",
        "name": "Gate.io"
      },
      "published_at": 1796208195,
      "published_at_ms": 1796208195000,
      "detected_at_ms": 1796208195896,
      "data": {
        "titles": {
          "zh": "Gate 已上线 RITUAL 合约交易、杠杆借贷交易、交易机器人、跟单、闪兑、定投功能",
          "en": "Gate Now Supports RITUAL for Futures Trading, Margin Loans, Bots, Copy, Convert, and Auto-Invest",
          "ko": "Gate는 RITUAL 계약 거래, 레버리지 대출 거래, 트레이딩 봇, 팔로우 트레이딩, 스왑, 정기 투자 기능을 출시했습니다."
        },
        "original_lang": "zh",
        "translated_langs": [
          "ko"
        ],
        "url": "https://www.gate.io/article/103112",
        "exchange_category": "listing",
        "listing": {
          "is_listing": true,
          "market": "futures"
        },
        "symbols": []
      }
    },
    {
      "spec_version": "1.0",
      "id": "6b055216d0e4e92d8480d1e5",
      "revision": 1,
      "action": "created",
      "topic": "signal.binance_alpha",
      "type": "signal",
      "source": {
        "id": "binance_alpha",
        "name": "Binance Alpha"
      },
      "published_at": 1795510800,
      "published_at_ms": 1795510800000,
      "detected_at_ms": 1795510806000,
      "data": {
        "signal_type": "binance_alpha",
        "level": "info",
        "titles": {
          "zh": "🆕 Binance Alpha 新币上线: SHARE (BSC)",
          "en": "🆕 Binance Alpha New Token: SHARE (BSC)",
          "ko": "🆕 바이낸스 알파 신규 토큰: SHARE (BSC)"
        },
        "contents": {
          "zh": "代币: SHARE (ShareX)\n链: BSC\n价格: $0.0572\n合约: 0xe5e5e1d77125fc910d8f39cdd55b7a24ec69ce34\nAlpha ID: ALPHA_1287\n持有者: 61649\n市值: $56.19M",
          "en": "Token: SHARE (ShareX)\nChain: BSC\nPrice: $0.0572\nContract: 0xe5e5e1d77125fc910d8f39cdd55b7a24ec69ce34\nAlpha ID: ALPHA_1287\nHolders: 61649\nMarket Cap: $56.19M",
          "ko": "토큰: SHARE (ShareX)\n체인: BSC\n가격: $0.0572\n컨트랙트: 0xe5e5e1d77125fc910d8f39cdd55b7a24ec69ce34\nAlpha ID: ALPHA_1287\n보유자: 61649\n시가총액: $56.19M"
        },
        "url": "https://www.binance.com/en/alpha/bsc/0xe5e5e1d77125fc910d8f39cdd55b7a24ec69ce34",
        "symbols": [
          "SHARE"
        ],
        "tags": [
          "new_listing",
          "bsc"
        ]
      }
    }
  ],
  "has_more": true,
  "next_cursor": "6b055216d0e4e92d8480d1e5",
  "cursor_param": "before",
  "access": {
    "granted": [
      "announcement.gate",
      "news.panews",
      "signal.binance_alpha",
      "twitter.44196397"
    ],
    "denied": [],
    "unknown": []
  }
}
```

## Errors

| Code | HTTP | Description |
|---|---|---|
| `missing_api_key` | 401 | No key sent. Use `Authorization: Bearer <key>`. |
| `invalid_api_key` | 401 | The key does not exist, or it was reset or revoked. |
| `key_expired` | 401 | The trial key has expired. Apply for a new trial key, or subscribe and create a regular key. |
| `plan_required` | 403 | Your plan does not include the developer API, or this part of it. |
| `ip_not_allowed` | 403 | The key has an IP allowlist and the request came from an address outside it. |
| `invalid_cursor` | 400 | `after` / `before` is not a valid id (an event id for events, an alert id for my_alerts), both were sent, or (events only) `updated_after` was combined with `before`. |
| `invalid_parameter` | 400 | A parameter has the wrong type or value (e.g. `limit` out of range). |
| `rate_limited` | 429 | Over this key's request rate (REST and MCP combined; the interval is `limits.rest_interval_seconds` in `/v1/me`); wait `Retry-After` seconds and retry. |

## Which topics you can query

Put topic ids from the table below in `topics`, or use the patterns `announcement.*`, `news.*`, `signal.*`, `twitter.*` and `*`. Whether you may read a topic depends on your plan, and the `access` object in the response tells you topic by topic: `granted` (readable and included), `denied` (no access), `unknown` (no such topic).

**Example: topics=announcement.binance,announcement.upbit,announcement.nope**

```json
{
  "access": {
    "granted": [
      "announcement.binance"
    ],
    "denied": [
      "announcement.upbit"
    ],
    "unknown": [
      "announcement.nope"
    ]
  }
}
```

| Topic id | Name | Type |
|---|---|---|
| `announcement.binance` | Binance | Exchange announcements |
| `announcement.okx` | OKX | Exchange announcements |
| `announcement.mexc` | MEXC | Exchange announcements |
| `announcement.bitget` | Bitget | Exchange announcements |
| `announcement.gate` | Gate.io | Exchange announcements |
| `announcement.huobi` | Huobi | Exchange announcements |
| `announcement.bybit` | Bybit | Exchange announcements |
| `announcement.kucoin` | KuCoin | Exchange announcements |
| `announcement.upbit` | Upbit | Exchange announcements |
| `announcement.bithumb` | Bithumb | Exchange announcements |
| `news.odaily` | Odaily | News |
| `news.jinse` | Jinse Finance | News |
| `news.theblockbeats` | TheBlockBeats | News |
| `news.foresight` | Foresight News | News |
| `news.panews` | PANews | News |
| `news.coinmarketcap` | CoinMarketCap | News |
| `news.wallstreetcn` | WallStreetCN | News |
| `news.theblock` | The Block | News |
| `signal.binance_alpha` | Binance Alpha | Signals |
| `twitter.44196397` | @elonmusk (Elon Musk) | X (Twitter) KOL posts |
| `twitter.902926941413453824` | @cz_binance (CZ 🔶 BNB) | X (Twitter) KOL posts |
| `twitter.574032254` | @coinbase (Coinbase 🛡️) | X (Twitter) KOL posts |
| `twitter.1422537905885442055` | @CoinbaseAssets (Coinbase Assets 🛡️) | X (Twitter) KOL posts |
| `twitter.720487892670410753` | @CoinbaseMarkets (Coinbase Markets 🛡️) | X (Twitter) KOL posts |
| `twitter.877807935493033984` | @binance (Binance) | X (Twitter) KOL posts |
| `twitter.295218901` | @VitalikButerin (vitalik.eth) | X (Twitter) KOL posts |
| `twitter.1003840309166366721` | @heyibinance (Yi He) | X (Twitter) KOL posts |
| `twitter.902839045356744704` | @justinsuntron (H.E. Justin Sun 👨‍🚀 🌞) | X (Twitter) KOL posts |
| `twitter.900935123968737281` | @hebi555 (何币) | X (Twitter) KOL posts |
| `twitter.1403881130802225152` | @BTCdayu (大宇) | X (Twitter) KOL posts |
| `twitter.2985599460` | @star_okx (Star_OKX) | X (Twitter) KOL posts |
| `twitter.1533037218444476416` | @xincctnnq (币圈女菩萨｜Pizza披萨🍕) | X (Twitter) KOL posts |
| `twitter.25073877` | @realDonaldTrump (Donald J. Trump) | X (Twitter) KOL posts |
| `twitter.1686901686185721857` | @TrumpDailyPosts (Commentary Trump Daily Posts) | X (Twitter) KOL posts |
| `twitter.20736511` | @nayibbukele (Nayib Bukele) | X (Twitter) KOL posts |
| `twitter.1844002277218242560` | @Plasma | X (Twitter) KOL posts |
| `twitter.2414580907` | @pauliepunt (Paul) | X (Twitter) KOL posts |
| `twitter.867617849208037377` | @okx (OKX) | X (Twitter) KOL posts |
| `twitter.1138033434` | @Rewkang (Andrew Kang) | X (Twitter) KOL posts |
| `twitter.1789908971953799168` | @Aster_DEX (Aster 🥷) | X (Twitter) KOL posts |
| `twitter.1948234340556763136` | @zakk_okx (Zakk 🟪 OKX AI) | X (Twitter) KOL posts |
| `twitter.357312062` | @Bitcoin | X (Twitter) KOL posts |
| `twitter.973261472` | @blknoiz06 (Ansem 🐂🀄️) | X (Twitter) KOL posts |
| `twitter.132749200` | @OxSunNFT (0xSun ❤️ Memecoin) | X (Twitter) KOL posts |
| `twitter.844304603336232960` | @MustStopMurad (Murad 💹🧲) | X (Twitter) KOL posts |
| `twitter.1195728139898376193` | @0xcryptowizard (0xWizard) | X (Twitter) KOL posts |
| `twitter.992590209752629249` | @notEezzy (Eezzy 🧸) | X (Twitter) KOL posts |
| `twitter.1800348208461205504` | @xiaomucrypto (新股神白毛股神) | X (Twitter) KOL posts |
| `twitter.16228398` | @mcuban (Mark Cuban) | X (Twitter) KOL posts |
| `twitter.1189381231198134272` | @CookerFlips (Cooker.hl \| 版本之子 \| (Theo Arc)) | X (Twitter) KOL posts |
| `twitter.1279711663264894977` | @DekuKing1 (0x易经(刘彻版)) | X (Twitter) KOL posts |
| `twitter.725984371946082304` | @XXAntiWar (XX) | X (Twitter) KOL posts |
| `twitter.1462727797135216641` | @lookonchain (Lookonchain) | X (Twitter) KOL posts |
| `twitter.1466673394649559040` | @huahuayjy (花花) | X (Twitter) KOL posts |
| `twitter.1401718840535379970` | @hellosuoha (梭教授说) | X (Twitter) KOL posts |
| `twitter.1453603581932687368` | @laofeiyyds (比特币老肥.btc（敏感肥）) | X (Twitter) KOL posts |
| `twitter.1852674305517342720` | @aixbt_agent (aixbt) | X (Twitter) KOL posts |
| `twitter.1279918106111025153` | @assetdash (Dash News) | X (Twitter) KOL posts |
| `twitter.169686021` | @kanyewest (ye) | X (Twitter) KOL posts |
| `twitter.1483495485889564674` | @bwenews (方程式新闻 BWEnews 🏎️) | X (Twitter) KOL posts |
| `twitter.1052454006537314306` | @BNBCHAIN (BNB Chain) | X (Twitter) KOL posts |
| `twitter.1451036242431262720` | @binancezh (币安Binance华语) | X (Twitter) KOL posts |
| `twitter.1940360837547565056` | @aleabitoreddit (Serenity) | X (Twitter) KOL posts |

To see access for every topic at once, call [GET /v1/topics](https://tokenearly.com/en/developers/rest/topics) with your key; each topic carries an `accessible` flag.

## Catching up after a disconnect

Two steps: page with `after=<last event id>` until `has_more` is false to get new events; then call with `updated_after=<time you went offline>` to get older events that got a new revision meanwhile (`after` only moves forward by event id and never returns updates to older events). Then reconnect to the stream.

```python
import os, time, requests

KEY = os.environ["TOKENEARLY_API_KEY"]
API = "https://api.tokenearly.com/v1/events"
TOPICS = "announcement.*,news.*,signal.*,twitter.*"
H = {"Authorization": f"Bearer {KEY}"}

def get(params):
    while True:
        r = requests.get(API, params=dict(params, topics=TOPICS, limit=200), headers=H, timeout=10)
        if r.status_code == 429:
            time.sleep(int(r.headers.get("Retry-After", "3")))   # whole seconds
            continue
        r.raise_for_status()
        time.sleep(int(r.headers.get("X-RateLimit-Reset", "3")))   # respect the per-key interval
        return r.json()

cursor = load_last_event_id()          # the last event id you stored (None on the first run)
offline_since = load_last_seen_time()  # Unix seconds when you last had a live connection (0 on the first run)

# First run: nothing to catch up. Just connect to the stream and start storing ids and times.
if cursor and offline_since:
    # 1) new events after the cursor (oldest first, `cursor_param` is "after")
    while True:
        page = get({"after": cursor})
        for ev in page["events"]:
            handle(ev)
            cursor = ev["id"]
        if not page["has_more"]:
            break

    # 2) older events that got a new revision while you were away
    params = {"updated_after": offline_since}
    while True:
        page = get(params)
        for ev in page["events"]:
            handle(ev)                 # same (id, revision) dedupe as for live events
        if not page["has_more"]:
            break
        # always pass next_cursor under the name the response gives in `cursor_param`
        params = {"updated_after": offline_since, page["cursor_param"]: page["next_cursor"]}
    save_last_event_id(cursor)
```
