X (Twitter) API Client for Openclaw

A versatile Python-based X (Twitter) API client designed for automated tweet searching, article retrieval, and trend analysis.

zaaachary
v1.0.1
Feb 13, 2026
2
2.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install x-twitter-api

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install x-twitter-api using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is X (Twitter) API Client?

The X (Twitter) API skill provides a robust interface for interacting with X data programmatically. It enables developers and researchers to search the last seven days of tweets using advanced operators, retrieve detailed article content via URLs or IDs, and monitor global or regional trending topics.

This tool is built to handle both Bearer Token (app-only) and OAuth 2.0 authentication, making it a core utility within the ecosystem of Openclaw Skills for anyone needing real-time social media intelligence. Whether you are conducting academic research, monitoring brand sentiment, or building automated news feeds, this skill streamlines the technical overhead of the X API.

X (Twitter) API Client Use Cases

  • Monitoring brand mentions or specific hashtags using advanced search operators.
  • Automating content curation by retrieving article text directly from tweet URLs.
  • Analyzing global or regional market sentiment through trending topic tracking.
  • Building datasets for research by exporting tweet history to JSON or Markdown.
  • Identifying verified user sentiment by filtering search results for high-signal data.

How X (Twitter) API Client Works

  1. The user configures the environment with a valid X Bearer Token obtained from the X Developer Portal.
  2. Commands are executed via specific Python scripts to target endpoints such as search, articles, or trends.
  3. The client processes advanced query operators to filter results by language, user, or engagement type.
  4. Data is fetched from the API, with internal logic handling rate limits (429 errors) and network retries.
  5. Results are formatted into structured JSON, human-readable text, or exported to local files.

X (Twitter) API Client Setup

To use this within the context of Openclaw Skills, you must first obtain credentials from the X Developer Portal.

# Set your environment variable
export X_BEARER_TOKEN="your_bearer_token_here"

# Run a test search query
python3 scripts/search_tweets.py --query "Openclaw Skills" --count 5

Ensure you have Python 3 installed. For permanent configuration, add the export command to your shell profile.

X (Twitter) API Client Data Schema & Taxonomy

The skill organizes data into structured formats suitable for both machine processing and human review:

Data Type Description Output Formats
Tweet Data Text, ID, Author Info, and Engagement Metrics JSON, Pretty Print
Articles Full content extracted from X articles or long-form posts Markdown, JSON
Trends Trending topics filtered by WOEID (Where On Earth ID) JSON, Pretty Print
Metadata Rate limit status, pagination tokens, and query parameters JSON

X (Twitter) API Client Advanced Features

  • Advanced query support including operators like -is:retweet, has:links, and is:verified for precision filtering.
  • Built-in retry logic and automatic handling of 429 rate limit errors to ensure reliable data collection.
  • Multi-format export capabilities allowing users to save results directly to .json or .md files.
  • Regional intelligence gathering using WOEID parameters for localized trend analysis across different countries.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins python3
Github Stars: 0
forks: 0

Featured*