Перейти к навигации

How do I search the newest X posts instead of top results?

To search the newest X posts, call twitter.web.fetch_search_timeline with your search phrase in keyword and set search_type:"Latest" explicitly. Omitting search_type defaults to "Top", which returns X’s top search results. After a product launch, for instance, run a Latest search for new issue reports and a separate Top search for high-visibility discussions.

Which search type fits my task?

Tasksearch_typeKeep in the deliverable
Find recently discussed brand problemsLatestOriginal post ID, text, publication time, collection time, and follow-up evidence
Review what X’s top search results discussTopOriginal query and sort, response position, and supporting text
Compare both viewsSeparate Top and Latest searchesIndependent manifests, never one mixed cursor chain

Top is not a local likes-descending sort, and Latest is not a local timestamp sort. Preserve the order returned in each response; if you apply a custom local ranking later, label that ranking rule explicitly rather than describing custom rankings as official popularity.

Save requests before deciding which ones to execute

The examples below use the phrase weather forecast. Replace weather forecast with your actual query and save the Latest request body as request-latest.json:

{"action":"twitter.web.fetch_search_timeline","params":{"keyword":"weather forecast","search_type":"Latest"}}

Only when you also need the top-result view, save the Top request body separately as request-top.json:

{"action":"twitter.web.fetch_search_timeline","params":{"keyword":"weather forecast","search_type":"Top"}}

Check current pricing with the free Inspect call before approving requests. One Latest page currently costs an estimated $0.003; fetching one page of each sort mode costs an estimated $0.006. Writing the JSON files locally makes no API call, whereas the curl command below executes a new billed request. Avoid running both sort modes just for presentation or turning a one-page budget into automatic pagination.

mkdir x-latest-run-1 &&
curl -sS https://api.beatapi.io/v1/social-data/call \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @request-latest.json \
-D x-latest-run-1/headers.txt \
-o x-latest-run-1/response.json

Record the actual collection time and HTTP status next to x-latest-run-1, then verify status, action, request_id, and data.timeline in response.json because a completed HTTP request does not guarantee a succeeded result. If data.timeline is empty, follow the empty-search diagnosis before changing the query or search_type and paying for another call.

Can I switch from Top to Latest while following a cursor?

No. A data.next_cursor returned by a Top search cannot continue a Latest search. To fetch the next page, send the exact same keyword and search_type while adding only the returned cursor. Changing either search_type or keyword starts a new search from page one without a cursor, with its own cost record, manifest, and output folder. See the search CSV guide for collection and saved-response export.

Do not rerun collection just to repair a local CSV. Export the saved responses locally into two separate folders (top-review and latest-review). When the same tweet_id appears in both exports, both Top and Latest surfaced the same post rather than two distinct posts; match across exports by tweet_id and keep each observation’s collection time and counters without letting one export overwrite the other.

What should the final business brief contain?

For recent issues, list each post’s original ID or link, a brief supporting quote, the issue category, the reason to follow up, and the source timestamp; a result count alone is not a brief. For Top observations, attach the selected posts as evidence. Differences between a Top page and a Latest page do not establish a platform-wide sentiment shift. Never convert null views into zero; see the view-coverage report.

Contract reference: data:twitter.web.fetch_search_timeline.