{
  "openapi": "3.0.1",
  "info": {
    "title": "X Trends Scraper — 24 Hour Timeline",
    "description": "See what WAS trending on X (Twitter), not just what is: 24 hours of hourly snapshots with rank dynamics for 400+ locations, plus weekly, monthly and yearly leaderboards.",
    "version": "0.1",
    "x-build-id": "IBWfusZn1FuSaWYMc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/smolevich90~x-trends-24h-timeline/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-smolevich90-x-trends-24h-timeline",
        "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/smolevich90~x-trends-24h-timeline/runs": {
      "post": {
        "operationId": "runs-sync-smolevich90-x-trends-24h-timeline",
        "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/smolevich90~x-trends-24h-timeline/run-sync": {
      "post": {
        "operationId": "run-sync-smolevich90-x-trends-24h-timeline",
        "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",
        "required": [
          "locations"
        ],
        "properties": {
          "locations": {
            "title": "Locations",
            "minItems": 1,
            "type": "array",
            "description": "Where to read trends from. Use a slug (worldwide, united-states, united-states/new-york, japan/tokyo), a trends24.in URL, or a numeric WOEID. 467 locations are available: Worldwide, 62 countries and 402 cities.",
            "default": [
              "worldwide"
            ],
            "items": {
              "type": "string"
            }
          },
          "periods": {
            "title": "What to collect",
            "uniqueItems": true,
            "type": "array",
            "description": "24h = the full hour-by-hour timeline of the last day (this is the point of the Actor). day / week / month / year = aggregated leaderboards — the top trends of that period with a score, not an hourly history.",
            "items": {
              "type": "string",
              "enum": [
                "24h",
                "day",
                "week",
                "month",
                "year"
              ],
              "enumTitles": [
                "24h hourly timeline",
                "Top of the day",
                "Top of the week",
                "Top of the month",
                "Top of the year"
              ]
            },
            "default": [
              "24h",
              "week"
            ]
          },
          "windowHours": {
            "title": "Timeline window",
            "minimum": 1,
            "maximum": 24,
            "type": "integer",
            "description": "How far back the hourly timeline goes, counted from the newest snapshot. 24 keeps everything the source has.",
            "default": 24
          },
          "includeDrift": {
            "title": "Add rank-dynamics rows",
            "type": "boolean",
            "description": "One extra row per trend with its first and last appearance, best rank, the full rank series and a breaking / sustained / fading status.",
            "default": true
          },
          "liveOnly": {
            "title": "Live snapshot only",
            "type": "boolean",
            "description": "Skip the timeline and return just the trends that are live right now, straight from X. Cheapest mode; no rank dynamics, because a single snapshot has none.",
            "default": false
          },
          "maxTrendsPerSnapshot": {
            "title": "Trends per snapshot",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Each snapshot holds up to 50 trends. Lower it to keep only the head of the chart and cut the cost of a run proportionally.",
            "default": 50
          },
          "metrics": {
            "title": "Leaderboard metric",
            "uniqueItems": true,
            "type": "array",
            "description": "Only affects day / week / month / year leaderboards. tweeted = ranked by tweet score, longest = ranked by total time spent trending.",
            "items": {
              "type": "string",
              "enum": [
                "tweeted",
                "longest"
              ],
              "enumTitles": [
                "Most tweeted",
                "Longest trending"
              ]
            },
            "default": [
              "tweeted"
            ]
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}