# X Post Search

> Run X Post Search by x online or via API. From $0.15 per run, no setup.

**URL:** https://inference.sh/apps/x/post-search
**Last updated:** 2026-08-11

---

Search recent posts on X.com. Use conversation_id to get replies to a tweet, or any X search query. Returns up to 100 posts with text, author, and engagement metrics.

- app: `x/post-search`
- maker: [x](https://inference.sh/apps/x.md)
- category: [social](https://inference.sh/apps/category/social.md)
- tasks: [social media](https://inference.sh/apps/tag/social-media.md)
- price: $0.15/call
- runs via: api, javascript and python sdk, belt cli, mcp

## post-search API Guide

### About
search recent posts on x.com. use conversation_id to get replies to a tweet, or any x search query. returns up to 100 posts with text, author, and engagement metrics.

### 1. Calling the API

#### Install the Client

```bash
pip install inferencesh
```

#### Setup Your API Key
Set `INFERENCE_API_KEY` as an environment variable. Get your key from settings → api keys.

```bash
export INFERENCE_API_KEY="inf_your_key"
```

#### Run and Get Result

```python
import os
from inferencesh import inference

client = inference(api_key=os.environ["INFERENCE_API_KEY"])


result = client.run({
        "app": "x/post-search@0j2qghjg",
        "input": {
            "query": "query"
        }
    })

print(result["output"])
```

#### Stream Live Updates

```python
import os
from inferencesh import inference

client = inference(api_key=os.environ["INFERENCE_API_KEY"])


## stream=True yields updates as they arrive
for update in client.run({
        "app": "x/post-search@0j2qghjg",
        "input": {
            "query": "query"
        }
    }, stream=True):
    if update.get("progress"):
        print(f"progress: {update['progress']}%")
    if update.get("output"):
        print(f"output: {update['output']}")
```

### 2. Authentication
The API uses API keys for authentication. See the authentication docs for detailed setup instructions.

### 3. Files

#### Automatic Upload

```python
## local file paths are automatically uploaded
result = client.run({
    "app": "x/post-search@0j2qghjg",
    "input": {
        "image": "/path/to/local/image.png",  # detected & uploaded
        "audio": "https://example.com/audio.mp3",  # url passed through
    }
})
```

#### Manual Upload

```python
## upload and get a hosted URL
file = client.files.upload("/path/to/file.png")
print(file.uri)  # https://cloud.inference.sh/...
```

### 4. Schema

#### Input
- **query** (string) *required*: X search query. Use 'conversation_id:TWEET_ID' to get replies to a tweet, or any standard X search query (keywords, from:user, to:user, etc.)
- **max_results** (integer): Maximum number of results to return (10-100)
- **sort_order** (string): Sort order: 'relevancy' or 'recency'

#### Output
- **posts** (array): List of matching posts
- **result_count** (integer): Number of posts returned

## other social apps

- [X Post Analytics](https://inference.sh/apps/x/post-analytics.md): $0.15/call
- [X Trending Topics](https://inference.sh/apps/x/trends.md): $0.15/call
- [X Following List](https://inference.sh/apps/x/following-list.md): $0.15/call
- [X Followers List](https://inference.sh/apps/x/followers-list.md): $0.15/call
- [X Post Likers](https://inference.sh/apps/x/post-likers.md): $0.15/call

## faq

### how much does X Post Search cost?

$0.15/call. you pay per run from your inference shell credits. no subscription is required.

### how do I run X Post Search via api?

call x/post-search with the javascript or python sdk, the rest api, or `belt app run x/post-search` from a terminal. the api reference on this page lists every input.

### who makes X Post Search?

X Post Search is made by x and runs on inference shell. every x app is listed at https://inference.sh/apps/x.

### can my agent use X Post Search?

yes. agents call it as a tool through the inference shell mcp server (https://api.inference.sh/mcp), the belt cli or the sdk, and pay per run like you do.

### what are the alternatives to X Post Search?

other social apps on inference shell include X Post Analytics, X Trending Topics, X Following List, X Followers List. they run through the same api, so switching is a one-line change.
