{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter Trends Scraper: X Trending Topics & Hashtags, No Login",
    "description": "X (Twitter) trends scraper: the live trend list of any of X's 467 places (Worldwide, 62 countries, 402 cities) with X's post volume, past hours, past days by date back to 2019, a week's top, 24-hour metrics, Global Trending posts. Trending hashtags in JSON, CSV, Excel. Misses free.",
    "version": "0.1",
    "x-build-id": "fgqQgAm3znFeWDK98"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hyperbach~x-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hyperbach-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/hyperbach~x-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hyperbach-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/hyperbach~x-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hyperbach-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 (countries, cities, WOEIDs)",
            "maxItems": 520,
            "type": "array",
            "description": "Any of X's 467 trend places: Worldwide, 62 countries and 402 cities. Write a name (United States, Japan, New York, São Paulo or Sao Paulo), an ISO country code (US, GB or UK, JP), a WOEID (23424977), a slug (united-kingdom/london) or a trends page link of the place. A city name two countries share takes its country: Birmingham, GB. listPlaces lists every place with its WOEID. A value that names no place gets a free row that says so.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "liveList": {
            "title": "The live list (X's trends now)",
            "type": "boolean",
            "description": "X's own trend list of each place as X serves it now: up to 50 trends in X's order, X's post volume where X gives it (X fills it for about 4 trends of 10), the query and the search link. Switch it off to read only past lists.",
            "default": true
          },
          "hoursAgo": {
            "title": "Past hours (1 to 24 hours ago)",
            "type": "array",
            "description": "The lists of past hours, one number an hour: 1, 3, 6, 12, 24. Each row says the list's own time (listTime) and its real age (hoursAgo), which can be up to 40 minutes off the hour asked. Up to 50 trends an hour. A place X lists but no archive keeps an hour of gets a free row that says so.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Date (or the first day of a range)",
            "pattern": "^$|^\\d{4}-\\d{1,2}-\\d{1,2}$",
            "type": "string",
            "description": "A past day, YYYY-MM-DD (UTC), back to 2019: the day's 48 half-hour lists of the top 10 trends (480 rows a day). Countries and Worldwide only; a city gets a free row. With dateTo, every day of the range (at most 31 days)."
          },
          "dateTo": {
            "title": "Last day of the range",
            "pattern": "^$|^\\d{4}-\\d{1,2}-\\d{1,2}$",
            "type": "string",
            "description": "The last day of a date range, YYYY-MM-DD (UTC), not after today. Empty: dateFrom alone."
          },
          "hour": {
            "title": "Hour of the date (UTC, 0 to 23)",
            "minimum": 0,
            "maximum": 23,
            "type": "integer",
            "description": "One hour of each date asked: the two half-hour top-10 lists of that hour (20 rows a day), or X's 50-deep list of the hour when this Actor read it then. Empty: the whole day."
          },
          "topOfPeriod": {
            "title": "Top list of a period",
            "enum": [
              "none",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "The most tweeted trends of the place over the last day, week, month or year, as an archive of X's lists ranks them (20 to 100 rows, its own score in archiveVolume).",
            "default": "none"
          },
          "withHistoryMetrics": {
            "title": "24-hour metrics on each live trend",
            "type": "boolean",
            "description": "Adds to each live trend: its best rank, the hours it trended, when it was first seen, its rank an hour ago and the change, over the place's hourly lists of the last day (historyHours says the span read, about 17 hours). One page more a place.",
            "default": false
          },
          "globalTrendingPosts": {
            "title": "X's Global Trending posts",
            "type": "boolean",
            "description": "The posts X shows a visitor on its Global Trending page (about 20 posts, the same for every visitor): text, author, likes, reposts, replies, quotes, bookmarks, views, media. One row a post.",
            "default": false
          },
          "listPlaces": {
            "title": "List X's trend places",
            "type": "boolean",
            "description": "One row per place X has trends for (467): name, WOEID, country, country code, type (Country, Town) and parent WOEID. Works with no places given.",
            "default": false
          },
          "placeNameContains": {
            "title": "Place name contains (with listPlaces)",
            "type": "string",
            "description": "Only the places whose name or country contains these letters (case- and accent-insensitive: sao finds São Paulo), such as united or brazil."
          },
          "maxTrendsPerPlace": {
            "title": "Max trends per list",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "The first N trends of each list read (the live list, each past hour, each half hour, the top list); X's list is up to 50 long and some places have fewer. A trend past N is not delivered and not charged. At 50 (the most) every list is whole: a year's top list is up to 100 trends.",
            "default": 50
          },
          "maxItems": {
            "title": "Max results (whole run)",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "The most charged rows of the whole run; 0 = no cap beyond your charge limit.",
            "default": 0
          },
          "hashtags": {
            "title": "Hashtags",
            "enum": [
              "all",
              "only",
              "none"
            ],
            "type": "string",
            "description": "All trends, hashtags only (names that start with #), or no hashtags (X's own filter on the live list, the same rule on the past lists).",
            "default": "all"
          },
          "includeKeywords": {
            "title": "Only trends with these words",
            "type": "array",
            "description": "Keep a trend only when its name or query contains one of these words or phrases (case-insensitive). A trend left out is not charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Leave out trends with these words",
            "type": "array",
            "description": "Leave out a trend whose name or query contains one of these words or phrases (case-insensitive).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dedupe": {
            "title": "One row per trend",
            "enum": [
              "none",
              "perPlace",
              "acrossPlaces"
            ],
            "type": "string",
            "description": "none: every trend of every list. perPlace: one row per trend name per place over every list read, the newest list's row with listsIn (the lists it was in). acrossPlaces: one row per trend name over the whole run.",
            "default": "none"
          },
          "feedback": {
            "title": "Feedback to the maintainers",
            "maxLength": 2000,
            "type": "string",
            "description": "A note to the people who maintain this Actor: what you needed and did not get. For example a missing field, a wrong or empty result, or the Actor you switch from or to, and why. The run does not read it: the rows and the charges stay the same. A person reads every note."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}