# X recent search

X (Twitter) recent search: posts from the last 7 days. Needs query.

X (Twitter) recent search: posts from the last 7 days. At most one of `start_time`, `since_id` may be provided. Query operators: keywords, "exact phrase", #hashtag, @mention, from:, to:, lang:, has:images, has:links, -is:retweet, -is:reply, is:verified. Ask for tweet.fields=created_at,public_metrics and expansions=author_id with user.fields=username to get authors. Price: $0.005 per post returned or hydrated, $0.01 per user hydrated (expansions). 10 to 100 posts per page. Billed on the resources actually returned (posts and users), the quote is the upper bound; X's 24-hour deduplication is not passed through.

- Tool ID: `x/search-recent`
- Name in the catalog: X (Twitter) recent search: posts from the last 7 days
- Provider: [X](/providers/x.md)
- Capability: [X search](/tools/x/search.md)
- Price: usage based, the maximum is shown before a run
- Authentication: an authorised Agentik workspace is required for execution, including zero-price tools.

## Pricing contract

Billed at the cost the provider reports for the call, never above $3. Your agent sees the maximum before running.


```json
{
  "model": "reported",
  "costPath": "",
  "costTerms": [
    {
      "path": "data",
      "usd": 0.005
    },
    {
      "path": "includes.tweets",
      "usd": 0.005
    },
    {
      "path": "includes.users",
      "usd": 0.01
    }
  ],
  "maxUsdDefault": 0,
  "maxUsdCap": 3,
  "multipliers": [
    {
      "addUsdPer": {
        "field": "max_results",
        "usd": 0.005,
        "default": 10,
        "max": 100
      }
    },
    {
      "when": {
        "field": "expansions",
        "truthy": true
      },
      "addUsdPer": {
        "field": "max_results",
        "usd": 0.015,
        "default": 10,
        "max": 100
      }
    }
  ]
}
```

Pricing source: [https://docs.x.com/x-api/getting-started/pricing](https://docs.x.com/x-api/getting-started/pricing). $0.005 per post returned or hydrated, $0.01 per user hydrated (expansions). 10 to 100 posts per page..

Price verification date: 2026-10-08.

## Complete input schema


```json
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "max_results": {
      "type": "integer",
      "minimum": 10,
      "maximum": 100,
      "format": "int32",
      "default": 10
    },
    "next_token": {
      "type": "string",
      "minLength": 1,
      "description": "A base32hex-encoded pagination token."
    },
    "pagination_token": {
      "type": "string",
      "minLength": 1,
      "description": "A base32hex-encoded pagination token."
    },
    "start_time": {
      "type": "string",
      "format": "date-time",
      "description": "Must be within the last 7 days."
    },
    "end_time": {
      "type": "string",
      "format": "date-time"
    },
    "since_id": {
      "type": "string",
      "pattern": "^[0-9]{1,19}$"
    },
    "until_id": {
      "type": "string",
      "pattern": "^[0-9]{1,19}$"
    },
    "sort_order": {
      "type": "string",
      "enum": [
        "recency",
        "relevancy"
      ]
    },
    "post.fields": {
      "type": "array",
      "description": "The fields available for a Post object.",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "article",
          "article_title",
          "attachments",
          "card_uri",
          "community_id",
          "context_annotations",
          "conversation_id",
          "created_at",
          "display_text_range",
          "edit_controls",
          "entities",
          "geo",
          "id",
          "lang",
          "matched_media_notes",
          "media_metadata",
          "non_public_metrics",
          "note_post",
          "note_request_suggestions",
          "organic_metrics",
          "paid_partnership",
          "possibly_sensitive",
          "promoted_metrics",
          "public_metrics",
          "reply_settings",
          "scopes",
          "source",
          "suggested_source_links",
          "suggested_source_links_with_counts",
          "text",
          "withheld"
        ]
      }
    },
    "expansions": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "article.cover_media",
          "article.media_entities",
          "attachments.media_keys",
          "attachments.media_source_tweet",
          "attachments.poll_ids",
          "author_id",
          "edit_history_post_ids",
          "entities.mentions.username",
          "geo.place_id",
          "in_reply_to_user_id",
          "referenced_posts",
          "username"
        ]
      },
      "description": "A comma separated list of fields to expand."
    },
    "user.fields": {
      "type": "array",
      "description": "The fields available for a User object.",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "confirmed_email",
          "connection_status",
          "created_at",
          "description",
          "entities",
          "id",
          "is_identity_verified",
          "location",
          "name",
          "parody",
          "profile_banner_url",
          "profile_image_url",
          "protected",
          "public_metrics",
          "receives_your_dm",
          "subscriber_count",
          "subscribes_to_you",
          "subscription",
          "subscription_type",
          "url",
          "username",
          "verified",
          "verified_followers_count",
          "verified_type",
          "withheld"
        ]
      }
    },
    "media.fields": {
      "type": "array",
      "description": "The fields available for a Media object.",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "alt_text",
          "duration_ms",
          "height",
          "media_key",
          "non_public_metrics",
          "organic_metrics",
          "preview_image_url",
          "promoted_metrics",
          "public_metrics",
          "type",
          "url",
          "variants",
          "width"
        ]
      }
    },
    "poll.fields": {
      "type": "array",
      "description": "The fields available for a Poll object.",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "duration_minutes",
          "end_datetime",
          "id",
          "options",
          "voting_status"
        ]
      }
    },
    "place.fields": {
      "type": "array",
      "description": "The fields available for a Place object.",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "contained_within",
          "country",
          "country_code",
          "full_name",
          "geo",
          "id",
          "name",
          "place_type"
        ]
      }
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false
}
```

## Published example

This is the provider tool’s published example. Replace example values with the user’s requested inputs, respecting the schema; do not execute an example merely to test a connection.


```json
{
  "tool_id": "x/search-recent",
  "input": {
    "query": "from:X -is:retweet",
    "max_results": 10
  }
}
```

## Execute and retrieve

Inspect again before execution, explain the price and obtain the required authority. Use MCP run_tool or POST /v1/run with this tool ID, valid input and an idempotency key. Save the returned run ID and follow the actual state. If Agentik answers that the tool is temporarily unavailable, do not retry it blindly; use discovery to propose an alternative.

A partial or uncertain result can still have consumed provider resources. Consult [billing](/docs/billing.md), [idempotency](/docs/idempotency.md) and [asynchronous results](/docs/async.md).

[Provider documentation](https://docs.x.com/x-api/posts/search/introduction)

[REST inspection](https://api.agentik.cc/v1/tools/x/search-recent) · [OpenAPI](/openapi.json) · [Connection guide](/connect.md)

---

[HTML page](/providers/x/search-recent) · [Agent index](/llms.txt)
