Discover/X API
live

X APIx.com

Fetch posts, engagement metrics, and profile data from any public X (Twitter) account. Two endpoints cover user timelines and profile metadata.

Endpoint health
verified 6h ago
get_user_profile
get_user_posts
2/2 passing latest checkself-healing
Endpoints
2
Updated
26d ago

What is the X API?

This API provides 2 endpoints for retrieving public data from X.com (formerly Twitter): get_user_posts returns a paginated timeline of recent posts with engagement metrics, media, and quoted tweets, while get_user_profile returns account metadata including follower counts, bio, and verification status. Both endpoints accept a username as the primary input and return structured JSON with over a dozen fields covering identity, content, and engagement signals.

Try it
Maximum number of posts to return per page
Pagination cursor from a previous response next_cursor field
X/Twitter username without the at sign
Whether to include retweets
api.parse.bot/scraper/a5441c3e-48bc-4f1b-8b42-8fccc7e99d45/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/a5441c3e-48bc-4f1b-8b42-8fccc7e99d45/get_user_posts?limit=5&username=elonmusk&include_retweets=true' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace x-com-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

from parse_apis.x_twitter_posts_api import Twitter, User, Post, IncludeRetweets

client = Twitter(api_key="YOUR_API_KEY")

# Fetch a user's profile
user = client.user("OpenAI")

# List their recent original posts (excluding retweets)
for post in user.posts.list(include_retweets=IncludeRetweets.FALSE, limit=5):
    print(post.text, post.favorite_count, post.retweet_count, post.created_at)
All endpoints · 2 totalmissing one? ·

Get recent posts from a specific X/Twitter user timeline. Returns post text, engagement metrics, media, quoted tweets, and pagination cursor. Supports filtering retweets. Paginates via an opaque cursor. The pinned tweet if any appears first with is_pinned=true.

Input
ParamTypeDescription
limitintegerMaximum number of posts to return per page
cursorstringPagination cursor from a previous response next_cursor field
usernamerequiredstringX/Twitter username without the at sign
include_retweetsstringWhether to include retweets
Response
{
  "type": "object",
  "fields": {
    "count": "integer - number of posts returned",
    "posts": "array of post objects with id, text, created_at, engagement metrics, user, media, urls, quoted_tweet",
    "username": "string - the requested username",
    "next_cursor": "string or null - pagination cursor for the next page"
  },
  "sample": {
    "data": {
      "count": 1,
      "posts": [
        {
          "id": "2064187087184650253",
          "url": "https://x.com/elonmusk/status/2064187087184650253",
          "text": "SpaceX AI Satellites",
          "urls": null,
          "user": {
            "id": "44196397",
            "name": "Elon Musk",
            "verified": false,
            "screen_name": "elonmusk",
            "followers_count": 240169234,
            "is_blue_verified": true,
            "profile_image_url": "https://pbs.twimg.com/profile_images/img.jpg"
          },
          "media": [
            {
              "url": "https://pbs.twimg.com/img.jpg",
              "type": "video",
              "video_url": "https://video.twimg.com/vid.mp4",
              "expanded_url": "https://x.com/SpaceX/status/123/video/1"
            }
          ],
          "language": "en",
          "is_pinned": true,
          "created_at": "Tue Jun 09 03:25:26 +0000 2026",
          "is_retweet": false,
          "view_count": 13082930,
          "quote_count": 481,
          "reply_count": 6138,
          "quoted_tweet": null,
          "retweet_count": 9194,
          "bookmark_count": 6709,
          "favorite_count": 42625,
          "conversation_id": "2064187087184650253",
          "in_reply_to_status_id": null
        }
      ],
      "username": "elonmusk",
      "next_cursor": null
    },
    "status": "success"
  }
}

About the X API

User Timeline Posts

The get_user_posts endpoint retrieves recent posts from a specified public account. Pass the username parameter (without the @ symbol) along with an optional limit to control page size. Each post object in the posts array includes id, text, created_at, engagement metrics, associated media, resolved urls, and a nested quoted_tweet object when applicable. If the account has a pinned post, it appears first in the array with is_pinned: true. Set include_retweets to control whether retweets appear in results. Paginate through a timeline by passing the next_cursor value from one response as the cursor parameter in the next request; a null next_cursor indicates the end of available results.

User Profile Metadata

