---
title: "Search recent tweets"
method: GET
path: "/v1/twitter/search"
tags: ["Twitter Engagement"]
---

# Search recent tweets

`GET /v1/twitter/search`

Search public tweets from the last 7 days matching an X search query, e.g. to discover tweets to reply to.
The query string is passed through to X unchanged and supports X's search operators
(`from:user`, `-is:retweet`, `is:reply`, `lang:en`, `"exact phrase"`, `conversation_id:123`, boolean `OR`, ...).
Note that standalone operators like `is:` / `has:` / `lang:` must be combined with a keyword or `from:` clause.

To reply to a found tweet, pass its `id` as the twitter platform entry's `platformSpecificData.replyToTweetId` when creating a post.

Rate limit: 300 requests per 15-min window per connected account.

## Query parameters

- `accountId` string, required
- `query` string, required
- `limit` integer
- `sinceId` string
- `untilId` string
- `startTime` string, date-time
- `endTime` string, date-time
- `cursor` string
- `sortOrder` 'recency' | 'relevancy'

## Response `200`

Matching tweets

- object
  - `status` string
  - `tweets` object[]
    - `id` string
    - `text` string
    - `created` string, date-time
    - `conversationId` string
    - `inReplyToTweetId` string, nullable — Parent tweet ID when the result is itself a reply
    - `lang` string
    - `author` object
      - `id` string
      - `username` string
      - `displayName` string
      - `avatar` string
      - `verifiedType` string
    - `likeCount` integer
    - `replyCount` integer
    - `retweetCount` integer
    - `quoteCount` integer
    - `platform` string
  - `pagination` object
    - `hasMore` boolean
    - `cursor` string, nullable
  - `meta` object
    - `resultCount` integer
    - `newestId` string, nullable
    - `oldestId` string, nullable
    - `platform` string

## Other responses

- `400` — Bad request (invalid params, or X rejected the query as malformed)
- `401` — Unauthorized
- `402` — X API spend cap reached for this billing period
- `403` — X analytics capability not enabled for this account (code X_ANALYTICS_NOT_ENABLED)
- `404` — Account not found
- `429` — X search rate limit exceeded (300 requests per 15 minutes)

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/revisions/3c7cf84cec44/schema)
