Search posts on X (Twitter)
crawl4ai.x.search.postsThe posts X (Twitter) returns for a search, one row per post, in X's order: id, link, text, time, author, counts, views, language, media, and whether it is a reply, a quote or a repost. `query` is X search text (rust lang, from:nasa since:2026-10-01); `mode` latest or top; `limit` up to 100. `session` is your X login (`auth_token` and `ct0`, from the Crawl4AI Session extension), for this run only. Without it, only from:<account> (since:/until: allowed) in mode latest: the account's timeline, newest first; older days via a slower second source. Other queries are refused, not billed. Columns: id, url, text, created, author, author_name, likes, reposts, replies, quotes, views, language, media, is_reply, is_quote, is_repost.
- 价格
- $0.00065/success按供应商原价
- 成功率
- 98.1%近 30 天 · 989 次
- 延迟 p50
- 22 秒p95 117 秒
- 最后验证
- —尚未验证
POSThttps://toolswitch.dev/v1/tools/crawl4ai.x.search.posts预览- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
这个工具没有参数,详见供应商文档 ↗ 供应商文档
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
curl -X POST 'https://toolswitch.dev/v1/tools/crawl4ai.x.search.posts' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
-H "Content-Type: application/json" \
--data-raw '{"query":"rust lang"}'import os
import json
import requests
response = requests.request(
"POST",
"https://toolswitch.dev/v1/tools/crawl4ai.x.search.posts",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
json=json.loads("{\"query\":\"rust lang\"}"),
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/crawl4ai.x.search.posts", {
method: "POST",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
"Content-Type": "application/json",
},
body: JSON.stringify(JSON.parse("{\"query\":\"rust lang\"}")),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());网关接口为预览版,地址与鉴权方式可能调整。 示例参数仅为样例数据。 调用按 $0.00065/success 计费,已含服务费。