How do I distinguish a peer's own X posts, quotes, replies and reposts?
To find posts written by an X account, fetch the account’s timeline with twitter.web.fetch_user_post_tweet and keep the records whose author ID matches the target account and that have no retweeted_tweet object. Keep replies and quote posts written by the target account when relevant, and label each row’s type during review.
Decide how each content role serves the research
Being reposted many times is different from being a repost. Likes, repost counts and quote counts are engagement measures; a value above zero does not establish content type.
When is strict filtering useful?
Use own_posts.py when you already have an independently verified account ID and need to keep other authors out of a conclusion. With only a handle and no trusted ID, use the account-observation workflow, which retains sources and unknowns without claiming strict attribution. Verify the account again after an identity change.
own_posts.py does not resolve unknown accounts and does not establish authorship beyond the supplied evidence. If a saved response unexpectedly omits a repost marker, the script cannot authenticate the row’s type independently. The exact claim of own_posts.py is “matching author and no repost object in the saved response”.
How should a teammate understand inclusions and exclusions?
Hand over selected-posts.csv/JSON together with observations.json, which holds the exclusions and unknowns. State the account, the pages, the observation times, the retained roles and the unresolved conditions. A clean-looking table does not show every original post the account ever published.
“Last two weeks” or “top three by engagement” needs a separate date and metric policy; own_posts.py applies no date or engagement ranking. For a study of product announcements only, review unrelated replies and other content manually and record each reason. Author matching is not a business-relevance review.
The sections below cover the account identity, the input manifest and the raw-page filter. Reuse saved pages first: local filtering makes no calls, fetches no other page and publishes nothing.
Use our account route, not another service’s tabs
Inspect data:twitter.web.fetch_user_post_tweet. The current action accepts screen_name or integer rest_id, plus an optional cursor. If both identities are sent, rest_id wins. twitter.web.fetch_user_post_tweet has no tab parameter; do not send tab=posts/replies/media. data.timeline holds the page, data.next_cursor continues the timeline, and data.pinned is separate.
The documented retweeted_tweet holds the original post of a repost. retweets is the number of reposts a post received, so a popular self-authored post with retweets > 0 is not automatically a repost. quotes is also an engagement count, not a flag that marks the row as a quote post. A quote post authored by the selected account stays in the selected set when the quote post has no retweeted_tweet object; own_posts.py does not infer quote status from the count. reply_to is the handle being replied to, not the parent post ID. Replies by the matching author stay included and visibly labeled; the selected set is not a dedicated Replies tab.
Which account identity can the strict helper use?
own_posts.py supports two identity routes:
- ID route: when the verified account ID is within
9007199254740991, request the account as integerrest_id. - Handle route: when the ID is beyond that safe numeric range, request screen_name only and keep the independently verified author ID as a string in the local manifest. Never send the large ID as an integer, and never place both identities in params.
The handle route avoids a numeric request parameter. The handle route does not repair old rounded requests and does not resolve an unknown handle automatically.
For the handle route, record verified_author_rest_id and identity_evidence outside params. identity_evidence should identify a previously checked account record and the record’s verification time, not merely “the first row in this response.” A nonempty evidence description is a provenance requirement, not automatic authentication. Keep the evidence private if the evidence contains internal account records. Every page must use the same handle, the exact expected ID and the same evidence record. After a handle rename or reassignment, start a new verified run; do not merge the pages.
If you only have a handle and no verified ID, use the account observation guide without strict attribution. In the inspected timelines, author names and handles were null, so neither the query handle nor a guessed data.user field establishes each row’s author. own_posts.py does not resolve unknown handles.
Save pages, then filter locally
Reuse any responses you already saved. Three new pages take three list requests; see BeatAPI pricing and record the items each page actually returned.
Create own-post-pages.json next to the saved raw responses. Replace every placeholder, including the illustrative account ID, with the actual request metadata. Do not reconstruct the request identity from the response afterwards.
For a previously verified handle/ID pair, use the manifest entry shape below. Both values are illustrative, not a verified live account; replace both values before sending a request.
To add a saved second page, append an entry with the same account identity, a cursor exactly equal to the previous response’s data.next_cursor, the page’s own request ID and the actual collection time. own_posts.py accepts 1–20 pages and validates a single continuous chain from the first page. The script does not fetch missing pages, repair repeated cursors or merge different accounts.
Save the script as own_posts.py and run python3 own_posts.py own-post-pages.json own-post-review:
What will I receive?
selected-posts.csvand JSON: unique rows whose original author ID matches the requested account and that do not carry a repost object. Text, raw publication date, reply indicator, source and collection time remain visible. Spreadsheet formula-like text is escaped in CSV; JSON keeps it exact.observations.json: every observed row, including duplicates, reposts, other authors and missing-author rows. An absent author is not silently treated as the requested account. An emptyretweeted_tweetobject still counts as a present repost object and is excluded conservatively.raw-NNN.json, input manifest andcoverage.json: byte-preserving raw sources, hashes, page metadata, actual next cursor and the scope. Matching duplicates keep one selected row but all observations; conflicting identity/text/date/reply metadata for the same ID stops the run. Metrics changing between pages are not used to change identity.- Pinned data stays in the raw response and is recorded as present, but is not appended to the selected timeline. Do not double-count a pinned post or mix an unvalidated object shape into the export.
For example, an offline fixture page built from the output contract holds one matching-author original, one matching-author quote, one matching-author reply, one repost, one other-author row and one row with a missing author. own_posts.py selects the first three rows.
own_posts.py applies no date window and no top-three engagement ranking. created_at keeps the original format, and history_complete stays false even when the last saved cursor is empty. For “last two weeks” or “best three,” define a separate time and metric policy and collect enough pages within budget; do not relabel a one-page sample as exhaustive.
Before handover, check that no selected row has a mismatched or missing author or a present repost object, that every selected ID traces to a raw page, that no existing output was overwritten, and that the run created no API call, schedule or message.

