{
  "openapi": "3.0.1",
  "info": {
    "title": "X (Twitter) Trends Scraper - 24-Hour Trend History",
    "description": "Scrape X (Twitter) trending topics for Worldwide and 58 countries, with the full 24-hour hourly history - not just what is trending right now. Rank, hashtag flag, search link and the hour each trend was captured. No login, no API key. Independent tool, not affiliated with X Corp.",
    "version": "0.1",
    "x-build-id": "yUsW4RND0jIWWOcyO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~x-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-x-trends-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/scrapesage~x-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-x-trends-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/scrapesage~x-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-x-trends-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "places": {
            "title": "Places",
            "uniqueItems": true,
            "type": "array",
            "description": "Which trend lists to read. **Worldwide plus 58 countries** - every place X publishes a trend list for. Each place is read once per run and every row carries the place it came from.",
            "items": {
              "type": "string",
              "enum": [
                "worldwide",
                "argentina",
                "australia",
                "austria",
                "bahrain",
                "belgium",
                "brazil",
                "canada",
                "chile",
                "colombia",
                "denmark",
                "dominican-republic",
                "ecuador",
                "egypt",
                "france",
                "germany",
                "ghana",
                "greece",
                "guatemala",
                "india",
                "indonesia",
                "ireland",
                "israel",
                "italy",
                "japan",
                "jordan",
                "kenya",
                "kuwait",
                "lebanon",
                "malaysia",
                "mexico",
                "netherlands",
                "new-zealand",
                "nigeria",
                "norway",
                "oman",
                "pakistan",
                "panama",
                "peru",
                "philippines",
                "poland",
                "portugal",
                "puerto-rico",
                "qatar",
                "russia",
                "saudi-arabia",
                "singapore",
                "south-africa",
                "spain",
                "sweden",
                "switzerland",
                "thailand",
                "turkey",
                "ukraine",
                "united-arab-emirates",
                "united-kingdom",
                "united-states",
                "venezuela",
                "vietnam"
              ],
              "enumTitles": [
                "Worldwide (worldwide)",
                "Argentina (argentina)",
                "Australia (australia)",
                "Austria (austria)",
                "Bahrain (bahrain)",
                "Belgium (belgium)",
                "Brazil (brazil)",
                "Canada (canada)",
                "Chile (chile)",
                "Colombia (colombia)",
                "Denmark (denmark)",
                "Dominican Republic (dominican-republic)",
                "Ecuador (ecuador)",
                "Egypt (egypt)",
                "France (france)",
                "Germany (germany)",
                "Ghana (ghana)",
                "Greece (greece)",
                "Guatemala (guatemala)",
                "India (india)",
                "Indonesia (indonesia)",
                "Ireland (ireland)",
                "Israel (israel)",
                "Italy (italy)",
                "Japan (japan)",
                "Jordan (jordan)",
                "Kenya (kenya)",
                "Kuwait (kuwait)",
                "Lebanon (lebanon)",
                "Malaysia (malaysia)",
                "Mexico (mexico)",
                "Netherlands (netherlands)",
                "New Zealand (new-zealand)",
                "Nigeria (nigeria)",
                "Norway (norway)",
                "Oman (oman)",
                "Pakistan (pakistan)",
                "Panama (panama)",
                "Peru (peru)",
                "Philippines (philippines)",
                "Poland (poland)",
                "Portugal (portugal)",
                "Puerto Rico (puerto-rico)",
                "Qatar (qatar)",
                "Russia (russia)",
                "Saudi Arabia (saudi-arabia)",
                "Singapore (singapore)",
                "South Africa (south-africa)",
                "Spain (spain)",
                "Sweden (sweden)",
                "Switzerland (switzerland)",
                "Thailand (thailand)",
                "Turkey (turkey)",
                "Ukraine (ukraine)",
                "United Arab Emirates (united-arab-emirates)",
                "United Kingdom (united-kingdom)",
                "United States (united-states)",
                "Venezuela (venezuela)",
                "Vietnam (vietnam)"
              ]
            }
          },
          "hoursBack": {
            "title": "Hours of history",
            "minimum": 1,
            "maximum": 24,
            "type": "integer",
            "description": "How far back to go. The source publishes **one snapshot per hour for the last 24 hours**, so `1` is \"trending right now\" and `24` is the full day - a trend history no live-only scraper gives you.",
            "default": 24
          },
          "maxTrendsPerSnapshot": {
            "title": "Max trends per hour",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Trends to keep from each hourly snapshot, ranked from the top. X publishes up to 50.",
            "default": 50
          },
          "hashtagsOnly": {
            "title": "Only hashtags",
            "type": "boolean",
            "description": "Keep only trends that are hashtags (`#example`) and drop plain keyword trends. Filtered rows are **never charged**.",
            "default": false
          },
          "containsText": {
            "title": "Trend name contains",
            "type": "string",
            "description": "Keep only trends whose name contains this text (case-insensitive), e.g. `cup`, `election`, `AI`."
          },
          "includeTrends": {
            "title": "Include individual trends",
            "type": "boolean",
            "description": "On by default: one row per trend, per hour, per place - the detailed export.",
            "default": true
          },
          "includePlaceSnapshots": {
            "title": "Include one row per place snapshot",
            "type": "boolean",
            "description": "Adds a compact `placeSnapshot` row per place and hour: trend count, hashtag count and share, and the top 10 names in one cell. Ideal for a dashboard row per country. Charged as `place-snapshot`.",
            "default": false
          },
          "outputFields": {
            "title": "Output fields",
            "uniqueItems": true,
            "type": "array",
            "description": "Trim the export to just these columns. Leave empty for every field.",
            "items": {
              "type": "string",
              "enum": [
                "type",
                "place",
                "placeName",
                "placeUrl",
                "snapshotAt",
                "hoursAgo",
                "rank",
                "name",
                "isHashtag",
                "searchUrl",
                "trendCount",
                "hashtagCount",
                "hashtagSharePercent",
                "topTrends",
                "source",
                "scrapedAt"
              ],
              "enumTitles": [
                "Record type - trend or placeSnapshot (type)",
                "Place slug (place)",
                "Place name (placeName)",
                "Source page for the place (placeUrl)",
                "Hour the trends were captured, ISO 8601 (snapshotAt)",
                "Hours before the latest snapshot (hoursAgo)",
                "Position in the trend list, 1 = top (rank)",
                "Trend name or hashtag (name)",
                "Whether the trend is a hashtag (isHashtag)",
                "X search link for the trend (searchUrl)",
                "Trends in this snapshot (trendCount)",
                "Hashtags in this snapshot (hashtagCount)",
                "Percent of the snapshot that is hashtags (hashtagSharePercent)",
                "Top 10 trend names in this snapshot (topTrends)",
                "Where the data was read from (source)",
                "When this row was collected (scrapedAt)"
              ]
            }
          },
          "monitorMode": {
            "title": "Monitor mode - only new trends",
            "type": "boolean",
            "description": "Remembers trends between runs and emits only ones it has not seen. Pair with an Apify Schedule to track what breaks into a trend list.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Named key-value store holding the remembered trends. Use a different name per tracked place set.",
            "default": "x-trends-monitor"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many places to read in parallel.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy is used by default. Datacenter proxy is enough - no residential needed.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}