The get_user_profile endpoint returns a single object with all publicly visible account metadata for a given username. Fields include id (the numeric user ID), name (display name), screen_name (handle), description (bio), location, url (the website link set on the profile), created_at (account creation date), verified (legacy blue checkmark status), media_count, and profile_url (the full X.com profile link). This endpoint takes only the username parameter and has no pagination since it returns a single record.

Data Scope and Limitations

Both endpoints cover publicly accessible accounts. Private or protected accounts are not accessible. The get_user_posts response includes the count of returned posts alongside the array and the echoed username. Engagement metrics are included at the post level, but the specific metric fields (such as likes, reposts, and replies) are part of each post object in the posts array. There is no search or keyword filtering within a user's timeline; results are ordered as they appear on the public timeline.

Reliability & maintenanceVerified

The X API is a managed, monitored endpoint for x.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when x.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official x.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
6h ago
Latest check
2/2 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Monitor a brand's X.com posting activity and engagement trends over time using get_user_posts
  • Aggregate follower counts and bio metadata for a list of accounts via get_user_profile
  • Build a cross-platform social dashboard that surfaces recent tweets alongside engagement metrics
  • Detect pinned posts on target accounts by checking is_pinned on the first post in the timeline
  • Track account creation dates and verification status for influencer vetting workflows
  • Collect quoted tweet chains by expanding the nested quoted_tweet field in post responses
  • Archive public timelines by paginating through next_cursor until it returns null
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does X.com have an official developer API?+
Yes. X offers an official developer API at developer.x.com (formerly developer.twitter.com) with tiered access plans. The official API requires applying for access, has its own pricing, and enforces separate rate limits and data restrictions.
What does get_user_posts return for accounts with pinned posts?+
The pinned post, if one exists, appears as the first item in the posts array with is_pinned set to true. All subsequent posts reflect the standard chronological timeline order. This lets you distinguish pinned content from regular posts without any additional filtering.
Can I retrieve posts from protected or private X accounts?+
No. Both endpoints only return data from publicly accessible accounts. Protected accounts whose posts are hidden behind a follow-approval wall are not accessible. The API covers public profile metadata and public timeline posts only.
Does the API support searching tweets by keyword or hashtag?+
Not currently. The API covers per-user timelines via get_user_posts and individual account metadata via get_user_profile. Keyword search, hashtag search, and trending topics are not included. You can fork this API on Parse and revise it to add a search endpoint covering those use cases.
How does pagination work for the user timeline?+
The get_user_posts response includes a next_cursor string when more posts are available. Pass that value as the cursor parameter in your next request to retrieve the following page. When next_cursor is null, you have reached the end of the available timeline data.
Page content last updated . Spec covers 2 endpoints from x.com.
Related APIs in Social MediaSee all →
threads.com API
Search for posts and users on Threads by keyword to discover content, view engagement metrics like likes and replies, and explore user profiles with their media. Find trending discussions and connect with creators all in one search experience.
xiaohongshu.com API
Retrieve detailed post content and user profile information from Xiaohongshu, including captions, images, engagement metrics, and creator details. Access public note data and creator profiles to research trending content and user activity on the platform.
news.ycombinator.com API
Browse Hacker News top/new/best/ask/show stories and job posts, search stories by keyword and timeframe, fetch user profiles, retrieve comment threads for a post, and compute basic engagement stats and trending stories.
reddit.com API
Search Reddit posts and comments across any subreddit. Retrieve post discussions with full comment threads, search by keyword, and browse subreddit feeds by category (hot, new, top, rising) with flexible sorting and pagination.
tiktok.com API
Retrieve detailed information about any public TikTok video including captions, media URLs, view counts, likes, and shares, plus access all comments posted on that video. Perfect for analyzing trending content, monitoring video performance, or building applications that need TikTok video data.
twitch.tv API
Search for Twitch streamers and channels, view their profiles and streaming details, and discover live streams organized by category. Find the content and creators you want to watch all in one place.
github.com API
Look up GitHub repositories and users: search repositories, fetch repository metadata, releases, issues and issue threads, browse repository files/trees, and retrieve user profiles and starred repositories.
thelayoff.com API
Monitor and search forum discussions about company layoffs, accessing post titles, content, author information, dates, and community reactions across TheLayoff.com. Browse through paginated results and dive into individual posts to read full reply threads and conversation details.