# Search X (Twitter) for tweets by keyword

**Use case:** 

Search X (Twitter) for tweets by any keyword or advanced-search query. Clean structured JSON, no API key, pay per tweet, $0 on empty runs.

## Input

```json
{
  "searchTerms": [
    "\"climate change\" lang:en"
  ],
  "twitterHandles": [
    "NatGeo",
    "BBCEarth"
  ],
  "startUrls": [
    {
      "url": "https://x.com/NatGeo/status/2075663637319217267"
    },
    {
      "url": "https://x.com/NatGeo"
    }
  ],
  "conversationIds": [
    "2073460397902827575"
  ],
  "sort": "Top",
  "maxTweets": 100,
  "media": "",
  "onlyVerified": false,
  "onlyBlueVerified": false,
  "onlyQuote": false,
  "includeSearchTerms": false,
  "outputPreset": "full",
  "flattenAuthor": false,
  "transformMode": "none",
  "projection": {
    "selection": "onlyListed",
    "fields": [],
    "flatten": false,
    "constants": [],
    "arrays": "keep",
    "arrayJoinSeparator": ",",
    "missingFields": "omit"
  },
  "jqExpression": ".",
  "jqVariables": [],
  "outputCardinality": "oneToOne",
  "validateTransformOnly": false
}
```

## Output

```json
{
  "url": {
    "label": "Tweet URL",
    "format": "string"
  },
  "text": {
    "label": "Text",
    "format": "string"
  },
  "created_at": {
    "label": "Created at",
    "format": "string"
  },
  "lang": {
    "label": "Language",
    "format": "string"
  },
  "like_count": {
    "label": "Like count",
    "format": "integer"
  },
  "retweet_count": {
    "label": "Retweet count",
    "format": "integer"
  },
  "reply_count": {
    "label": "Reply count",
    "format": "integer"
  },
  "quote_count": {
    "label": "Quote count",
    "format": "integer"
  },
  "view_count": {
    "label": "View count",
    "format": "integer"
  },
  "bookmark_count": {
    "label": "Bookmark count",
    "format": "integer"
  },
  "author": {
    "label": "Author",
    "format": "object"
  }
}
```

## About this Actor

This example demonstrates how to use [X (Twitter) Post & Tweet Scraper-MCP & API for AI Agents, LLM's](https://apify.com/codeperfection/x-twitter-scraper) with a specific input configuration. Visit the [Actor detail page](https://apify.com/codeperfection/x-twitter-scraper) to learn more, explore other use cases, and run it yourself.