twitterapi-io

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

twitterapi-io

twitterapi-io

Use the local skill script for read-only twitterapi.io access.
This skill exists to make common twitterapi.io reads simple and low-noise instead of rebuilding custom API calls each time.
使用本地skill脚本实现twitterapi.io的只读访问。
本skill的存在是为了简化常见的twitterapi.io读取操作,减少冗余,无需每次都重新构建自定义API调用。

Quick rules

快速规则

  • Use this skill only for reads.
  • Do not improvise posting/like/reply/delete flows.
  • Prefer compact JSON output by default.
  • Use
    --raw
    only when you actually need full API objects.
  • Prefer the official docs links in
    references/links.md
    when validating endpoint behavior.
  • 仅将本skill用于读取操作。
  • 不要自行实现发布/点赞/回复/删除流程。
  • 默认优先使用精简JSON输出。
  • 仅在你确实需要完整API对象时使用
    --raw
    参数。
  • 验证端点行为时,优先使用
    references/links.md
    中的官方文档链接。

Local setup

本地设置

Prefer the skill-local script over any global CLI install. Prefer a saved config file over shell-exported environment variables.
No package install is required for the local script. Use:
bash
<skill-path>/scripts/twitterapi-io
Primary config path:
bash
~/.config/twitterapi-io/config.json
Recommended one-time setup:
bash
<skill-path>/scripts/twitterapi-io auth --api-key YOUR_KEY
That writes the API key to the config file so later reads work without needing to source
.env
.
优先使用skill本地脚本,而非任何全局CLI安装。 优先使用保存的配置文件,而非shell导出的环境变量。
本地脚本无需安装任何包。使用方式:
bash
<skill-path>/scripts/twitterapi-io
主配置路径:
bash
~/.config/twitterapi-io/config.json
推荐的一次性设置命令:
bash
<skill-path>/scripts/twitterapi-io auth --api-key YOUR_KEY
该命令会将API密钥写入配置文件,后续读取操作无需加载
.env
即可运行。

Commands

命令

Show built-in help

查看内置帮助

bash
<skill-path>/scripts/twitterapi-io help
bash
<skill-path>/scripts/twitterapi-io help

Authenticate once

单次身份验证

bash
<skill-path>/scripts/twitterapi-io auth --api-key YOUR_KEY
You can also use env as an override or fallback:
bash
export TWITTERAPI_IO_KEY='YOUR_KEY'
bash
<skill-path>/scripts/twitterapi-io auth --api-key YOUR_KEY
你也可以使用环境变量作为覆盖或回退方案:
bash
export TWITTERAPI_IO_KEY='YOUR_KEY'

Fetch one tweet

获取单条推文

bash
<skill-path>/scripts/twitterapi-io tweet --url 'https://x.com/jack/status/20'
or:
bash
<skill-path>/scripts/twitterapi-io tweet --id 20
bash
<skill-path>/scripts/twitterapi-io tweet --url 'https://x.com/jack/status/20'
或:
bash
<skill-path>/scripts/twitterapi-io tweet --id 20

Fetch one user

获取单个用户信息

bash
<skill-path>/scripts/twitterapi-io user --username OpenAI
bash
<skill-path>/scripts/twitterapi-io user --username OpenAI

Fetch recent tweets for a user

获取用户近期推文

bash
<skill-path>/scripts/twitterapi-io user-tweets --username OpenAI --limit 10
Include replies:
bash
<skill-path>/scripts/twitterapi-io user-tweets --username OpenAI --limit 10 --include-replies
bash
<skill-path>/scripts/twitterapi-io user-tweets --username OpenAI --limit 10
包含回复:
bash
<skill-path>/scripts/twitterapi-io user-tweets --username OpenAI --limit 10 --include-replies

Fetch replies to a tweet

获取推文的回复

bash
<skill-path>/scripts/twitterapi-io replies --url 'https://x.com/jack/status/20' --limit 20
Optional unix-time filters:
bash
<skill-path>/scripts/twitterapi-io replies --id 20 --since-time 1741219200 --until-time 1741305600 --limit 20
bash
<skill-path>/scripts/twitterapi-io replies --url 'https://x.com/jack/status/20' --limit 20
可选的Unix时间戳过滤:
bash
<skill-path>/scripts/twitterapi-io replies --id 20 --since-time 1741219200 --until-time 1741305600 --limit 20

Fetch quote tweets

获取引用推文

bash
<skill-path>/scripts/twitterapi-io quotes --id 20 --limit 20
bash
<skill-path>/scripts/twitterapi-io quotes --id 20 --limit 20

Fetch thread context

获取推文串上下文

bash
<skill-path>/scripts/twitterapi-io thread-context --id 20 --limit 40
bash
<skill-path>/scripts/twitterapi-io thread-context --id 20 --limit 40

Fetch mentions for a user

获取用户被提及的内容

bash
<skill-path>/scripts/twitterapi-io mentions --username OpenAI --limit 20
bash
<skill-path>/scripts/twitterapi-io mentions --username OpenAI --limit 20

Advanced search

高级搜索

bash
<skill-path>/scripts/twitterapi-io search --query 'AI agents -filter:replies' --from-user OpenAI --within-time 24h --max-tweets 50
Use
Top
results when needed:
bash
<skill-path>/scripts/twitterapi-io search --query 'AI agents' --queryType Top --max-pages 2
Use explicit unix-time operators when needed:
bash
<skill-path>/scripts/twitterapi-io search --query '$BTC' --since-time 1741219200 --until-time 1741305600 --max-tweets 50
bash
<skill-path>/scripts/twitterapi-io search --query 'AI agents -filter:replies' --from-user OpenAI --within-time 24h --max-tweets 50
需要时使用「热门」结果:
bash
<skill-path>/scripts/twitterapi-io search --query 'AI agents' --queryType Top --max-pages 2
需要时使用显式Unix时间戳运算符:
bash
<skill-path>/scripts/twitterapi-io search --query '$BTC' --since-time 1741219200 --until-time 1741305600 --max-tweets 50

Workflow

工作流

  1. Read
    references/links.md
    if you need the underlying official twitterapi.io docs links.
  2. Use the local skill script.
  3. Ensure the API key exists in
    ~/.config/twitterapi-io/config.json
    or via env.
  4. Use
    tweet
    ,
    user
    ,
    user-tweets
    ,
    replies
    ,
    quotes
    ,
    thread-context
    ,
    mentions
    , or
    search
    as needed.
  5. Keep reads narrow and intentional.
  1. 如果你需要底层twitterapi.io官方文档链接,请查阅
    references/links.md
  2. 使用本地skill脚本。
  3. 确保API密钥已保存在
    ~/.config/twitterapi-io/config.json
    中或通过环境变量提供。
  4. 根据需要使用
    tweet
    user
    user-tweets
    replies
    quotes
    thread-context
    mentions
    search
    命令。
  5. 保持读取操作范围明确、意图清晰。

Expected outputs

预期输出

The CLI returns JSON. Parse it instead of scraping human text.
Default output is compact and low-noise. Use
--raw
when full endpoint payloads are actually needed.
CLI返回JSON格式内容。请直接解析JSON,而非爬取人工可读文本。
默认输出为精简低冗余格式。仅在确实需要完整端点返回载荷时使用
--raw
参数。

Files

文件说明

  • Package repo:
    https://github.com/ropl-btc/twitterapi-io-cli
  • Launcher:
    scripts/twitterapi-io
  • Python implementation:
    scripts/twitterapi_io.py
  • Official docs links:
    references/links.md
  • Config storage:
    ~/.config/twitterapi-io/config.json
  • .env
    is optional fallback only; it is not the preferred long-term setup.
  • 代码仓库:
    https://github.com/ropl-btc/twitterapi-io-cli
  • 启动器:
    scripts/twitterapi-io
  • Python实现:
    scripts/twitterapi_io.py
  • 官方文档链接:
    references/links.md
  • 配置存储路径:
    ~/.config/twitterapi-io/config.json
  • .env
    仅为可选回退方案,不推荐作为长期设置使用。

When to stop and ask

需要停止并询问的场景

Stop and ask before:
  • adding write/posting capabilities
  • adding login-cookie flows
  • adding broad/high-cost scraping defaults
  • changing how API key storage works
在进行以下操作前请先询问:
  • 新增写入/发布功能
  • 新增登录Cookie流程
  • 新增大范围/高成本的爬取默认配置
  • 修改API密钥存储的实现逻辑