> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-1651816f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# X API Overview

> Complete X API v2 reference covering Posts, users, Spaces, Direct Messages, lists, trends, media, compliance, streaming, and webhook endpoints.

export const Button = ({href, children}) => {
  return <div className="not-prose">
    <a href={href}>
      <button className="x-btn">
        <span>{children}</span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

The X API gives you programmatic access to X's public conversation. All endpoints below are available on [pay-per-use](/x-api/introduction) plans. Endpoints marked as Enterprise-only require an [Enterprise](/enterprise-api/introduction) plan.

***

## Endpoints

<CardGroup cols={3}>
  <Card title="Posts" icon="https://mintcdn.com/x-preview-mintlify-1651816f/Zz1h8xEOvmhkVUM5/icons/xds/icon-chat.svg?fit=max&auto=format&n=Zz1h8xEOvmhkVUM5&q=85&s=52ed065c749311b24f3c9140bccd0c27" href="/x-api/posts/lookup/introduction" width="24" height="24" data-path="icons/xds/icon-chat.svg">
    Search, retrieve, and publish posts. Access timelines, threads, and quote posts.
  </Card>

  <Card title="Users" icon="https://mintcdn.com/x-preview-mintlify-1651816f/K-eEdCJRHhkyE869/icons/xds/icon-person.svg?fit=max&auto=format&n=K-eEdCJRHhkyE869&q=85&s=13d9e469fff413a31e93df67df935f48" href="/x-api/users/lookup/introduction" width="24" height="24" data-path="icons/xds/icon-person.svg">
    Look up profiles, manage follows, blocks, and mutes.
  </Card>

  <Card title="Direct Messages" icon="https://mintcdn.com/x-preview-mintlify-1651816f/HwseckVv03g9gLf1/icons/xds/icon-envelope.svg?fit=max&auto=format&n=HwseckVv03g9gLf1&q=85&s=2f0163f5fdc6e45eaa45a6f5c0763dcb" href="/x-api/direct-messages/lookup/introduction" width="24" height="24" data-path="icons/xds/icon-envelope.svg">
    Send and receive private messages.
  </Card>

  <Card title="Spaces" icon="https://mintcdn.com/x-preview-mintlify-1651816f/K-eEdCJRHhkyE869/icons/xds/icon-microphone.svg?fit=max&auto=format&n=K-eEdCJRHhkyE869&q=85&s=9b801b5e4c09e6ee156c533f82843326" href="/x-api/spaces/lookup/introduction" width="24" height="24" data-path="icons/xds/icon-microphone.svg">
    Find live audio conversations and participants.
  </Card>

  <Card title="Lists" icon="https://mintcdn.com/x-preview-mintlify-1651816f/Zz1h8xEOvmhkVUM5/icons/xds/icon-bulleted-list.svg?fit=max&auto=format&n=Zz1h8xEOvmhkVUM5&q=85&s=f686dc1c1c1784379f33dc7cd9623a4b" href="/x-api/lists/list-lookup/introduction" width="24" height="24" data-path="icons/xds/icon-bulleted-list.svg">
    Create and manage curated lists of accounts.
  </Card>

  <Card title="Likes" icon="https://mintcdn.com/x-preview-mintlify-1651816f/zSMKM8auoinkH07e/icons/xds/icon-heart.svg?fit=max&auto=format&n=zSMKM8auoinkH07e&q=85&s=c73d60add5fae49e943adcfe976defad" href="/x-api/posts/likes/introduction" width="24" height="24" data-path="icons/xds/icon-heart.svg">
    Like and unlike posts. Look up who liked a post.
  </Card>

  <Card title="Trends" icon="https://mintcdn.com/x-preview-mintlify-1651816f/HwseckVv03g9gLf1/icons/xds/icon-feather-chart-line.svg?fit=max&auto=format&n=HwseckVv03g9gLf1&q=85&s=6b7d8021eb29c79daa94ae14422703c2" href="/x-api/trends/trends-by-woeid/introduction" width="24" height="24" data-path="icons/xds/icon-feather-chart-line.svg">
    Trending topics by location and personalized trends.
  </Card>

  <Card title="Media" icon="https://mintcdn.com/x-preview-mintlify-1651816f/rjNtlhCG823pbl_G/icons/xds/icon-photo.svg?fit=max&auto=format&n=rjNtlhCG823pbl_G&q=85&s=16879fd5f89f49f7e79149437b6b65c8" href="/x-api/media/introduction" width="24" height="24" data-path="icons/xds/icon-photo.svg">
    Upload images, videos, and GIFs. Manage subtitles and metadata.
  </Card>

  <Card title="Communities" icon="https://mintcdn.com/x-preview-mintlify-1651816f/K-eEdCJRHhkyE869/icons/xds/icon-people.svg?fit=max&auto=format&n=K-eEdCJRHhkyE869&q=85&s=adfb5be2ce9e33c4488c7ada865d1024" href="/x-api/communities/lookup/introduction" width="24" height="24" data-path="icons/xds/icon-people.svg">
    Look up and search communities.
  </Card>

  <Card title="Community Notes" icon="note-sticky" href="/x-api/community-notes/introduction">
    Create, evaluate, and search community notes.
  </Card>

  <Card title="News" icon="newspaper" href="/x-api/news/introduction">
    Search and retrieve news stories.
  </Card>

  <Card title="Compliance" icon="https://mintcdn.com/x-preview-mintlify-1651816f/ZFn1LEhKh3oa6RrP/icons/xds/icon-shield-check.svg?fit=max&auto=format&n=ZFn1LEhKh3oa6RrP&q=85&s=82bafe5f91a3f503aaa4785ce3db0443" href="/x-api/compliance/batch-compliance/introduction" width="24" height="24" data-path="icons/xds/icon-shield-check.svg">
    Batch compliance jobs and compliance streams.
  </Card>
</CardGroup>

***

## Streaming & real-time

<CardGroup cols={3}>
  <Card title="Filtered Stream" icon="https://mintcdn.com/x-preview-mintlify-1651816f/zSMKM8auoinkH07e/icons/xds/icon-filter.svg?fit=max&auto=format&n=zSMKM8auoinkH07e&q=85&s=e48244dc88901ce37cc1b961815a3294" href="/x-api/posts/filtered-stream/introduction" width="24" height="24" data-path="icons/xds/icon-filter.svg">
    Get posts delivered in real-time matching your filter rules.
  </Card>

  <Card title="X Activity" icon="bolt" href="/x-api/activity/introduction">
    Subscribe to real-time activity events like follows, likes, and profile updates.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/x-api/webhooks/introduction">
    Receive event data via HTTP callbacks.
  </Card>
</CardGroup>

***

## Enterprise-only

These endpoints require an [Enterprise plan](/enterprise-api/introduction).

<CardGroup cols={3}>
  <Card title="Volume Streams" icon="satellite-dish" href="/x-api/posts/volume-streams/introduction">
    Full firehose and language-specific streams.
  </Card>

  <Card title="Likes Streams" icon="https://mintcdn.com/x-preview-mintlify-1651816f/zSMKM8auoinkH07e/icons/xds/icon-heart.svg?fit=max&auto=format&n=zSMKM8auoinkH07e&q=85&s=c73d60add5fae49e943adcfe976defad" href="/x-api/stream/likes-streams-introduction" width="24" height="24" data-path="icons/xds/icon-heart.svg">
    Stream all or sampled likes in real-time.
  </Card>

  <Card title="Powerstream" icon="bolt" href="/x-api/powerstream/introduction">
    High-performance filtered streaming with advanced operators.
  </Card>

  <Card title="Analytics" icon="https://mintcdn.com/x-preview-mintlify-1651816f/_rwOCW1Ft9YqD8NX/icons/xds/icon-bar-chart.svg?fit=max&auto=format&n=_rwOCW1Ft9YqD8NX&q=85&s=0a5bf4142eebaf6947c813442c8be9db" href="/x-api/posts/get-post-analytics" width="24" height="24" data-path="icons/xds/icon-bar-chart.svg">
    Post and media engagement metrics at scale.
  </Card>

  <Card title="Account Activity" icon="https://mintcdn.com/x-preview-mintlify-1651816f/_rwOCW1Ft9YqD8NX/icons/xds/icon-bell.svg?fit=max&auto=format&n=_rwOCW1Ft9YqD8NX&q=85&s=a39b8da7436849dc868378620dd951dd" href="/x-api/account-activity/introduction" width="24" height="24" data-path="icons/xds/icon-bell.svg">
    Real-time user event subscriptions.
  </Card>

  <Card title="Stream Webhooks" icon="webhook" href="/x-api/webhooks/stream/introduction">
    Filtered stream delivery via webhooks.
  </Card>
</CardGroup>

***

## Quick start

```bash theme={null}
curl "https://api.x.com/2/users/by/username/xdevelopers" \
  -H "Authorization: Bearer $BEARER_TOKEN"
```

<CardGroup cols={2}>
  <Card title="Make your first request" icon="https://mintcdn.com/x-preview-mintlify-1651816f/rjNtlhCG823pbl_G/icons/xds/icon-rocket.svg?fit=max&auto=format&n=rjNtlhCG823pbl_G&q=85&s=376338bc41870861fa495176981cfddb" href="/x-api/getting-started/make-your-first-request" width="24" height="24" data-path="icons/xds/icon-rocket.svg">
    Get your credentials and call the API in minutes.
  </Card>

  <Card title="SDKs" icon="cube" href="/tools-and-libraries">
    Official Python and TypeScript libraries.
  </Card>
</CardGroup>
