FetchPI
Log in

X user_posts API

X user_posts data in one REST call — normalized to the stable JSON schema shared across every FetchPI platform.

  • 1 documented endpoints
  • GET /v1/x/users/{username}/posts

Contract summary (English): List recent posts of a user (capability x.user_posts)

Normalized response entity
x/user_posts
capability
x.user_posts

Every response also carries freshness (cache / default / live) and billing metadata.

Use cases

  • Monitor what a {{platform}} account publishes, in order, with normalized per-item metrics.
  • Detect new activity when scheduled jobs re-query the feed — ideal for alerting and digest workflows.
  • Benchmark publishing cadence and engagement across accounts with comparable, structured output.

Response fields

X user posts response (normalized envelope)

Response envelope for GET /v1/x/users/{username}/posts. Cursor is opaque and platform-independent; when the upstream provider is switched the old cursors become invalid.

FieldTypeRequiredDescription
datapost[]Required—
next_cursorstring | nullRequiredOpaque pagination cursor; null when the list is exhausted.
meta.request_idstringRequired—
meta.freshness.modecache | default | liveRequired—
meta.freshness.age_secondsinteger | nullOptional—
meta.freshness.source_layercache | db | upstreamRequired—
meta.freshness.stalebooleanOptional—
meta.billing.cache_hitbooleanRequired—
meta.billing.amount_creditsintegerRequiredCredits actually charged for this request (the settlement unit; 1 credit = $0.0001, permanent).

Field notes are shown in the contract's original English.

Response meta

FieldTypeRequiredDescription
modecache | default | liveRequiredEffective mode after merging param > max_age > source policy (D-004).
age_secondsinteger | nullOptionalAge of served data; null when unknown.
source_layercache | db | upstreamRequiredWhich layer served the response (PRD §10).
stalebooleanOptionalTrue when stale data was served under stale_if_error / SWR (D-004).
billing.amount_creditsintegerRequiredMicro-USD (1e-6 USD) actually charged for this request.
billing.cache_hitbooleanRequired—

Field notes are shown in the contract's original English.

Example request & response

GET/v1/x/users/{username}/posts
curl -H "Authorization: Bearer $MESHDATA_API_KEY" \
  "https://api.fetchpi.com/v1/x/users/newdev/posts"
{
  "data": [
    {
      "id": "1842951234567890123",
      "platform": "x",
      "type": "post",
      "author": {
        "id": "2244994945",
        "username": "newdev",
        "display_name": "New Dev",
        "verified": false
      },
      "text": "One API for internet data.",
      "lang": "en",
      "created_at": "2026-09-17T12:34:56Z",
      "metrics": {
        "likes": 128,
        "reposts": 12,
        "replies": 4,
        "quotes": 1,
        "views": 5230
      },
      "in_reply_to": null,
      "attachments": [],
      "fetched_at": "2026-09-18T09:00:00Z"
    },
    {
      "id": "1842909876543210987",
      "platform": "x",
      "type": "post",
      "author": {
        "id": "2244994945",
        "username": "newdev",
        "display_name": "New Dev",
        "verified": false
      },
      "text": "Freshness modes explained.",
      "lang": "en",
      "created_at": "2026-09-16T08:00:00Z",
      "metrics": {
        "likes": 64,
        "reposts": 3,
        "replies": 1,
        "quotes": 0,
        "views": 1200
      },
      "in_reply_to": null,
      "attachments": [
        {
          "type": "photo",
          "url": "https://cdn.example.com/p/1.jpg",
          "width": 1024,
          "height": 512
        }
      ],
      "fetched_at": "2026-09-18T09:00:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6IjE4MjkwMDAwMDAwMDAwMDAwIn0",
  "meta": {
    "request_id": "req_01HTXQ8Z9HTQ",
    "freshness": {
      "mode": "default",
      "age_seconds": 0,
      "source_layer": "upstream",
      "stale": false
    },
    "billing": {
      "amount_credits": 300,
      "cache_hit": false
    }
  }
}

Free demo

Create a free account, grab an API key and call this endpoint from the browser-based Playground.

Try it in the Playground

Parameter tables, error codes and response semantics for this endpoint live in the API documentation.

Open the endpoint reference

Frequently asked questions

Can I poll the feed on a schedule?

Yes — the endpoint is a plain REST call, so any scheduler can re-query it. Use the freshness parameters to control how current each answer is and how it is billed.

Can I try this endpoint for free?

Yes — register an account, grab an API key and call it from the Playground in the console.

How is the user_posts capability billed?

Data API calls are billed per request in credits, with different cache/live freshness multipliers. Current per-capability prices live on the pricing page.

Pricing

Per-request credit billing with cache/live freshness options — current prices live on the pricing page.