跳到文档正文

社交内容事件

社交内容使用 tweet/content。先读取 author.platform,再处理平台专属字段。

运行五分钟快速开始
在聊天中打开
按产品代码校对:2026年9月2日

tweet/content

t="tweet"op="content" 分发内容事件,再以 (author.platform, tweetId) 作为帖子键。

推文内容类型

typescript
type VerifiedType = 'blue' | 'business' | 'government' | 'verified' | 'none';
type TweetVerifiedLabel = {
  badge: string | null;
  description: string;
  url: string | null;
};
 
type TweetAuthor = {
  banner?: string;
  bio?: string;
  followersCount?: number;
  followingCount?: number;
  id?: string;
  joinedAt?: number;
  location?: string;
  metrics?: {
    likes?: number;
    tweets?: number;
  };
  // Includes a leading @ when present, for example "@elonmusk".
  handle?: string;
  name?: string;
  platform?: 'twitter' | 'truth_social' | 'binance_square';
  profileImage?: string;
  url?: string;
  verifiedLabel?: TweetVerifiedLabel;
  verifiedType?: VerifiedType;
};
 
type Media = {
  url: string;
} & (
  | {
      type: 'video';
      // Every video is a progressive MP4. A public still poster is included when available.
      thumbnail?: string;
    }
  | {
      type?: 'image' | 'gif';
      thumbnail?: string;
    }
);
 
type TweetUrl = {
  url: string;
  name?: string;
  tco?: string;
};
 
type TweetMention = {
  handle?: string;
  id?: string;
  name?: string;
};
 
type TweetArticle = {
  description?: string;
  id?: string;
  publishedAt?: number;
  text?: string;
  thumbnail?: string;
  title: string;
  updatedAt?: number;
  url: string;
};
 
type TweetPollChoice = {
  id?: string;
  image?: string;
  label: string;
  votes?: number;
};
 
type TweetPoll = {
  choices: TweetPollChoice[];
  endsAt?: number;
  totalVotes?: number;
  updatedAt?: number;
};
 
type TweetContentKind = 'post' | 'reply' | 'quote' | 'retweet';
 
type TweetReference = {
  article?: TweetArticle;
  type: 'reply' | 'quote' | 'retweet';
  tweetId: string;
  text?: string;
  translatedText?: string;
  author?: TweetAuthor;
  media?: Media[];
  poll?: TweetPoll;
  quoted?: TweetReference;
  subtweet?: TweetReference;
};
 
type TweetContent = {
  tweetId: string;
  kind: TweetContentKind;
  // Original tweet text when the event includes both original and translated text.
  text: string;
  // Translation, present only when available.
  translatedText?: string;
  createdAt: number;
  author: TweetAuthor;
  article?: TweetArticle;
  link?: string;
  media?: Media[];
  mentions?: TweetMention[];
  poll?: TweetPoll;
  receivedAt?: number;
  urls?: TweetUrl[];
  ref?: TweetReference;
};

推文内容事件

json
{
  "v": 1,
  "t": "tweet",
  "op": "content",
  "id": "1234567890",
  "ts": 1702500000130,
  "d": {
    "tweetId": "1234567890",
    "kind": "reply",
    "text": "Could this launch today?",
    "createdAt": 1702500000000,
    "author": {
      "handle": "@marketdesk",
      "platform": "twitter"
    }
  }
}

Twitter

Twitter 内容可以是发帖、回复、引用或转推。引用和媒体在可用时提供。

Truth Social

Truth Social 为唐纳德·特朗普(@realDonaldTrump)和白宫(@WhiteHouse)提供可选的实时推送。符合条件时,可在控制台的账号标签页中开启。

内容使用 tweet 消息信封,author.platform="truth_social",类型可以是发帖、回复、引用或转推。观察到时可能收到元数据、更新、删除和置顶事件。不能通过通用账号管理添加其他 Truth Social 账号,也不能使用 History 回放。

Truth Social 内容事件

json
{
  "v": 1,
  "t": "tweet",
  "op": "content",
  "id": "tweet-content",
  "ts": 1772000001060,
  "d": {
    "tweetId": "tweet-content",
    "text": "hello",
    "createdAt": 1772000001000,
    "receivedAt": 1772000001050,
    "kind": "post",
    "author": {
      "id": "truth-author",
      "handle": "@realDonaldTrump",
      "name": "Donald J. Trump",
      "platform": "truth_social",
      "url": "https://truthsocial.com/@realDonaldTrump"
    }
  }
}

币安广场

已启用的目录账号使用 author.platform="binance_square"。内容仅实时发送,不占用监控 Twitter 账号额度。

币安广场内容事件

json
{
  "v": 1,
  "t": "tweet",
  "op": "content",
  "id": "square-content",
  "ts": 1772000001060,
  "d": {
    "tweetId": "square-content",
    "text": "Weekly market outlook is live.",
    "createdAt": 1772000001000,
    "receivedAt": 1772000001050,
    "kind": "post",
    "author": {
      "id": "square-author",
      "handle": "@marketresearch",
      "name": "Market Research",
      "platform": "binance_square",
      "url": "https://www.binance.com/en/square/profile/marketresearch"
    }
  }
}

引用与媒体

回复、引用和转推可能包含 ref。每个嵌套引用都是独立帖子,附件从对应引用中读取。