{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Trends Scraper",
    "description": "Scrape TikTok trending hashtags and trending videos from TikTok Creative Center by country, period and industry: rank, posts, views, popularity curve, top creators, engagement rate. No login.",
    "version": "0.1",
    "x-build-id": "EITDqyKPMY5yzUlqn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automly~tiktok-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automly-tiktok-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/automly~tiktok-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automly-tiktok-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/automly~tiktok-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automly-tiktok-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": {
          "trendType": {
            "title": "Trend type",
            "enum": [
              "hashtags",
              "videos"
            ],
            "type": "string",
            "description": "Trending hashtags (posts, views, popularity curve, top creators) or trending videos (views, engagement rate, creator) from TikTok Creative Center, e.g. Trending hashtags.",
            "default": "hashtags"
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Markets to read, e.g. United States and United Kingdom. Each country is read on its own. Trending hashtags cover all 27; trending videos cover the US, Japan, Vietnam, Thailand and Indonesia, and other countries are skipped for videos.",
            "items": {
              "type": "string",
              "enum": [
                "US",
                "AR",
                "AU",
                "BR",
                "CA",
                "CO",
                "EG",
                "FR",
                "DE",
                "ID",
                "IL",
                "IT",
                "JP",
                "MY",
                "MX",
                "PH",
                "SA",
                "SG",
                "ZA",
                "KR",
                "ES",
                "TW",
                "TH",
                "TR",
                "AE",
                "GB",
                "VN"
              ],
              "enumTitles": [
                "United States",
                "Argentina",
                "Australia",
                "Brazil",
                "Canada",
                "Colombia",
                "Egypt",
                "France",
                "Germany",
                "Indonesia",
                "Israel",
                "Italy",
                "Japan",
                "Malaysia",
                "Mexico",
                "Philippines",
                "Saudi Arabia",
                "Singapore",
                "South Africa",
                "South Korea",
                "Spain",
                "Taiwan",
                "Thailand",
                "Turkey",
                "United Arab Emirates",
                "United Kingdom",
                "Vietnam"
              ]
            },
            "default": [
              "US"
            ]
          },
          "hashtagPeriod": {
            "title": "Hashtag period",
            "enum": [
              "7",
              "30",
              "90"
            ],
            "type": "string",
            "description": "Ranking window for trending hashtags, e.g. Last 7 days.",
            "default": "7"
          },
          "industries": {
            "title": "Industry rankings",
            "type": "array",
            "description": "Industry rankings to read next to the overall one, e.g. Every industry or Beauty & Personal Care. TikTok shows the top 3 hashtags of each ranking, so Every industry gives up to 48 hashtags per country and period. Leave empty for the overall ranking only.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "10000000000",
                "11000000000",
                "12000000000",
                "14000000000",
                "15000000000",
                "17000000000",
                "18000000000",
                "19000000000",
                "21000000000",
                "22000000000",
                "23000000000",
                "25000000000",
                "27000000000",
                "28000000000",
                "29000000000"
              ],
              "enumTitles": [
                "Every industry",
                "Education",
                "Vehicle & Transportation",
                "Baby, Kids & Maternity",
                "Beauty & Personal Care",
                "Tech & Electronics",
                "Travel",
                "Household Products",
                "Pets",
                "Home Improvement",
                "Apparel & Accessories",
                "News & Entertainment",
                "Games",
                "Food & Beverage",
                "Sports & Outdoor",
                "Health"
              ]
            },
            "default": [
              "all"
            ]
          },
          "videoPeriod": {
            "title": "Video period",
            "enum": [
              "week",
              "month",
              "new7",
              "new30"
            ],
            "type": "string",
            "description": "Ranking window for trending videos, e.g. Last week.",
            "default": "week"
          },
          "videoSortBy": {
            "title": "Rank videos by",
            "enum": [
              "views",
              "engagement",
              "six_second_views"
            ],
            "type": "string",
            "description": "Which metric trending videos are ranked by, e.g. Views.",
            "default": "views"
          },
          "videoCategories": {
            "title": "Video category rankings",
            "type": "array",
            "description": "Category rankings to read next to the overall one, e.g. Every category or Fashion. TikTok shows the top 4 videos of each ranking, so Every category gives up to 24 videos per country. Leave empty for the overall ranking only.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "11002",
                "11003",
                "11010",
                "11013",
                "11015"
              ],
              "enumTitles": [
                "Every category",
                "Beauty & Care",
                "Fashion",
                "Food & Beverage",
                "Lifestyle & Leisure",
                "Technology & Finance"
              ]
            },
            "default": [
              "all"
            ]
          },
          "organicOnly": {
            "title": "Organic videos only",
            "type": "boolean",
            "description": "Leave out paid (promoted) videos from trending videos.",
            "default": false
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Most rows to save in the run, e.g. 50. Set 0 for every row the chosen rankings show.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}