Skip to content

Post-read shortcuts omit full text, long notes, articles, and media fields #91

Description

@kzu

Problem

The convenience shortcuts that read posts request a thin set of tweet.fields / expansions / user.fields, and no media.fields. That makes responses incomplete for common use cases (full post body, long posts, X Articles, images/video, author avatars).

Affected helpers in api/shortcuts.go:

Shortcut Current gaps (examples)
ReadPost No text, note_tweet, or article; no attachments.media_keys / media fields; no profile_image_url
SearchPosts Same class of gaps (no attachments/media, no full text/article fields)
GetUserPosts No text / note_tweet / article; no author expansion or media
GetTimeline Same
GetMentions Same
GetBookmarks Same
GetLikedPosts Same

Why it matters

X API v2 returns only the fields you ask for. With the current defaults:

  1. Full text is unreliable — without text and especially note_tweet, long posts can be truncated or missing the long-form body.
  2. X Articles are invisible — without article (and article media expansions), Article posts have no usable payload for title/cover/content-related data.
  3. Media is incompleteattachments alone is not enough; you need expansions=attachments.media_keys plus media.fields (e.g. url, preview_image_url, type, variants) to resolve images/video.
  4. Author presentation is thin — several endpoints omit profile_image_url / verified on expanded users, which agents and UIs need for a usable post card.

People using xurl read, search, timeline, mentions, bookmarks, likes, etc. reasonably expect a “full enough” post payload without hand-building query strings every time. Today they must drop to raw xurl get /2/tweets/... with a custom query.

Expected behavior

All post-read shortcuts should request a consistent, rich default set, for example:

  • tweet.fields: include at least text, note_tweet, article, attachments, plus the existing useful fields (created_at, public_metrics, entities, …)
  • expansions: author_id, attachments.media_keys, article.cover_media, article.media_entities (and keep endpoint-specific ones like referenced_tweets.id where already present)
  • user.fields: username, name, verified, profile_image_url
  • media.fields: url, preview_image_url, type, variants

Write shortcuts (post, reply, like/bookmark/etc.) do not need to change.

Proposed direction

Expand the query strings on the seven read helpers above and add a regression test that asserts those query params are present on each endpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions