Skip to content

fix: adapt to Twitter API schema changes (April 2026)#51

Open
nemoaigc wants to merge 2 commits intopublic-clis:mainfrom
nemoaigc:fix/api-migration-2026-04
Open

fix: adapt to Twitter API schema changes (April 2026)#51
nemoaigc wants to merge 2 commits intopublic-clis:mainfrom
nemoaigc:fix/api-migration-2026-04

Conversation

@nemoaigc
Copy link
Copy Markdown

Summary

  • User profile fields empty: Twitter migrated name, screen_name, created_at from legacy{} to core{}, profile image to avatar.image_url, and location to location.location. Updated parse_user_result() and fetch_user() with fallback to legacy for older response shapes. Affects user, whoami, status, followers, following.
  • user-posts returns empty: Two compounding bugs — missing required includePromotedContent variable (HTTP 422), and instructions path changed from timeline_v2 to timeline. Both fixed with legacy fallback.
  • followers/following return 404: Both endpoints now require POST. Added use_post flag to _fetch_user_list() and enabled it for both callers.
  • Refreshed 15/20 stale FALLBACK_QUERY_IDS from fa0311/twitter-openapi.

Test plan

  • twitter user elonmusk — name, profileImageUrl, createdAt populated
  • twitter user-posts elonmusk -n 5 — returns tweets (was empty)
  • twitter followers elonmusk -n 3 — returns users (was 404)
  • twitter following elonmusk -n 3 — returns users
  • twitter feed, twitter search, twitter bookmarks — still working

🤖 Generated with Claude Code

nemoaigc and others added 2 commits April 17, 2026 13:22
- User fields migrated out of legacy{}: name/screen_name/created_at now
  live in core{}, profile image in avatar.image_url, location in
  location.location. Update parse_user_result() and fetch_user() to read
  from the new locations with legacy fallback.

- UserTweets: add missing includePromotedContent variable (was causing
  HTTP 422); update instructions path from timeline_v2 to timeline with
  v2 fallback.

- Followers/Following: both endpoints now require POST. Add use_post flag
  to _fetch_user_list() and enable it for both callers.

- Refresh all stale FALLBACK_QUERY_IDS from fa0311/twitter-openapi
  (15 of 20 IDs had changed).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The queryId refresh in the previous commit bumped SearchTimeline to
VhUd6vHVmLBcw0uX-6jMLA; align the pinned-value regression test with it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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