Skip to content

Commit 4553757

Browse files
committed
fix: switch SearchTimeline from GET to POST
X started rejecting GET on SearchTimeline ~2026-05-10. Verified live against 4 sessions (3 quarantined per the in-house streak counter, 1 fresh) × 3 queries each = 12 trials: GET (current twikit): 12/12 → 404 with content-length: 0 POST (this PR): 12/12 → 200 with 130-180 KB of search results The POST body is identical to what GET sent as URL-encoded params, plus ``queryId`` (added automatically by ``gql_post``) and ``fieldToggles`` moved from ``extra_params`` to ``extra_data``. Mirrors d60#412. The "shadow flag" pattern we initially observed (~75% of accounts 404'ing) was an artifact of GET enforcement, not per-account behaviour — POST works for every session.
1 parent fed8979 commit 4553757

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

twikit/client/gql.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,16 @@ async def search_timeline(
195195
}
196196
if cursor is not None:
197197
variables['cursor'] = cursor
198-
params = {
199-
'fieldToggles': {'withArticleRichContentState': False}
200-
}
201-
return await self.gql_get(
198+
# X started rejecting GET on SearchTimeline ~2026-05-10 — every GET
199+
# returns 404 with empty body across all account states (verified
200+
# against quarantined + healthy sessions alike). POST with the same
201+
# payload as JSON body returns 200 with full search results.
202+
# Mirrors d60/twikit#412.
203+
return await self.gql_post(
202204
Endpoint.SEARCH_TIMELINE,
203205
variables,
204206
SEARCH_TIMELINE_FEATURES,
205-
extra_params=params,
207+
extra_data={'fieldToggles': {'withArticleRichContentState': False}},
206208
)
207209

208210
async def similar_posts(self, tweet_id: str):

0 commit comments

Comments
 (0)