SuperAPI AI 工具集

import-x-history

通用与其它

查看项目

更新于 10-16 03:17

技能介绍

用途:通过 x.pcstyle.dev(与 mdfromx.com 为同一服务)批量导入某个 X(Twitter)账号的历史帖子,一次请求即可获取数百至数千条,包含回复与转推,返回 JSON 或 NDJSON。

主要能力:核心调用为 GET /api/v1/profiles/{handle}/posts,响应含 profile、posts、meta。posts 按最新在前,保留上游原始字段(id、text、created_at、author、replying_to、quote、reposted_by、media、poll、likes、replies、retweets、quotes、views、bookmarks、url)。参数包括 since、until、max_posts(默认 500,上限 5000)、with_replies、with_reposts、only_replies、format(json/ndjson)、concurrency(默认 16,上限 32)、refresh、index。meta 提供 count、oldest、newest、truncated、next_until、warnings、floor_reached、archive 等字段。服务按 handle 存档,重复导入只抓取缺口;index=true 可免费查看存档范围。

使用方式:匿名无需密钥,按地址限流 10 次/15 分钟;带密钥默认 60 次/15 分钟,密钥通过 Authorization: Bearer $X_MD_API_KEY 发送,环境变量存在时使用且不要打印。示例:curl -sS -H "Authorization: Bearer $X_MD_API_KEY" "https://x.pcstyle.dev/api/v1/profiles/paulg/posts?since=2025-09-01&max_posts=2000"。NDJSON 用 -N 流式读取,需检查末尾 meta 行。

适用场景:批量拉取账号历史用于分析、存档或内容研究;配合 since 实现 3 个月→1 年→全部的分段加载。

限制:只读,不会发帖、关注,也不读取受保护账号、私信或 Lists。错误为 RFC 9457 problem JSON,含 401、400、404、429、503(import_busy、upstream_rate_limited、upstream_unavailable)等,需按 Retry-After 重试。转推时间戳为原帖时间而非转推事件时间。存档中的互动数据为存储时数值,需最新数据时传 refresh=true。托管服务同时只允许两个 fresh walk,属准入限制而非吞吐保证。