如何用 TwexAPI 在 X 上寻找 AI Influencer
AI 话题在 X 上分散在很多类型的账号里:研究员、创业者、独立开发者、产品运营者、prompt engineer、newsletter 作者、投资人。如果完全靠手动搜索,很快就会变成重复劳动:搜关键词、打开 profile、复制 handle、再回到表格里判断值不值得跟进。
TwexAPI 的 Search User endpoint 可以把第一步变得更结构化。你可以搜索 AI founder、LLM engineer、AI product manager 这类关键词,拿到一组用户 profile,再根据 bio、粉丝数、认证状态、list 数量等字段做初筛。
这个工作流解决什么
这个工作流使用 GET /twitter/search-user/{keyword}/{target_count} 发现 profile 信息匹配 AI 关键词的 X 账号。
适合这些场景:
- 发布产品前建立 AI influencer 或合作伙伴名单。
- 找到讨论 LLM、AI agents、copilot、AI infra 的 founder 和 builder。
- 为账号监控、newsletter 选题或 analyst review 创建 seed list。
- 根据 profile fit、followers、verification、listed_count 对候选账号排序。
这个端点返回的是用户 profile 对象。它不能判断一个人是否可信、是否适合合作、是否应该联系。正确用法是先生成候选名单,再进入人工复核。
Endpoint
发送 GET 请求:
https://api.twexapi.io/twitter/search-user/{keyword}/{target_count}| Path 参数 | 类型 | 用途 |
|---|---|---|
keyword | string | 要搜索的用户关键词。建议使用 AI founder、LLM researcher、AI agents 这类具体短语。 |
target_count | integer | 返回用户数量。调 query 时先用小值,结果稳定后再增加。 |
请求需要 TwexAPI Bearer Token。
curl --request GET \
--url 'https://api.twexapi.io/twitter/search-user/AI%20founder/50' \
--header 'Authorization: Bearer <token>'成功响应包含 code、msg 和 data。data 是用户 profile 对象数组。
常用字段包括 id、name、screen_name、description、location、followers_count、following_count、listed_count、statuses_count、is_blue_verified、is_verified、verified_type、can_dm、profile_image_url、profile_banner_url、created_at 和 created_at_datetime。
1{
2 "code": 200,
3 "msg": "success",
4 "data": [
5 {
6 "id": "1717001045992251392",
7 "name": "Example AI Founder",
8 "screen_name": "example_ai",
9 "description": "Building AI agents for support teams",
10 "followers_count": 42000,
11 "listed_count": 310,
12 "is_verified": true,
13 "is_blue_verified": true,
14 "verified_type": "blue",
15 "can_dm": false
16 }
17 ]
18}选择更好的 AI 关键词
只搜 AI 会非常杂。更好的做法是围绕角色、主题和目标市场写多个窄关键词。
| 目标 | 示例关键词 |
|---|---|
| Startup 和产品声音 | AI founder, AI startup, AI product manager, AI operator |
| 技术账号 | LLM engineer, AI researcher, machine learning engineer, AI infrastructure |
| Agent 生态 | AI agents, agentic AI, AI workflow automation, coding agent |
| 营销和增长 | AI marketer, AI newsletter, AI creator, AI tools |
| 投资人和分析师 | AI investor, AI analyst, venture AI, AI fund |
建议跑多个窄查询,而不是一个大而泛的查询。这样后续 review 时能解释每个账号为什么进入候选池。
Python Client
先保持 API client 足够小,只负责拿 raw users。normalize、score、save 放到后面的函数里。
1import os
2from typing import Any
3from urllib.parse import quote
4
5import requests
6
7TOKEN = os.environ["TWEXAPI_BEARER_TOKEN"]
8BASE_URL = "https://api.twexapi.io/twitter/search-user"
9
10def search_users(keyword: str, *, target_count: int = 50) -> list[dict[str, Any]]:
11 encoded_keyword = quote(keyword)
12 url = f"{BASE_URL}/{encoded_keyword}/{target_count}"
13
14 response = requests.get(
15 url,
16 headers={"Authorization": f"Bearer {TOKEN}"},
17 timeout=30,
18 )
19 response.raise_for_status()
20 return response.json().get("data", [])
21
22if __name__ == "__main__":
23 users = search_users("AI founder", target_count=25)
24 for user in users[:10]:
25 print(
26 user.get("screen_name"),
27 user.get("followers_count"),
28 user.get("description"),
29 )生成可复核的候选行
第一版输出不要急着做 dashboard。先把每个账号整理成稳定的 review row,方便市场、分析师或 BD 快速扫。
1from typing import Any
2
3AI_TERMS = [
4 "ai",
5 "artificial intelligence",
6 "llm",
7 "agent",
8 "agents",
9 "machine learning",
10 "ml",
11 "copilot",
12 "automation",
13]
14
15def text_contains_ai_signal(text: str) -> bool:
16 lowered = text.lower()
17 return any(term in lowered for term in AI_TERMS)
18
19def to_candidate_row(user: dict[str, Any], keyword: str) -> dict[str, Any]:
20 description = user.get("description") or ""
21 followers_count = user.get("followers_count") or 0
22 listed_count = user.get("listed_count") or 0
23
24 return {
25 "keyword": keyword,
26 "user_id": user.get("id"),
27 "screen_name": user.get("screen_name"),
28 "name": user.get("name"),
29 "description": description,
30 "location": user.get("location"),
31 "followers_count": followers_count,
32 "listed_count": listed_count,
33 "is_verified": user.get("is_verified") is True,
34 "is_blue_verified": user.get("is_blue_verified") is True,
35 "verified_type": user.get("verified_type"),
36 "can_dm": user.get("can_dm"),
37 "profile_match": text_contains_ai_signal(description),
38 "profile_url": f"https://x.com/{user.get('screen_name')}",
39 "raw": user,
40 }给 shortlist 打分
Follower count 很显眼,但不能单独当成 influencer 判断。更稳的 triage score 应该同时看 profile relevance、listed_count、认证信号和 audience size。
1import math
2
3def candidate_score(row: dict[str, Any]) -> float:
4 score = 0.0
5
6 if row["profile_match"]:
7 score += 40
8 if row["is_verified"]:
9 score += 10
10 if row["is_blue_verified"]:
11 score += 5
12 if row["verified_type"] in {"business", "government"}:
13 score += 10
14
15 followers = row["followers_count"] or 0
16 listed = row["listed_count"] or 0
17 score += min(math.log10(followers + 1) * 10, 45)
18 score += min(math.log10(listed + 1) * 6, 20)
19
20 return round(score, 2)
21
22keywords = [
23 "AI founder",
24 "LLM engineer",
25 "AI agents",
26 "AI product manager",
27]
28
29candidates = []
30seen_user_ids = set()
31
32for keyword in keywords:
33 for user in search_users(keyword, target_count=50):
34 user_id = user.get("id")
35 if not user_id or user_id in seen_user_ids:
36 continue
37 seen_user_ids.add(user_id)
38
39 row = to_candidate_row(user, keyword)
40 row["score"] = candidate_score(row)
41 candidates.append(row)
42
43candidates.sort(key=lambda row: row["score"], reverse=True)
44
45for row in candidates[:25]:
46 print(row["score"], row["screen_name"], row["followers_count"], row["profile_url"])这个分数只是 review queue,不应该自动决定赞助、合作或外联。
保存 CSV 和 raw JSONL
大多数团队第一版会用 spreadsheet 复核。CSV 放给人看,JSONL 保留 raw profile,方便后续 enrichment 和 audit。
1import csv
2import json
3from datetime import datetime, timezone
4from pathlib import Path
5
6timestamp = datetime.now(timezone.utc).isoformat()
7csv_path = Path("ai-influencer-candidates.csv")
8jsonl_path = Path("ai-influencer-candidates.raw.jsonl")
9
10fieldnames = [
11 "score",
12 "keyword",
13 "screen_name",
14 "name",
15 "description",
16 "location",
17 "followers_count",
18 "listed_count",
19 "is_verified",
20 "is_blue_verified",
21 "verified_type",
22 "can_dm",
23 "profile_url",
24]
25
26with csv_path.open("w", newline="", encoding="utf-8") as f:
27 writer = csv.DictWriter(f, fieldnames=fieldnames)
28 writer.writeheader()
29 for row in candidates:
30 writer.writerow({field: row.get(field) for field in fieldnames})
31
32with jsonl_path.open("w", encoding="utf-8") as f:
33 for row in candidates:
34 f.write(json.dumps({
35 "fetched_at": timestamp,
36 "candidate": row,
37 }, ensure_ascii=False) + "\n")
38
39print(f"Saved {len(candidates)} candidates")它在 influencer stack 里的位置
Search User 是 discovery step。更完整的 workflow 通常是:
- 用 Search User 生成候选账号。
- 用 profile metadata 去重和排除明显不匹配账号。
- 用 timeline 或 search endpoints 看近期内容。
- 需要 audience overlap 时,再看 followers/following。
- 只把人工复核后的账号放进 CRM、监控列表或合作流程。
这样每个账号都能追溯到发现它的关键词和评估字段。
常见坑
- 不要只搜
AI,用角色和主题词缩小范围。 - 不要把
can_dm: true写成保证送达。 - 不要只按粉丝数排序。
- 不要因为 bio 不清楚就自动删除,先放进人工复核。
- 保存 fetch time,因为 profile metadata 会变化。
- 用
id去重,不要只用screen_name,handle 可能会改。
小结
TwexAPI 的 Search User 端点适合把 AI 相关关键词转成可复核的 influencer shortlist。用多个窄关键词搜索,整理 profile 字段,保守打分,再把前排账号交给人工 review。
这样可以把“到处翻 profile”的工作变成可解释、可复用的发现流程。