Skip to content

feat(channels): add Xquik as X/Twitter search source via API key#260

Open
kriptoburak wants to merge 2 commits into
Panniantong:mainfrom
kriptoburak:feat/xquik-channel
Open

feat(channels): add Xquik as X/Twitter search source via API key#260
kriptoburak wants to merge 2 commits into
Panniantong:mainfrom
kriptoburak:feat/xquik-channel

Conversation

@kriptoburak
Copy link
Copy Markdown

@kriptoburak kriptoburak commented Apr 10, 2026

Summary

  • Add Xquik as a new X/Twitter channel using its REST API
  • Returns full engagement metrics: likes, retweets, replies, quotes, views, bookmarks
  • Uses stdlib urllib only - zero new dependencies
  • 27 unit tests covering all methods and edge cases

Why

The existing Twitter channel requires twitter-cli (cookie-based, GraphQL scraping). Xquik provides an alternative X/Twitter backend that:

  • Works with a simple API key (no browser cookies, no AUTH_TOKEN/CT0 extraction needed)
  • Search is stable (not affected by Twitter's frequent GraphQL endpoint changes - the current social.md warns search "可能不稳定")
  • Returns richer engagement data (views + bookmarks on top of likes/retweets/replies/quotes)
  • Uses pure Python with no subprocess spawning or CLI tool installation
  • Works in SSH, Docker, headless, and CI environments where browser cookie extraction isn't possible

Users who have an Xquik API key get X/Twitter search, tweet lookup, user profiles, and trends without needing to install twitter-cli or extract browser cookies. Both channels can coexist - users choose based on their setup.

Changes

File What
agent_reach/channels/xquik.py Channel module: search_tweets(), get_tweet(), search_users(), get_user(), get_trends()
tests/test_xquik_channel.py 27 unit tests (check, search, lookup, trends, edge cases, internals)
agent_reach/channels/__init__.py Register XquikChannel in ALL_CHANNELS
agent_reach/config.py Add xquik to FEATURE_REQUIREMENTS
agent_reach/skill/SKILL.md Add Xquik search command + trigger keyword
agent_reach/skill/references/social.md Full usage guide with curl + Python examples
agent_reach/skill/references/social.md Add TweetClaw as the OpenClaw plugin option for users who want Xquik through plugin tools
.env.example Add XQUIK_API_KEY
tests/test_channel_contracts.py Add xquik URL sample to contract test
tests/test_channels.py Assert xquik is registered in channel list

Test plan

  • python -m pytest tests/test_xquik_channel.py -v - 27/27 pass
  • python -m pytest tests/ -v - 105/105 pass (zero regressions)
  • ruff check - clean
  • ruff format --check - clean
  • Existing test_twitter_channel tests still pass (no changes to twitter.py)
  • Docs-only follow-up: git diff --check clean and TweetClaw docs links verified

Built with Claude Code

Adds XquikChannel — an API-key-based alternative to twitter-cli for X/Twitter
search, tweet lookup, user profiles, and trends. No CLI tools to install,
no browser cookies needed, stable search (not affected by GraphQL changes).

Returns full engagement metrics: likes, retweets, replies, quotes, views,
bookmarks. Uses stdlib urllib only — zero new dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant