# X API

> X returns public profile and post data as a workflow and API.

X, also known as Twitter, returns public profile details through Get profile; provide a username or profile link. Get post returns public post text, author, media, quoted post, and engagement; provide the post link.

- Page: https://fous.com/tools/x
- Handle: `@x`
- Category: [Social](https://fous.com/tools/category/social)
- Source website: https://x.com
- Last verified: Sep 29, 2026

## Methods

### Get post

Operation `get_post`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get a public X post, its author, media, quoted post and engagement from its link. Deleted, protected and unavailable posts cannot be returned.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `post` | string | yes | `"https://x.com/NASAJPL/status/1950583566947213444"` | Link to the public X post, for example https://x.com/NASA/status/2041915225776009742. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "post"
  ],
  "properties": {
    "post": {
      "type": "string",
      "description": "Link to the public X post, for example https://x.com/NASA/status/2041915225776009742.",
      "examples": [
        "https://x.com/NASAJPL/status/1950583566947213444",
        "https://x.com/NASA/status/2041915225776009742",
        "https://x.com/MarkosharkOnSol/status/1950672945569026316"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "post": "https://x.com/NASAJPL/status/1950583566947213444"
    },
    {
      "post": "https://x.com/NASA/status/2041915225776009742"
    },
    {
      "post": "https://x.com/MarkosharkOnSol/status/1950672945569026316"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `likes` | integer | `567` |  |
| `media` | array |  |  |
| `media[].type` | string | `"photo"` |  |
| `media[].image_or_thumbnail_link` | string | `"https://pbs.twimg.com/media/GxHdAf0bgAAPO76.jpg"` |  |
| `views` | integer or null | `164367` | Null if the public page does not show views. |
| `quotes` | integer | `11` |  |
| `post_id` | string | `"1950583566947213444"` |  |
| `replies` | integer | `41` |  |
| `reposts` | integer | `110` |  |
| `language` | string or null | `"English"` |  |
| `full_text` | string | `"Launch success! NISAR is in orbit and communicating with @NASA and @ISRO teams after launching from India this morning ` |  |
| `post_link` | string | `"https://x.com/NASAJPL/status/1950583566947213444"` |  |
| `posted_at` | string | `"2025-07-30T15:45:37Z"` | Date and time in UTC. |
| `quoted_post` | object or null |  |  |
| `quoted_post.text` | string | `"Experience the magic of our Moon mission wherever you go! ✨\n\nDownload free, mobile wallpapers and bring your device i` |  |
| `quoted_post.author_username` | string | `"NASA"` |  |
| `quoted_post.author_display_name` | string | `"NASA"` |  |
| `author_username` | string | `"NASAJPL"` | Author username without the @ sign. |
| `author_display_name` | string | `"NASA JPL"` |  |

**Example input**

```json
{
  "post": "https://x.com/NASAJPL/status/1950583566947213444"
}
```

**Example output**

```json
{
  "likes": 567,
  "media": [
    {
      "type": "photo",
      "image_or_thumbnail_link": "https://pbs.twimg.com/media/GxHdAf0bgAAPO76.jpg"
    },
    {
      "type": "video",
      "image_or_thumbnail_link": "https://pbs.twimg.com/amplify_video_thumb/1950582192369004544/img/t8Ln3nL6kcIRjFWp.jpg"
    },
    {
      "type": "photo",
      "image_or_thumbnail_link": "https://pbs.twimg.com/media/GxHdZRdbsAAqxXa.jpg"
    }
  ],
  "views": 164367,
  "quotes": 11,
  "post_id": "1950583566947213444",
  "replies": 41,
  "reposts": 110,
  "language": "English",
  "full_text": "Launch success! NISAR is in orbit and communicating with @NASA and @ISRO teams after launching from India this morning 🚀\n\nThe mission will study Earth’s land and ice surfaces, providing critical insi…",
  "post_link": "https://x.com/NASAJPL/status/1950583566947213444",
  "posted_at": "2025-07-30T15:45:37Z",
  "quoted_post": null,
  "author_username": "NASAJPL",
  "author_display_name": "NASA JPL"
}
```

### Get profile

Operation `get_profile`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get the public X profile for a username or profile link, including counts, verification, images, and account details. Does not include posts or a timeline.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `username` | string | yes | `"NASA"` | X handle with or without @, or an X profile link, for example NASA or https://x.com/NASA. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "username"
  ],
  "properties": {
    "username": {
      "type": "string",
      "description": "X handle with or without @, or an X profile link, for example NASA or https://x.com/NASA.",
      "examples": [
        "NASA",
        "https://x.com/X",
        "OpenStreetMap"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "username": "NASA"
    },
    {
      "username": "https://x.com/X"
    },
    {
      "username": "OpenStreetMap"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `bio` | string or null | `"Making the seemingly impossible, possible. ✨"` | The public profile bio. |
| `posts` | integer or null | `74337` | Exact number of posts. |
| `location` | string or null | `"Pale Blue Dot"` | Location listed on the profile. |
| `username` | string | `"NASA"` | The account handle without @. |
| `followers` | integer or null | `92373836` | Exact follower count. |
| `following` | integer or null | `115` | Exact following count. |
| `x_user_id` | string | `"11348282"` | X user ID. |
| `joined_date` | string or null | `"2007-12-19"` | Date the account joined X (YYYY-MM-DD). |
| `display_name` | string | `"NASA"` | The account’s display name. |
| `profile_link` | string | `"https://x.com/NASA"` | Link to the X profile. |
| `website_link` | string or null | `"http://www.nasa.gov/"` | Expanded website link listed on the profile. |
| `banner_image_link` | string or null | `"https://pbs.twimg.com/profile_banners/11348282/1788992290"` | Public banner image link. |
| `verification_type` | string | `"government"` | Verification type: none, blue, business, or government. |
| `profile_picture_link` | string or null | `"https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg"` | Public profile picture link. |

**Example input**

```json
{
  "username": "NASA"
}
```

**Example output**

```json
{
  "bio": "Making the seemingly impossible, possible. ✨",
  "posts": 74337,
  "location": "Pale Blue Dot",
  "username": "NASA",
  "followers": 92373836,
  "following": 115,
  "x_user_id": "11348282",
  "joined_date": "2007-12-19",
  "display_name": "NASA",
  "profile_link": "https://x.com/NASA",
  "website_link": "http://www.nasa.gov/",
  "banner_image_link": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
  "verification_type": "government",
  "profile_picture_link": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg"
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@x",
  "visibility": "public",
  "operation": "get_post",
  "version": 1,
  "input": {
    "post": "https://x.com/NASAJPL/status/1950583566947213444"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@x\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_post\",\n  \"version\": 1,\n  \"input\": {\n    \"post\": \"https://x.com/NASAJPL/status/1950583566947213444\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@x",
  "visibility": "public",
  "operation": "get_post",
  "version": 1,
  "input": {
    "post": "https://x.com/NASAJPL/status/1950583566947213444"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/x`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_post`: Get post. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `get_profile`: Get profile. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-x https://api.fous.com/mcp/tools/x --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Review public account profiles and follower counts
- Compare profile verification and account details
- Track engagement on public posts
- Collect post text, media, and quoted-post details

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this X tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a X account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from x.com when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### How many followers does an X account have?

Get profile returns the exact follower count for a username or profile link.

### What engagement does a public post have?

Get post returns likes, replies, reposts, quotes, and views when the public page shows them.

### Who posted this, and what does the post say?

Get post returns the author’s username and display name, along with the post text.

## Related

- [Threads API](https://fous.com/tools/threads.md): Threads provides public profiles and posts, including recent posts, engagement and replies; private or login-only content is excluded, and replies may be limited to 10.
- [Mastodon API](https://fous.com/tools/mastodon.md): Mastodon provides public profiles and recent public posts, including hashtag posts, but excludes private and unlisted posts and may limit visibility to accounts known to mastodon.social or a selected server.
- [Instagram API](https://fous.com/tools/instagram.md): Instagram provides public photos, videos, profiles, exact headline counts, bio links, and profile pictures, plus recent public posts and reels; some profiles or posts require login, and view counts may be unavailable.
- [TikTok API](https://fous.com/tools/tiktok.md): TikTok returns public profiles and totals, recent pinned-first videos, and public video details and engagement; private content unavailable, and feeds may be incomplete or empty.
- [Substack API](https://fous.com/tools/substack.md): Substack returns public newsletters and recent public post details or text; paid posts expose previews or metadata, and some custom-domain newsletters may be unavailable.
- [Pinterest API](https://fous.com/tools/pinterest.md): Pinterest helps people discover and save visual ideas, returning public search results from the first page and visible profile boards, with monthly views only when shown.
- [Bluesky API](https://fous.com/tools/bluesky.md): Bluesky provides public profile details and latest posts, plus searches of up to 100 matching public posts; search results may lag behind new posts.
- [Reddit API](https://fous.com/tools/reddit.md): Reddit returns searchable public posts, community feeds/details, user profiles and recent activity, posts with up to 200 comments; unavailable content limits results; Top defaults weekly.
- [All Social tools](https://fous.com/tools/category/social)
