Event format: envelope and message fields
Every message is an event: a fixed envelope, a stable id, an increasing revision, and type-specific data.
Envelope
Every event shares one envelope; the shape of data depends on type. The stream and REST build events with the same function, so the fields are identical.
spec_version"1.0"requiredEvent format version. Within a major version fields are only added, never removed or changed.
idstringrequiredStable event id (24 hex characters) shared by every revision; never changes. Ids increase with the time the event was first stored and compare correctly as strings. Also the pagination and resume cursor.
revisionintegerrequiredStarts at 1 and increases when translations or the original link are filled in, or when the complete version of a post arrives. Deduplicate on (id, revision) and keep the highest.
action"created" | "updated"requiredcreated = first appearance; updated = a newer revision of the same event.
topicstringrequiredTopic id in the form <type>.<source>, e.g. announcement.binance; X accounts use their numeric id, e.g. twitter.44196397.
type"announcement" | "news" | "signal" | "twitter"requiredMessage type; decides the shape of data.
sourceobjectrequiredSource: id matches the topic suffix, name is the English display name (for X: @handle and display name).
published_atinteger | nullrequiredWhen the source published it, Unix seconds.
published_at_msinteger | nullWhen the source published it, Unix milliseconds; seconds × 1000 if the source has no milliseconds.
detected_at_msinteger | nullrequiredWhen Tokenearly received the item, Unix milliseconds; null for a few early records.
dataobjectrequiredPayload; its shape depends on type (see each type below).
Lifecycle and deduplication
- First appearance:
action = "created",revision = 1. - After titles or the original link are filled in (for posts: when the complete version arrives): same
id,action = "updated", higherrevision. idnever changes; deduplicate on (id, revision) and keep the highest revision.
latest = {} # event id -> highest revision seen
def handle(ev):
if latest.get(ev["id"], 0) >= ev["revision"]:
return # duplicate or older revision
first_time = ev["id"] not in latest
latest[ev["id"]] = ev["revision"]
if first_time:
notify(ev) # new to you, whatever its action: after a reconnect a new item
# can already be at revision 2 (action = "updated")
else:
update(ev) # same event, translations / link filled inExchange announcement (type = announcement)
titlesobjectrequiredTitles in zh / en / ko. A language may be missing until translated; it then arrives as a new revision.
original_langstringrequiredLanguage the exchange published in: one of zh / en / ko.
translated_langsarray<zh | en | ko>requiredTitle languages produced by machine translation. Any title not listed here is the exchange's own version: most exchanges publish in one language, some publish official Chinese and English versions, which may arrive in the same push or later (as a new revision that also replaces an earlier machine translation and removes it from this list). Machine translations are empty on the first push and usually filled in within seconds to tens of seconds as a new revision, occasionally minutes later or not at all.
urlstring | nullrequiredOriginal announcement on the exchange; for some sources it is filled in shortly after (as a new revision).
exchange_categorystring | nullrequiredThe exchange's own category name, as given (not translated).
listingobjectrequiredListing verdict: is_listing and market (spot / futures / null). Same classifier as the site's listing timeline.
symbolsarray<string>requiredToken tickers found in the title.
data.listing is the listing verdict and data.symbols the tickers found in the title; use them to filter listings. When is_listing is false, market is always null.
{
"spec_version": "1.0",
"id": "6b0ff643d0e4e92d84810499",
"revision": 1,
"action": "created",
"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"
},
"original_lang": "zh",
"translated_langs": [],
"url": "https://www.gate.io/article/103112",
"exchange_category": "listing",
"listing": {
"is_listing": true,
"market": "futures"
},
"symbols": []
}
}{
"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": []
}
}News (type = news)
titlesobjectrequiredTitles in zh / en / ko. A language may be missing until translated; it then arrives as a new revision.
original_langstringrequiredLanguage the source published in: one of zh / en / ko.
translated_langsarray<zh | en | ko>requiredTitle languages produced by machine translation. Any title not listed here is the source's own version: most sources publish in one language, some publish official Chinese and English versions, which may arrive in the same push or later (as a new revision that also replaces an earlier machine translation and removes it from this list). Machine translations are empty on the first push and usually filled in within seconds to tens of seconds as a new revision, occasionally minutes later or not at all.
summarystring | nullrequiredSummary as given by the source, in the original language, up to 600 characters; full text is not provided. May be null.
urlstring | nullrequiredLink to the original article; null for sources that publish flashes without a link.
data.summary is the source's own summary in the original language; full text is not provided. Open data.url for the article (some flashes have no link: null).
Flash-style sources have no headline of their own; titles is taken from the start of the text and may be cut off with "...".
{
"spec_version": "1.0",
"id": "6b150bf2d0e4e92d8481211f",
"revision": 1,
"action": "created",
"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"
},
"original_lang": "zh",
"translated_langs": [],
"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": "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"
}
}Signal (type = signal)
signal_typestringrequiredSignal type, as defined by the source.
level"info" | "warning" | "critical"requiredSeverity: info / warning / critical.
titlesobjectrequiredTitles in zh / en / ko; a language may be missing, so fall back to another.
contentsobjectrequiredSummary text in zh / en / ko.
urlstring | nullrequiredRelated link (may be null).
symbolsarray<string>requiredToken tickers involved.
tagsarray<string>requiredTags.
{
"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"
]
}
}X (Twitter) KOL post (type = twitter)
kind"tweet" | "quote" | "reply" | "retweet"requiredPost kind: tweet = original post, quote, reply or retweet. On the first push it is occasionally not final yet (an original later confirmed as a quote, say); the correction arrives as a new revision.
tweet_idstringrequiredThe post's id on X. For a retweet, reply or quote it is the id of that action itself.
authorobjectrequiredThe account that posted: id is the numeric X id (same as the topic suffix; unchanged by renames), screen_name the handle at the time (without @), name the display name.
textstringrequiredPost text as published, not translated. The first push may carry a shortened version (complete = false).
langstring | nullrequiredLanguage code as labelled by X (e.g. en, zh, ja); null when unknown. X also uses a few non-language codes, passed through as is: zxx (no text, e.g. media or a link only), qme (mentions or emoji only), qst (very short text), art (emoji only) and similar.
urlstring | nullrequiredLink to the post on X.
referenced_tweet_idstring | nullrequiredId of the quoted, replied-to or retweeted post; null for an original post. It may be missing on the first push and arrive in a new revision; a few older posts may never have it.
conversation_idstring | nullrequiredReserved: conversation (thread) id. The data source does not provide it at present, so it is always null; to follow a reply chain, walk up through referenced_tweet_id.
mediaarray<string>requiredImage / video URLs, up to 20; may be empty on the first push and filled in by the complete version.
completebooleanrequiredWhether this is the complete version. A post is sometimes pushed first in a shortened form (text may be cut, media and the referenced post missing); the complete version follows with the same id and a higher revision, with this set to true.
Only posts from a curated list of KOL accounts are included: original posts, quotes, replies and retweets. Profile edits, follows and similar activity are not part of the API. Accounts are added and removed over time; GET /v1/topics has the current list.
data.kind: tweet original post, quote, reply or retweet; for the last three, data.referenced_tweet_id is the quoted, replied-to or retweeted post.
A post is sometimes pushed first in a shortened form (data.complete = false): the text may be cut, media, the referenced post and the language may be missing, and the kind is occasionally corrected from tweet to quote. The complete version follows with the same id and a higher revision.
Posts are given as published, not translated, and have no titles. If you subscribe to *, parse each type separately.
Posts are kept for the last 10 days only: REST queries and stream resumes reach no further back (or your plan's history window, whichever is shorter).
{
"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
}
}Compatibility
- Within a major version fields are only added, never removed, renamed or retyped. Ignore fields you do not know.
- New message types arrive with a new
type; ignore types you do not handle. - The full JSON Schema is at GET /v1/schema.