Skip to content

feat(twitter): search tweets across communities (0.85.0, SCR-756) - #113

Merged
0xGhostCasper merged 1 commit into
mainfrom
kasparasizi1/scr-756-communities-search-tweets
Nov 30, 2026
Merged

0xGhostCasper merged 1 commit into
mainfrom
kasparasizi1/scr-756-communities-search-tweets

Conversation

@0xGhostCasper

Copy link
Copy Markdown
Member

What changes

GET /v1/twitter/communities/search_tweets went live on 2026-11-30 (SCR-749): the Top and Latest tabs of X's community search page, tweets across every community, each with the community it was posted in. The SDK had no method for it. (SCR-756)

  • twitter.communities.search_tweets_across_communities(query, *, tweet_type, count, cursor) returns PaginatedResponse[CommunityTweet].
  • twitter.communities.search_tweets_across_communities_all(query, *, tweet_type, max_pages, max_items) pages automatically.
  • CommunityTweet: a Tweet with community_id and community_name. The plain Tweet model drops unknown fields, so it would lose both.
  • CommunitySearchTweetType: TOP (default), LATEST.

Fixed along the way: from scrapebadger.twitter import CommunityTweetType raised ImportError, although the Twitter guide's own example imports it that way. It is exported now, with the two new names.

Version 0.85.0, changelog and docs/twitter.md updated.

How it was tested

  • tests/test_twitter_communities_search_tweets.py: the community on each tweet, the default tab, the Latest tab with count and cursor, the iterator across two pages with max_items, the exports.
  • ruff check, ruff format --check, mypy src/ and the full suite (--ignore=tests/e2e) pass.

Not run: the e2e suite against the live API.

How it ships

  1. Merge this and scrape-badger/scrapebadger-node's PR before the monorepo PR: that one adds these methods to sdk/codegen/facade/python-v1-surface.json, and the surface-lock fails if a listed method is not on this repo's main.
  2. Publish the GitHub release v0.85.0 (PyPI). main holds nothing unreleased besides this change.

🤖 Generated with Claude Code

GET /v1/twitter/communities/search_tweets is the Top and Latest tabs of X's
community search page: tweets across every community, each with the community
it was posted in.

- twitter.communities.search_tweets_across_communities(query, *, tweet_type,
  count, cursor) -> PaginatedResponse[CommunityTweet]
- twitter.communities.search_tweets_across_communities_all(...) with automatic
  pagination
- CommunityTweet: a Tweet with community_id and community_name (the plain
  Tweet model would drop them)
- CommunitySearchTweetType: TOP, LATEST

Fixed: CommunityTweetType was not exported from scrapebadger.twitter, so the
Twitter guide's own import raised ImportError.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants