返回顶部
t

twtapiTwtAPI数据访问

Access live Twitter/X data through TwtAPI's hosted public skill gateway. Search tweets, look up users, read timelines, inspect followers and following, fetch tweet details, and check trends with structured JSON for OpenClaw and other compatible skill runners.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.2.0
安全检测
已通过
107
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

twtapi

TwtAPI - Twitter/X 数据

通过 TwtAPI 托管的技能网关访问实时 Twitter/X 数据。搜索推文、查找用户、阅读时间线、浏览关注者以及查看趋势,所有数据均以专为 AI 智能体构建的结构化 JSON 格式返回。请访问 https://www.twtapi.com/en/ 获取您的技能密钥。

设置

  1. 1. 安装公共技能:

clawhub install twtapi

  1. 2. 注册并打开 TwtAPI 控制面板中的 Skill 标签页。
  2. 复制您的专属 skill_key。
  3. 设置所需的环境变量:

export TWTAPISKILLKEY=tsk-your-skill-key

默认已内置公共托管网关 https://skill.twtapi.com,因此大多数用户无需设置基础 URL。

如果您需要覆盖网关以进行自托管或自定义部署,可以选择设置:

export TWTAPISKILLBASE_URL=https://your-skill-host.example.com

如果您使用 OpenClaw,也可以在 ~/.openclaw/openclaw.json 中设置 skills.twtapi.env.TWTAPISKILLKEY。其他兼容的技能运行器只需以等效方式注入 TWTAPISKILLKEY 即可。

验证技能连接

设置完成后,首先运行以下命令:

python3 {baseDir}/scripts/twtapi.py tools

如果认证和路由配置正确,您将获得可用技能工具的 JSON 列表。

使用方法

搜索推文

python3 {baseDir}/scripts/twtapi.py search AI agents
python3 {baseDir}/scripts/twtapi.py search #bitcoin --type Top --count 10
python3 {baseDir}/scripts/twtapi.py search from:elonmusk --cursor scroll_xxx

查找用户资料

python3 {baseDir}/scripts/twtapi.py user elonmusk
python3 {baseDir}/scripts/twtapi.py user-by-id 44196397

获取用户推文/回复/媒体

需要数字用户 ID。如果您只有用户名,请先查找用户。

python3 {baseDir}/scripts/twtapi.py tweets 44196397
python3 {baseDir}/scripts/twtapi.py tweets 44196397 --count 5
python3 {baseDir}/scripts/twtapi.py replies 44196397
python3 {baseDir}/scripts/twtapi.py media 44196397

通过 ID 获取单条推文

python3 {baseDir}/scripts/twtapi.py tweet 1897023456789012345

列出关注者/正在关注

python3 {baseDir}/scripts/twtapi.py followers 44196397 --count 50
python3 {baseDir}/scripts/twtapi.py following 44196397

获取热门话题

python3 {baseDir}/scripts/twtapi.py trending

工作流程提示

  • - 用户名 → 用户 ID:先运行 user ,然后使用结果中的 rest_id 进行 tweets、followers 等操作。
  • 分页:大多数列表命令接受 --cursor 参数用于获取下一页。当有更多结果可用时,响应中会包含光标值。
  • 搜索运算符:search 命令支持 Twitter 搜索语法——from:handle、to:handle、#hashtag、lang:en、日期范围等。

注意事项

  • - 此技能使用 TwtAPI 托管的公共网关加上您的专属 skillkey,而不是您的主 API 密钥。
  • 托管网关已内置。大多数最终用户只需设置 TWTAPISKILL_KEY。
  • 每次 API 调用都会消耗您 TwtAPI 账户中的积分。
  • 返回来自 TwtAPI 技能后端的原始 Twitter JSON。请以可读格式呈现结果,包括帖子内容、作者名称、指标和时间戳。
  • 速率限制和积分余额由您的套餐管理。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 twtapi-1776012423 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 twtapi-1776012423 技能

通过命令行安装

skillhub install twtapi-1776012423

下载

⬇ 下载 twtapi v1.2.0(免费)

文件大小: 4.86 KB | 发布时间: 2026-4-13 12:24

v1.2.0 最新 2026-4-13 12:24
**Big change: Improved setup process and clarified configuration for TwtAPI skill.**

- Default hosted gateway URL is now built in; most users only need to set `TWTAPI_SKILL_KEY`.
- Environment variable requirements simplified (no longer mandates `TWTAPI_SKILL_BASE_URL`).
- Installation and setup steps clarified for OpenClaw and compatible runners.
- Documentation updated for new onboarding flow and best practices.
- Metadata updated to reflect streamlined environment requirements.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部