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

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

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

## 选择 Make 自动化模式

<CardGroup cols={2}>
  <Card title="标准 HTTP 模块" icon="link">
    定时或 webhook 驱动场景下用 Make HTTP 模块直接调用 TwexAPI REST。
  </Card>

  <Card title="Custom webhook + agent handoff" icon="webhook">
    接收 MCP capable AI Agent 的严格 JSON，再可视化路由行。
  </Card>

  <Card title="私有自定义集成应用" icon="boxes">
    相同 TwexAPI 操作在多个场景重复时打包可复用模块。
  </Card>
</CardGroup>

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

## 前置条件

* [TwexAPI API 密钥](https://twexapi.io/dashboard)
* 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 | 所选端点的 `GET` 或 `POST` |
| URL | `https://api.twexapi.io` 加相对路径 |
| Header | `Authorization: Bearer YOUR_API_KEY` |
| Body type | POST 请求用 Raw JSON |

一致处理状态码：

<CardGroup cols={2}>
  <Card title="401" icon="key-round">
    认证失败。检查 TwexAPI API 密钥。
  </Card>

  <Card title="403" icon="shield-check">
    访问被拒。检查账号访问与额度。
  </Card>

  <Card title="429" icon="timer">
    速率限制。重试前等待并保留游标。
  </Card>

  <Card title="5xx" icon="triangle-alert">
    服务不可用。指数退避重试。
  </Card>
</CardGroup>

## 入门模块

| 模块 | 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` |

### 搜索推文示例

```json
{
  "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_page` 或 `has_more` 为 true 时在 Make 数据存储保存 `next_cursor`。

## 输出 handoff

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

<CardGroup cols={2}>
  <Card title="推文搜索分页" icon="search">
    存储查询；映射 `tweet_id`、`text`、`author_username`、`created_at`、`has_next_page`、`next_cursor`。
  </Card>

  <Card title="用户画像记录" icon="user-round">
    存储 `user_id`、`username`、`name`、粉丝数与查询输入。
  </Card>

  <Card title="趋势话题榜单" icon="trending-up">
    存储国家、主题、内容标签与推文行及场景元数据。
  </Card>

  <Card title="写入操作 (发推/点赞/关注)" icon="send">
    用 [CLI](/sdks/cli) `--dry-run` 预览。写操作需 cookie 或 `auth_token`。
  </Card>
</CardGroup>

## 配方 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：

```text
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_more` 为 `true` | 存储 `next_cursor`。 |
| 错误 | 状态为 `401`、`403` 或 `429` | 路由到运维通知。 |

## 测试清单

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

## 下一步

* [Zapier](/guides/zapier)
* [Pipedream](/guides/pipedream)
* [n8n](/guides/n8n)
* [Agent MCP Handoff](/mcp/agent-handoff)
