# API Direct – Twitter/X Post Search

> API Direct – Twitter/X Post Search is a paid API for AI agents from x402.apidirect.io, paid per call via x402, $0.007/call, status unknown (last checked 2026-10-30).

Search for tweets (X posts) by keyword or advanced search operators, with optional pagination, date filtering, and AI sentiment analysis.

## Facts

- Endpoint: GET https://x402.apidirect.io/v1/twitter/posts?utm_source=zero.xyz
- Price: $0.007/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-direct-twitter-x-post-search-9e6a4b20
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_F5rSmYRKPQrSXEO7lFEGs

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-direct-twitter-x-post-search-9e6a4b20
```

Example prompt: Search X for tweets about 'AI regulation' from the past 7 days, sorted by most recent, and include sentiment analysis on each post.

## When to prefer this

Use this endpoint when you need to search public X/Twitter posts by keyword or advanced search operators, especially when time-filtering (past hour, day, week, month, or year, or a specific date range), sorting by recency or relevance, or enriching results with per-post AI emotion analysis. Prefer it over scraping or Twitter's own API when you need a simple pay-per-call REST interface without OAuth setup.

## Known failure modes

- Invalid posted_ago value (not in enum) returns HTTP 400
- Combining posted_ago with start_date or end_date returns HTTP 400
- start_date later than end_date returns HTTP 400
- Empty or too-long query (>500 chars) returns validation error
- Rate limiting or authentication failure returns HTTP 402 or 429
- No results found returns empty post list without error

## How this service works

Search for tweets by keyword.

## Output

Returns a merged list of X (Twitter) posts matching the search query, including post text, metadata (author, timestamp, engagement), and optionally a sentiment object per post containing emotion scores (joy, trust, fear, surprise, sadness, disgust, anger, anticipation each 0-100), dominant emotion, emotional intensity (0-10), and polarity (positive/negative/neutral). Pagination merges up to 20 pages into one response.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "query"
     ],
     "properties": {
      "pages": {
       "type": "integer",
       "default": 1,
       "maximum": 20,
       "minimum": 1,
       "description": "Number of pages to fetch and merge into one response (1-20, billed per page). Fetching stops early when there are no more results."
      },
      "query": {
       "type": "string",
       "maxLength": 500,
       "minLength": 1,
       "description": "Search query (max 500 characters). Supports X's search operators (https://help.x.com/en/using-x/x-advanced-search)."
      },
      "sort_by": {
       "enum": [
        "most_recent",
        "relevance"
       ],
       "type": "string",
       "default": "most_recent",
       "description": "Sort order for results"
      },
      "end_date": {
       "type": "string",
       "format": "date",
       "description": "Only return posts up to and including this date (YYYY-MM-DD, UTC). Must not be earlier than start_date. Can't be combined with posted_ago."
      },
      "posted_ago": {
       "enum": [
        "1h",
        "24h",
        "7d",
        "30d",
        "12m"
       ],
       "type": "string",
       "description": "Only return posts from this period: 1h (past hour), 24h (past day), 7d (past week), 30d (past month), or 12m (past year). Works with both sort orders. Omit for all time. Can't be combined with start_date or end_date. Any other value returns 400."
      },
      "start_date": {
       "type": "string",
       "format": "date",
       "description": "Only return posts from this date onward (YYYY-MM-DD, UTC). Can't be combined with posted_ago."
      },
      "get_sentiment": {
       "type": "boolean",
       "default": false,
       "description": "Set to true to add AI emotion analysis to each post. Adds a `sentiment` object containing `emotions` (joy, trust, fear, surprise, sadness, disgust, anger and anticipation, each scored 0-100), `dominant_emotion`, `emotional_intensity` (0-10), and `polarity` (positive, negative or neutral). Any post t"
      }
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-direct-twitter-x-post-search-9e6a4b20/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.apidirect.io](https://www.zero.xyz/host/x402.apidirect.io/llms.txt)
