# 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/workflows/x
- Handle: `@x`
- Category: [Social](https://fous.com/workflows/category/social)
- Source website: https://x.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with X.

## Methods

### Get post

Operation `get_post`, version 1. 1 credit per call.

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 call.

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

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@x","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## 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

### Is Fous affiliated with X?

No. Fous is not affiliated with X. This workflow reads the public x.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check 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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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 workflows](https://fous.com/workflows/category/social)
