# glim.sh Twitter Search

> glim.sh Twitter Search is a paid API for AI agents from glim.sh, paid per call via x402, $0.005/call, status healthy (last checked 2026-10-22, last successful call 2026-10-17).

Search Twitter/X for tweets matching a query with optional date filtering, sorting, and pagination, without needing a Twitter API key.

## Facts

- Endpoint: POST https://glim.sh/api/v1/twitter/search?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: healthy
- Last checked: 2026-10-22
- Last successful call: 2026-10-17
- Success rate: 99% of calls made through Zero
- Rating: 4.7 / 5 from 3 reviews
- Activations on Zero: 161
- Tags: x402
- Canonical page: https://www.zero.xyz/c/glim-sh-twitter-search-12dfedd2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_azUeWscapXM9H31ORsgc3

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 glim-sh-twitter-search-12dfedd2 -d '<json body>'
```

Example prompt: Search Twitter for the latest tweets about the OpenAI GPT-5 release from the past week — sort by Latest and show me the first page of results.

## When to prefer this

Use this endpoint when you need to search Twitter/X for tweets matching keywords, hashtags, or advanced operators without setting up a Twitter developer account or managing API keys. Ideal for agents that need live social media data on demand, with flexible date filtering and pagination support.

## Known failure modes

- Invalid or missing query returns an error
- Malformed date format causes a 400 bad request
- Invalid sort enum value rejected
- Expired or invalid cursor causes pagination error
- Rate limit or payment failure returns a 402 or 429 response
- No matching tweets returns an empty tweet array with count 0

## How this service works

Search tweets with advanced operators (recommended). Body param is `query` (not q), e.g. {"query":"from:elonmusk AI min_faves:100"}

## Output

Returns a JSON object containing an array of matched tweets (each with tweet ID, text, and author username), a total count, a boolean indicating if more results exist, and a pagination cursor for fetching the next page.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "sort": {
   "enum": [
    "latest",
    "top"
   ],
   "type": "string",
   "description": "Sort order: \"top\" (most engaged matching tweets) or \"latest\" (newest first). Default: \"top\"."
  },
  "query": {
   "type": "string",
   "maxLength": 1000,
   "minLength": 1,
   "description": "Search query with advanced operators"
  },
  "cursor": {
   "type": "string",
   "maxLength": 500,
   "description": "Pagination cursor"
  },
  "end_date": {
   "type": "string",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:?\\d{2}))?$",
   "description": "Only tweets before this time. YYYY-MM-DD (inclusive through end of day UTC) or ISO 8601 datetime with Z/offset (e.g. 2026-04-13T14:30:00Z)"
  },
  "start_date": {
   "type": "string",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:?\\d{2}))?$",
   "description": "Only tweets on or after this time. YYYY-MM-DD (UTC midnight) or ISO 8601 datetime with Z/offset (e.g. 2026-04-13T14:30:00Z)"
  },
  "expand_urls": {
   "type": "boolean",
   "default": false,
   "description": "When true, auto-crawl entity URLs and attach crawled_content to tweets. Off by default: responses can grow by up to 4KB per expanded URL. Use glim_web_crawl(url) for targeted crawls instead."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "tweets": [
   {
    "id": "123",
    "text": "Hello",
    "author": {
     "username": "elonmusk"
    }
   }
  ],
  "has_more": true,
  "next_cursor": "abc123"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/glim-sh-twitter-search-12dfedd2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from glim.sh](https://www.zero.xyz/host/glim.sh/llms.txt)
