X (Twitter)X (Twitter)Social

Recent tweets of a user by user id — engagement metrics

x.x.user.posts

List the recent posts of an X user (your own or any public account)

Price
$0.005/resultAt provider cost
Success rate
95.4%Last 30 days · 564 calls
Latency p50
197 msp95 1.6 s
Last verified
Jul 28, 2026Verified working
GEThttps://toolswitch.dev/v1/tools/x.x.user.posts?max_results=5&tweet.fields=id%2Ctext%2Ccreated_at%2Cpublic_metricsPreview
Try onlineComing soonProvider docs ↗
  • Uses platform quota
  • Synchronous response
  • Reads public data

Parameters

each post returned is billed to the app owner at $0.005 — size max_results to what you actually need

ParameterTypeRequiredDescriptionExample
Path parameters
idstringRequirednumeric user id — from x.user.profile (data.id), NOT the @handle44196397
Query parameters
excludestringOptionalcomma-separated: retweets, repliesretweets,replies
start_timestringOptionalRFC 3339; the timeline reaches back at most 3,200 posts regardless2026-07-01T00:00:00Z
max_resultsintegerOptional5–100, default 1010
tweet.fieldsstringOptionalpublic_metrics carries likes/reposts/replies/impressionsid,text,created_at,public_metrics,referenced_tweets
pagination_tokenstringOptionalmeta.next_token from the previous response
  • Path parameters
  • idstringRequired

    numeric user id — from x.user.profile (data.id), NOT the @handle

    Example: 44196397

  • Query parameters
  • excludestringOptional

    comma-separated: retweets, replies

    Example: retweets,replies

  • start_timestringOptional

    RFC 3339; the timeline reaches back at most 3,200 posts regardless

    Example: 2026-07-01T00:00:00Z

  • max_resultsintegerOptional

    5–100, default 10

    Example: 10

  • tweet.fieldsstringOptional

    public_metrics carries likes/reposts/replies/impressions

    Example: id,text,created_at,public_metrics,referenced_tweets

  • pagination_tokenstringOptional

    meta.next_token from the previous response

Code samples

Replace $TOOLSWITCH_KEY with the key you created in the console.

Preview
curl -X GET 'https://toolswitch.dev/v1/tools/x.x.user.posts?max_results=5&tweet.fields=id%2Ctext%2Ccreated_at%2Cpublic_metrics' \
  -H "X-Toolswitch-Key: $TOOLSWITCH_KEY"

This gateway API is in preview; its URL and authentication may change. The example parameters are sample data. Calls are billed at $0.005/result, including the service fee.