# X / Twitter User Search

Search X Post via REST or OpenAny MCP—with pay-per-use pricing, no subscription, and no cookies required. Powered by anyapi, pass parameters such as query, and retrieve structured data including returned next cursor field, returned users field, and returned found field for content research and account lookup, and integration reference, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/market/apis/x/x-post-search/?offering=fde08b63-2afd-4f6a-a419-07df32d540e4
API ID: fde08b63-2afd-4f6a-a419-07df32d540e4
Provider: anyapi
Contract revision: 8
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/anyapi/v1/run/twitter.search_users
Page update time: 2026-12-03T02:53:49.788Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.0007 / call
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract. Price update time: not supplied.
Contract update time: 2026-12-03T02:53:47.674Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [
    {
      "default": "0.0007",
      "id": "max_cost_usd",
      "location": "query",
      "name": "max_cost_usd",
      "required": false,
      "type": "string"
    }
  ],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "701",
    "max_cost_micro_usd": "700",
    "quantities": [],
    "rounding": "ceil",
    "variants": [
      {
        "id": "capped_auto_routing",
        "label": "预算内自动选源",
        "price_micro_usd": "700",
        "when": [
          {
            "op": "eq",
            "parameter": "max_cost_usd",
            "value": "0.0007"
          }
        ]
      }
    ]
  }
}
```

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "X / Twitter User Search request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "fields": {
          "type": "string",
          "description": "Optional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item: each row of the API's result list, or the `data` object itself for an API that returns one record. Keys are matched relative to that item, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost."
        },
        "max_items": {
          "type": "integer",
          "description": "Optional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. An API that returns one record is not trimmed. Does not change cost.",
          "minimum": 0
        },
        "summary": {
          "type": "boolean",
          "description": "Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost."
        },
        "jq": {
          "type": "string",
          "description": "Optional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost."
        },
        "max_cost_usd": {
          "type": "string",
          "description": "Optional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price."
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {
        "Idempotency-Key": {
          "type": "string",
          "description": "Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict.",
          "minLength": 1,
          "maxLength": 255
        }
      }
    },
    "body": {
      "type": "object",
      "properties": {
        "cursor": {
          "type": "string",
          "description": "Opaque pagination cursor from a previous response's nextCursor. Omit for the first page; pass it to fetch the next page of accounts.",
          "minLength": 1
        },
        "ignoreSources": {
          "type": "array",
          "description": "Optional. Source ids to skip for this request, taken from this endpoint's `lanes[].source.id`. The cheapest remaining source serves and the price is that of the dearest remaining source. An id that does not serve this endpoint, or that is also in `source`, is rejected as invalid input with no charge; skipping every source is rejected the same way.",
          "items": {
            "type": "string"
          }
        },
        "preferLatencyUnderMs": {
          "type": "integer",
          "description": "Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint's lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.",
          "minimum": 1
        },
        "query": {
          "type": "string",
          "description": "Keyword to match against X (Twitter) handles, display names, and profile bios. This is the People tab of X search: pass a topic ('ai agents'), a name ('Elon Musk'), or a handle ('openai') and get back accounts, not posts. Use twitter.search for posts.",
          "minLength": 1
        },
        "requireFields": {
          "type": "array",
          "description": "Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `location`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a profile that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted.",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "query"
      ]
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "output": {
      "type": "object",
      "properties": {
        "data": {
          "type": "object",
          "properties": {
            "nextCursor": {
              "type": "string"
            },
            "users": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "avatarUrl": {
                    "type": "string"
                  },
                  "bio": {
                    "type": "string"
                  },
                  "canDm": {
                    "type": "boolean"
                  },
                  "coverUrl": {
                    "type": "string"
                  },
                  "createdUtc": {
                    "type": "integer"
                  },
                  "followers": {
                    "type": "integer"
                  },
                  "following": {
                    "type": "integer"
                  },
                  "id": {
                    "type": "string"
                  },
                  "listedCount": {
                    "type": "integer"
                  },
                  "location": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "posts": {
                    "type": "integer"
                  },
                  "profileUrl": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string"
                  },
                  "verified": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "found": {
          "type": "boolean"
        }
      }
    }
  }
}
```

## Request example
Scenario: Official example (output fragment; HTTP assumed)
```bash
curl \
  'https://api.openany.si/v1/agent-apis/anyapi/v1/run/twitter.search_users' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "query": "ai agents"
}'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Configured HTTP 200; actual status is unverified.
```json
{
  "output": {
    "data": {
      "nextCursor": "DAABCgABGZ3xw5A2xVIKAAIY__users_page2",
      "users": [
        {
          "avatarUrl": "https://pbs.twimg.com/profile_images/1893004471820193024/marcus_400x400.jpg",
          "bio": "Building autonomous AI agents for support and sales. Ex-Stripe. Writing about agent orchestration weekly.",
          "canDm": true,
          "coverUrl": "https://pbs.twimg.com/profile_banners/1893004471820193024/1700000000",
          "createdUtc": 1517443200,
          "followers": 48200,
          "following": 612,
          "id": "1893004471820193024",
          "listedCount": 214,
          "location": "Austin, TX",
          "name": "Marcus Feld | AI Agents",
          "posts": 3840,
          "profileUrl": "https://x.com/marcus_builds_ai",
          "username": "marcus_builds_ai",
          "verified": true
        },
        {
          "avatarUrl": "https://pbs.twimg.com/profile_images/1560093221004840960/stack_400x400.jpg",
          "bio": "Daily news on AI agents, tool use, and multi-agent frameworks.",
          "canDm": false,
          "createdUtc": 1651363200,
          "followers": 22900,
          "following": 88,
          "id": "1560093221004840960",
          "listedCount": 61,
          "location": "",
          "name": "Agent Stack",
          "posts": 9120,
          "profileUrl": "https://x.com/agentstacknews",
          "username": "agentstacknews",
          "verified": false
        },
        {
          "avatarUrl": "https://pbs.twimg.com/profile_images/1401882093771280384/priya_400x400.jpg",
          "bio": "Founder @AgentLabsHQ. Previously ML eng at a11y startup. She/her.",
          "canDm": true,
          "coverUrl": "https://pbs.twimg.com/profile_banners/1401882093771280384/1690000000",
          "createdUtc": 1622505600,
          "followers": 15300,
          "following": 940,
          "id": "1401882093771280384",
          "listedCount": 47,
          "location": "San Francisco, CA",
          "name": "Priya Raman",
          "posts": 2205,
          "profileUrl": "https://x.com/priya_agentlabs",
          "username": "priya_agentlabs",
          "verified": true
        }
      ]
    },
    "found": true
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Available implementations
- anyapi: https://openany.si/market/apis/x/x-post-search/?offering=656814ee-281b-4ef2-8b7f-1ba2b7c1ccd6
- anyapi: https://openany.si/market/apis/x/x-post-search/?offering=fde08b63-2afd-4f6a-a419-07df32d540e4
- tikhub: https://openany.si/market/apis/x/x-post-search/?offering=0225bfdd-fae3-40a0-b787-d132ccc364b5

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
