# Threads Posts API

Get Threads posts with post id, text, posted, author username, author name, author id, by handles or search keywords.

**Pricing:** $0.0025 per post

**Endpoint:** `POST /v1/data/threads/posts/run`

**Auth:** `Authorization: Bearer mk_live_...`

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `handles` | array | No | One or more handles. One request reads them all. |
| `queries` | array | No | One or more search keywords. One request reads them all. |
| `postedAfter` | date | No | Posted After as a date (YYYY-MM-DD). |
| `postedBefore` | date | No | Posted Before as a date (YYYY-MM-DD). |
| `maxResults` | integer | No | How many posts to return in total. Defaults to 100; use 0 for all. |

## Example

`?wait=true` holds the request open until the run finishes (up to 60s) and returns the rows inline: one request, no polling.

```bash
curl -X POST "https://api.mindcase.co/v1/data/threads/posts/run?wait=true" \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params":{}}'
```

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/v1/data/threads/posts/run",
    params={"wait": "true"},
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {}},
)
rows = resp.json()["data"]
```

## Longer runs

If the run is still going at the 60s ceiling you get back `{ job_id, status: "running" }` instead of rows (same if the result is over 100 rows; those come back `truncated`). Poll with that `job_id`:

```bash
# 1) check status
curl https://api.mindcase.co/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/v1/jobs/JOB_ID/results \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"
```

Full API reference (auth, jobs, balance, SDKs, MCP): https://mindcase.co/skills.md

## Response columns

| Field | Display name | Type |
|-------|--------------|------|
| `postUrl` | Post URL | url |
| `postId` | Post ID | text |
| `text` | Text | text |
| `posted` | Posted | text |
| `authorUsername` | Author Username | text |
| `authorName` | Author Name | text |
| `authorId` | Author ID | text |
| `authorVerified` | Author Verified | boolean |
| `authorProfileUrl` | Author Profile URL | url |
| `likes` | Likes | number |
| `replies` | Replies | number |
| `reposts` | Reposts | number |
| `quotes` | Quotes | number |
| `shares` | Shares | number |
| `views` | Views | number |
| `likesHidden` | Likes Hidden | boolean |
| `type` | Type | text |
| `image` | Image | url |
| `videoUrl` | Video URL | url |
| `images` | Images | object_array |
| `videos` | Videos | object_array |
| `altText` | Alt Text | text |
| `hashtags` | Hashtags | array |
| `mentions` | Mentions | array |
| `outboundLinks` | Outbound Links | array |
| `linkPreview` | Link Preview | object |
| `language` | Language | text |
| `isReply` | Is Reply | boolean |
| `replyToUsername` | Reply To Username | text |
| `isQuote` | Is Quote | boolean |
| `quotedPost` | Quoted Post | object |
| `isRepost` | Is Repost | boolean |
| `repostedPost` | Reposted Post | object |
| `isPinned` | Is Pinned | boolean |
| `isEdited` | Is Edited | boolean |
| `paidPartnership` | Paid Partnership | boolean |
| `threadId` | Thread ID | text |
| `positionInThread` | Position In Thread | number |
| `threadLength` | Thread Length | number |
| `replyControl` | Reply Control | text |
