跳到内容
Twexapi
简体中文
Esc
导航打开⌘J预览
本页内容

Make

通过 TwexAPI 构建 Make Twitter 自动化,实现推文搜索、资料查询、热门推文、平台 webhook 与游标安全 handoff。

无需 X Developer 应用即可用 TwexAPI 构建 Make Twitter 自动化。搜索推文、查询资料、读取热门推文,并将规范化行路由到 Slack、Sheets、Airtable、Notion 或 CRM。

TwexAPI 使用单一 API 密钥与 REST 基址 https://api.twexapi.io

选择 Make 自动化模式

标准 HTTP 模块

定时或 webhook 驱动场景下用 Make HTTP 模块直接调用 TwexAPI REST。

Custom webhook + agent handoff

接收 MCP capable AI Agent 的严格 JSON,再可视化路由行。

私有自定义集成应用

相同 TwexAPI 操作在多个场景重复时打包可复用模块。

原生 Make X 应用已下线。TwexAPI 仍可通过 HTTP 模块或私有 custom app 使用。

前置条件

  • TwexAPI API 密钥
  • Make 组织账号
  • 可选 Slack、Sheets、Airtable、Notion 或 CRM 模块
  • 可选:已连接 https://api.twexapi.io/mcp 的 MCP capable AI Agent

连接

创建将 API 密钥存为密码字段的可复用连接:

字段
Parameter name apiKey
Header Authorization: Bearer {{apiKey}}
Base URL https://api.twexapi.io
Connection test GET /balance

GET /balance 验证 API 密钥且不修改数据。

基础 HTTP 模块模式

字段
Method 所选端点的 GETPOST
URL https://api.twexapi.io 加相对路径
Header Authorization: Bearer YOUR_API_KEY
Body type POST 请求用 Raw JSON

一致处理状态码:

401

认证失败。检查 TwexAPI API 密钥。

403

访问被拒。检查账号访问与额度。

429

速率限制。重试前等待并保留游标。

5xx

服务不可用。指数退避重试。

入门模块

模块 TwexAPI 路由
搜索推文 POST /twitter/advanced_search/page
获取资料 GET /twitter/{screen_name}/about
搜索用户 GET /twitter/search-user/{keyword}/{target_count}
获取趋势 GET /twitter/global-trending/tweets
列出粉丝 POST /v3/twitter/users/followers
发帖 POST /twitter/tweets/create

搜索推文示例

{
  "url": "https://api.twexapi.io/twitter/advanced_search/page",
  "method": "POST",
  "headers": {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": {
    "searchTerms": ["AI agents lang:en"],
    "sortBy": "Latest",
    "nextCursor": ""
  }
}

在后续 Iterator 模块遍历返回推文。has_next_pagehas_more 为 true 时在 Make 数据存储保存 next_cursor

输出 handoff

Make 场景应输出小而稳定的 bundle,而非原始 API 响应。

推文搜索分页

存储查询;映射 tweet_idtextauthor_usernamecreated_athas_next_pagenext_cursor

用户画像记录

存储 user_idusernamename、粉丝数与查询输入。

趋势话题榜单

存储国家、主题、内容标签与推文行及场景元数据。

写入操作 (发推/点赞/关注)

CLI --dry-run 预览。写操作需 cookie 或 auth_token

配方 1:AI Agent handoff 到 Slack

  1. Custom webhook 接收 MCP AI Agent 的 TwexAPI handoff JSON。
  2. Iterator 处理 tweets 中各项。
  3. 按关键词或作者过滤。
  4. Slack 模块发布 author_username、文本与公开 URL。

建议AI Agent prompt:

Use Twexapi MCP to fetch trending tweets for country United States, topic technology, content AI.
Return only JSON with route_used, country, topic, content, has_more, next_cursor, and tweets.
Each tweet must include tweet_id, author_username, text, created_at, like_count, reply_count, and retweet_count.

配方 2:每日搜索到 Google Sheets

  1. 每日 Schedule 场景。
  2. HTTP 模块调用 POST /twitter/advanced_search/page
  3. Iterator 遍历推文行。
  4. Google Sheets Append Row 写入 tweet_id、作者、文本、created_at 与 URL。

配方 3:粉丝导出到 CRM

  1. HTTP 模块调用 POST /v3/twitter/users/followers
  2. Iterator 处理粉丝行。
  3. CRM 按 user_id upsert。
  4. 数据存储保存 next_cursor 供下次场景运行。

Router 分支

分支 条件 操作
空结果 tweets 长度为 0 静默停止。
高互动 like_count 超过阈值 发送 Slack 告警。
继续分页 has_moretrue 存储 next_cursor
错误 状态为 401403429 路由到运维通知。

测试清单

  • 用小页大小(如 5 条推文)运行一次。
  • 确认 Iterator 每条推文收到一个 bundle。
  • 写入行前确认用 tweet_id 去重。
  • 确认数据存储含最新 next_cursor
  • 清理场景日志中的 API 密钥。

下一步

这个页面有帮助吗?