{
  "openapi": "3.0.1",
  "info": {
    "title": "Tiktok Scraper",
    "description": "Scrape TikTok videos by URL, profile, hashtag or search. Extract metadata, stats, author info. Download with or without watermark. Filter by date, likes, views.",
    "version": "1.0",
    "x-build-id": "oTdf31qkiFEGl56I8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/therealdude~tiktok-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-therealdude-tiktok-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/therealdude~tiktok-scraper/runs": {
      "post": {
        "operationId": "runs-sync-therealdude-tiktok-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/therealdude~tiktok-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-therealdude-tiktok-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": {
          "hashtags": {
            "title": "#️⃣ Hashtags",
            "type": "array",
            "description": "List of TikTok hashtags to scrape. Accepts: hashtag, #hashtag, or full URL.",
            "items": {
              "type": "string"
            }
          },
          "profiles": {
            "title": "👤 Usernames",
            "type": "array",
            "description": "List of TikTok usernames or profile URLs to scrape. Accepts: username, @username, or full URL.",
            "items": {
              "type": "string"
            }
          },
          "profileSorting": {
            "title": "📋 Profile sorting",
            "enum": [
              "latest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "How to sort videos when scraping profiles.",
            "default": "latest"
          },
          "excludePinnedPosts": {
            "title": "📌 Exclude pinned posts",
            "type": "boolean",
            "description": "Skip pinned videos when scraping profiles. If all videos are pinned, increase 'Results per input' to get non-pinned videos.",
            "default": false
          },
          "searchQueries": {
            "title": "🔍 Search queries",
            "type": "array",
            "description": "List of search terms to find TikTok videos or users.",
            "items": {
              "type": "string"
            }
          },
          "searchSection": {
            "title": "🔍 Search type",
            "enum": [
              "",
              "/video",
              "/user"
            ],
            "type": "string",
            "description": "What to search for: Top results, Videos only, or Users only.",
            "default": ""
          },
          "postURLs": {
            "title": "🔗 Video URLs or IDs",
            "type": "array",
            "description": "List of TikTok video URLs or video IDs to scrape. Accepts full URLs or just the numeric video ID.",
            "items": {
              "type": "string"
            }
          },
          "resultsPerPage": {
            "title": "📊 Results per input",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of videos to scrape per hashtag, profile, or search query.",
            "default": 10
          },
          "oldestPostDate": {
            "title": "📅 Oldest post date",
            "type": "string",
            "description": "Only scrape posts created after this date. Use Absolute for specific date or Relative for 'X days ago'."
          },
          "newestPostDate": {
            "title": "📅 Newest post date",
            "type": "string",
            "description": "Only scrape posts created before this date. Use Absolute for specific date or Relative for 'X days ago'."
          },
          "minLikes": {
            "title": "❤️ Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only include videos with at least this many likes (hearts)."
          },
          "maxLikes": {
            "title": "❤️ Maximum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only include videos with at most this many likes (hearts)."
          },
          "minViews": {
            "title": "👁️ Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Only include videos with at least this many views."
          },
          "maxViews": {
            "title": "👁️ Maximum views",
            "minimum": 0,
            "type": "integer",
            "description": "Only include videos with at most this many views."
          },
          "shouldDownloadVideos": {
            "title": "🎬 Download videos",
            "type": "boolean",
            "description": "Download video files to Key-Value Store. Warning: This can consume significant storage.",
            "default": false
          },
          "downloadWithoutWatermark": {
            "title": "✨ Download without watermark",
            "type": "boolean",
            "description": "Try to download videos without TikTok watermark. Uses TikTok's internal API. May not work for all videos.",
            "default": false
          },
          "shouldDownloadCovers": {
            "title": "🖼️ Download covers",
            "type": "boolean",
            "description": "Download video cover/thumbnail images to Key-Value Store.",
            "default": false
          },
          "shouldDownloadAvatars": {
            "title": "👤 Download avatars",
            "type": "boolean",
            "description": "Download author avatar images to Key-Value Store.",
            "default": false
          },
          "shouldDownloadMusicCovers": {
            "title": "🎵 Download music covers",
            "type": "boolean",
            "description": "Download music/sound cover images to Key-Value Store.",
            "default": false
          },
          "mediaKvStoreName": {
            "title": "💾 Media store name",
            "type": "string",
            "description": "Name of the Key-Value Store for downloaded media. Leave empty to use default store."
          },
          "proxyCountryCode": {
            "title": "🌍 Proxy country",
            "enum": [
              "None",
              "US",
              "GB",
              "DE",
              "FR",
              "ES",
              "IT",
              "NL",
              "BE",
              "AT",
              "CH",
              "AU",
              "CA",
              "JP",
              "KR",
              "SG",
              "IN",
              "BR",
              "MX",
              "AR"
            ],
            "type": "string",
            "description": "Country to use with proxy. Use it to scrape content only available in specific countries.",
            "default": "None"
          },
          "headless": {
            "title": "🖥️ Run headless",
            "type": "boolean",
            "description": "Run browser in headless mode. Set to false for local debugging only (has no effect on Apify platform).",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}