# X / Twitter

Measured data from X — the platform formerly known as Twitter (x.com / twitter.com) — one operation per call. Handles come from evidence (a pasted x.com URL, a handle you SAW, a prior answer) — never typed from a person's name. The blue badge is a paid subscription and is reported as `isBlueVerified`, never as verification. ops: profiles (batch of @handles or profile URLs; add include.posts to get each account's recent posts IN THE SAME CALL), posts (one account, deep — likes, replies, reposts, quotes, views, bookmarks and the reply/quote lineage per post; includes the author card when held), search (find ACCOUNTS by keyword), searchPosts (find POSTS by keyword — what X is saying about something, across authors), history (stored follower/following/post-count series, free). Ops are independent — issue several as PARALLEL tool calls. Fresh fetches cost credits; anything already held is free.

`POST https://api.zomler.com/api/v1/platforms/x_twitter`

-   [profiles](#profiles)
-   [posts](#posts)
-   [search](#search)
-   [searchPosts](#searchPosts)
-   [history](#history)

## profiles

from 1 credit · fresh for 7 days

Profile cards for up to ten accounts, by @handle or pasted profile URL. `include.posts` adds each account's recent posts to the same answer.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `subjects` (required) | list of string | — | 1-10 items |
| `include` | object | `—` | — |
| `include.posts` | object | `—` | — |
| `include.posts.limit` | integer | `10` | 1-50 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/x_twitter \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "profiles",
    "subjects": [
      "example"
    ]
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/x_twitter", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "profiles",
      "subjects": [
        "example"
      ]
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/x_twitter",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "profiles",
        "subjects": [
          "example"
        ]
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

## posts

from 2 credits for 10 · fresh for 1 day

One account's recent posts with engagement — includes the author's profile card when held.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `subject` (required) | string | — | ≤400 chars |
| `limit` | integer | `10` | 1-50 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/x_twitter \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "posts",
    "subject": "example"
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/x_twitter", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "posts",
      "subject": "example"
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/x_twitter",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "posts",
        "subject": "example"
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

## search

from 5 credits for 10

Find ACCOUNTS by keyword — a name, a topic, a bio phrase.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `query` (required) | string | — | ≤300 chars |
| `limit` | integer | `10` | 1-25 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/x_twitter \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "search",
    "query": "example"
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/x_twitter", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "search",
      "query": "example"
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/x_twitter",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "search",
        "query": "example"
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

## searchPosts

from 3 credits for 10

Find POSTS by keyword — what X is saying about something. The content itself, across all authors, newest-relevant first.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `query` (required) | string | — | ≤300 chars |
| `limit` | integer | `10` | 1-50 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/x_twitter \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "searchPosts",
    "query": "example"
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/x_twitter", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "searchPosts",
      "query": "example"
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/x_twitter",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "searchPosts",
        "query": "example"
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

## history

free · reads what is held

The stored time series — free, reads only what captures already wrote.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `subjects` (required) | list of string | — | 1-10 items |
| `metric` | enum | `followers` | `followers`, `following`, `posts_count` |
| `days` | integer | `90` | 1-730 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/x_twitter \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "history",
    "subjects": [
      "example"
    ]
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/x_twitter", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "history",
      "subjects": [
        "example"
      ]
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/x_twitter",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "history",
        "subjects": [
          "example"
        ]
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

---

Source: https://zomler.com/docs/api/platforms/x_twitter
