> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Twitter / X Profiles API

> Twitter (X) profiles: bio, follower counts, verification type, location and links. By handle, profile URL or keyword search; same record either way.

`POST /v1/data/twitter/profiles/run`

**Pricing:** $0.0005 per profile ($0.5 per 1,000).

## Ways to call it

* **Handle / URL**: set `inputs`
* **Search**: set `searchTerms` (optional: `maxResults`)

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**inputs** `string[]`

One per line. You can input profile URLs or handles (e.g. 'NASA' or '[https://x.com/NASA](https://x.com/NASA)').

**searchTerms** `string`

Keywords or topics to find X (Twitter) accounts for (e.g. 'climate scientist').

**maxResults** `integer`

Number of accounts to return. Use 0 for all.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/twitter/profiles/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "inputs": [
      "NASA",
      "elonmusk",
      "BarackObama"
    ]
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/twitter/profiles/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "inputs": [
        "NASA",
        "elonmusk",
        "BarackObama"
    ]
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/twitter/profiles/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "inputs": [
    "NASA",
    "elonmusk",
    "BarackObama"
  ]
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one profile, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `username` | Username | text |
| `profileUrl` | Profile URL | url |
| `displayName` | Display Name | text |
| `accountId` | Account ID | text |
| `bio` | Bio | text |
| `website` | Website | url |
| `bioLinks` | Bio Links | array |
| `location` | Location | text |
| `followers` | Followers | number |
| `following` | Following | number |
| `tweets` | Tweets | number |
| `mediaPosts` | Media Posts | number |
| `likesGiven` | Likes Given | number |
| `blueVerified` | Blue Verified | boolean |
| `verifiedType` | Verified Type | text |
| `accountType` | Account Type | text |
| `protected` | Protected | boolean |
| `accountCreated` | Account Created | text |
| `openDms` | Open DMs | boolean |
| `pinnedTweetUrl` | Pinned Tweet URL | url |
| `profilePicture` | Profile Picture | url |
| `coverImage` | Cover Image | url |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "twitter/profiles",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "protected": false,
      "mediaPosts": 11323,
      "pinnedTweetUrl": null,
      "accountType": null,
      "bioLinks": null,
      "accountId": "4667591756",
      "followers": 738153,
      "likesGiven": 2671,
      "accountCreated": "2015-12-28T13:39:42Z",
      "bio": "Startup India is GoI's initiative to build a strong ecosystem for entrepreneurship and innovation.",
      "profileUrl": "https://x.com/startupindia",
      "verifiedType": null,
      "profilePicture": "https://pbs.twimg.com/profile_images/2054141150890778624/ctsCWvei_400x400.jpg",
      "username": "startupindia",
      "openDms": false,
      "following": 51,
      "blueVerified": false,
      "coverImage": null,
      "location": "New Delhi, Delhi",
      "website": "http://startupindia.gov.in",
      "tweets": 25457,
      "displayName": "Startup India"
    }
  ]
}
```

## Related APIs

For their tweets use [`twitter/tweets`](https://docs.mindcase.co/apis/twitter/tweets); for followers use [`twitter/followers`](https://docs.mindcase.co/apis/twitter/followers).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.