{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Trending Videos Scraper With Author Profile",
    "description": "The Tiktok Trending Videos Scraper collects real-time trending videos with views, likes, comments, shares, creators, sounds, and hashtag insights. Export clean JSON or CSV for trend research, content analysis, marketing insights, and audience discovery.",
    "version": "0.3",
    "x-build-id": "g0wSg1SD30pYvfbXO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~tiktok-trending-videos-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-tiktok-trending-videos-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/scraper-engine~tiktok-trending-videos-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-tiktok-trending-videos-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/scraper-engine~tiktok-trending-videos-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-tiktok-trending-videos-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",
        "required": [
          "countryCode",
          "sortBy"
        ],
        "properties": {
          "countryCode": {
            "title": "🌐 Country Code",
            "enum": [
              "AU",
              "BR",
              "CA",
              "EG",
              "FR",
              "DE",
              "ID",
              "IL",
              "IT",
              "JP",
              "MY",
              "PH",
              "RU",
              "SA",
              "SG",
              "KR",
              "ES",
              "TW",
              "TH",
              "TR",
              "AE",
              "GB",
              "US",
              "VN"
            ],
            "type": "string",
            "description": "Country code to scrape trending videos for (used in discovery mode; ignored when videoUrls is supplied). NOTE: TikTok's Creative Center currently only returns non-empty trending-video data to logged-out requests for the US — other countries return 0 rows there (a TikTok-side login gate). Use videoUrls for guaranteed results from any other country.",
            "default": "US"
          },
          "sortBy": {
            "title": "📊 Sort By",
            "enum": [
              "vv",
              "like",
              "comment",
              "repost"
            ],
            "type": "string",
            "description": "Sort discovery results by: hot/view→vv (views, exact server-side sort). like/comment/share→repost currently map to TikTok's engagement-rate ranking, the closest available server-side proxy — TikTok's Creative Center no longer offers separate like/comment/share-count sort dimensions. The exact like/comment/share counts are still returned on every row regardless of sort choice.",
            "default": "vv"
          },
          "period": {
            "title": "📅 Period Type",
            "enum": [
              "7",
              "30"
            ],
            "type": "string",
            "description": "Period to scrape (last 7 or 30 days) in discovery mode.",
            "default": "7"
          },
          "maxItems": {
            "title": "🔢 Max Items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of videos to scrape in discovery mode. TikTok's Creative Center has no real anonymous pagination, so discovery mode's realistic ceiling is roughly the number of content categories TikTok publishes (typically a few dozen unique videos per country/period/sort combination) — set higher only if you also want to allow for that natural cap; use videoUrls for larger, guaranteed batches.",
            "default": 10
          },
          "videoUrls": {
            "title": "🔗 Direct Video URLs",
            "type": "array",
            "description": "Optional. One TikTok video URL per line. When supplied, discovery (countryCode/sortBy/period/maxItems) is skipped entirely and each URL's public page is parsed directly for creator/author data. Example: https://www.tiktok.com/@username/video/7123456789012345678",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeCreatorProfile": {
            "title": "👤 Include Creator Profile",
            "type": "boolean",
            "description": "When enabled, each video row includes a full authorMeta object (uniqueId, nickname, verified, signature/bio, avatar, profileUrl, followerCount, followingCount, heartCount, videoCount) plus likes/comments/bookmarks/shares/views/videoUrl/engagementRate. The base actor's own `includeDetailedVideoData` key is still accepted as a fallback for this option."
          },
          "minCreatorFollowers": {
            "title": "🧑‍🤝‍🧑 Min Creator Followers",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep videos whose creator has at least this many followers. 0 = no filter. Requires 'Include Creator Profile' — videos are dropped (not counted) when this filter is active and no creator data could be parsed.",
            "default": 0
          },
          "onlyVerifiedCreators": {
            "title": "✅ Verified Creators Only",
            "type": "boolean",
            "description": "Only keep videos whose creator has a verified TikTok badge. Requires 'Include Creator Profile'.",
            "default": false
          },
          "includeDetailedVideoData": {
            "title": "⚙️ Include Detailed Video Data (legacy — use Include Creator Profile above)",
            "type": "boolean",
            "description": "Legacy base-actor input, kept for backward compatibility. Behaves the same as 'Include Creator Profile' above — set that instead. If both are omitted, creator profile data is included by default.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}