{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok All-in-One Scraper",
    "description": "Collect TikTok posts, profiles, hashtags, music metadata, media references, and structured diagnostics.",
    "version": "0.1",
    "x-build-id": "e40jZKSWuMGUDgzY6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/qaseemiqbal~tiktok-all-in-one-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-qaseemiqbal-tiktok-all-in-one-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/qaseemiqbal~tiktok-all-in-one-scraper/runs": {
      "post": {
        "operationId": "runs-sync-qaseemiqbal-tiktok-all-in-one-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/qaseemiqbal~tiktok-all-in-one-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-qaseemiqbal-tiktok-all-in-one-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": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "TikTok video, profile, hashtag, search, music, or location URLs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "profiles": {
            "title": "Profiles",
            "type": "array",
            "description": "TikTok usernames or profile URLs.",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtags with or without #.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms for TikTok discovery.",
            "items": {
              "type": "string"
            }
          },
          "postURLs": {
            "title": "Post URLs",
            "type": "array",
            "description": "Direct TikTok video/post URLs.",
            "items": {
              "type": "string"
            }
          },
          "operations": {
            "title": "Operations",
            "type": "array",
            "description": "Select the public data surfaces to extract.",
            "items": {
              "type": "string",
              "enum": [
                "posts",
                "profiles",
                "comments",
                "commentReplies",
                "followers",
                "following",
                "relatedVideos",
                "hashtagStats",
                "music",
                "media"
              ],
              "enumTitles": [
                "Posts",
                "Profiles",
                "Comments",
                "Comment replies",
                "Followers",
                "Following",
                "Related videos",
                "Hashtag stats",
                "Music",
                "Media"
              ]
            },
            "default": [
              "posts",
              "profiles"
            ]
          },
          "resultsLimit": {
            "title": "Results limit",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum total primary records across posts, profiles, hashtag stats, and music.",
            "default": 100
          },
          "resultsPerTarget": {
            "title": "Results per target",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum post/profile records extracted per target.",
            "default": 100
          },
          "commentsPerPost": {
            "title": "Comments per post",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum public comments to request per video. Leave 0 to use a conservative results-per-target default when the comments operation is selected.",
            "default": 0
          },
          "maxRepliesPerComment": {
            "title": "Replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum public replies to request for each collected comment.",
            "default": 0
          },
          "maxFollowersPerProfile": {
            "title": "Followers per profile",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum public follower records to request per profile when TikTok exposes the relationship endpoint.",
            "default": 0
          },
          "maxFollowingPerProfile": {
            "title": "Following per profile",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum public following records to request per profile when TikTok exposes the relationship endpoint.",
            "default": 0
          },
          "maxProfilesPerQuery": {
            "title": "Profiles per query",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum profile records to keep from a keyword search.",
            "default": 50
          },
          "searchSection": {
            "title": "Search section",
            "enum": [
              "videos",
              "profiles",
              "top"
            ],
            "type": "string",
            "description": "Preferred search section.",
            "default": "videos"
          },
          "sortType": {
            "title": "Sort type",
            "enum": [
              "relevance",
              "mostLiked",
              "datePosted"
            ],
            "type": "string",
            "description": "Preferred search/profile sort type where supported by public payloads.",
            "default": "relevance"
          },
          "profileScrapeSections": {
            "title": "Profile sections",
            "type": "array",
            "description": "Profile sections to request when TikTok exposes them.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "liked",
                "playlists"
              ],
              "enumTitles": [
                "Videos",
                "Liked",
                "Playlists"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "profileSorting": {
            "title": "Profile sorting",
            "enum": [
              "latest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Preferred profile post ordering where supported by TikTok payloads.",
            "default": "latest"
          },
          "excludePinnedPosts": {
            "title": "Exclude pinned posts",
            "type": "boolean",
            "description": "Skip pinned posts when processing profile post payloads.",
            "default": true
          },
          "scrapeRelatedVideos": {
            "title": "Scrape related videos",
            "type": "boolean",
            "description": "Attempt to keep additional related post records when they are present in a video page payload.",
            "default": false
          },
          "includeSearchKeywords": {
            "title": "Include search keywords",
            "type": "boolean",
            "description": "Preserve keyword provenance on search-derived records.",
            "default": true
          },
          "locationCountryCode": {
            "title": "Location country code",
            "type": "string",
            "description": "Optional two-letter country hint copied into run configuration."
          },
          "filters": {
            "title": "Filters",
            "type": "object",
            "description": "Optional metric, date, and creator filters.",
            "default": {
              "verifiedOnly": false
            }
          },
          "download": {
            "title": "Download media",
            "type": "object",
            "description": "Optional media download switches. Files are saved to the key-value store when available.",
            "default": {
              "videos": false,
              "covers": false,
              "avatars": false,
              "subtitles": false,
              "slideshowImages": false,
              "musicCovers": false
            }
          },
          "datasetMode": {
            "title": "Dataset mode",
            "enum": [
              "auto",
              "separate",
              "single"
            ],
            "type": "string",
            "description": "Use separate typed datasets and mirror to the default dataset, or choose a single/separate-only output mode.",
            "default": "auto"
          },
          "fieldPreset": {
            "title": "Field preset",
            "enum": [
              "compact",
              "standard",
              "full"
            ],
            "type": "string",
            "description": "Choose compact, standard, or full records. Full includes raw payload fragments.",
            "default": "standard"
          },
          "dedupe": {
            "title": "Deduplicate records",
            "type": "boolean",
            "description": "Skip duplicate canonical IDs within the run.",
            "default": true
          },
          "incrementalMode": {
            "title": "Incremental mode",
            "type": "boolean",
            "description": "Persist seen IDs in a key-value store and skip them in later runs.",
            "default": false
          },
          "stateKey": {
            "title": "State store name",
            "type": "string",
            "description": "Optional named key-value store for incremental state."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 32,
            "type": "integer",
            "description": "Maximum number of TikTok targets processed at the same time.",
            "default": 4
          },
          "requestRetryLimit": {
            "title": "Request retry limit",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times to retry failed target requests before writing a structured error.",
            "default": 2
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Apify Proxy is recommended for TikTok."
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Store raw HTML pages in the key-value store for diagnostics.",
            "default": false
          },
          "saveRawItems": {
            "title": "Save raw items",
            "type": "boolean",
            "description": "Include raw TikTok payload fragments in full output records and store raw pages.",
            "default": false
          },
          "campaignId": {
            "title": "Campaign ID",
            "type": "string",
            "description": "Optional provenance tag copied to every output record."
          },
          "clientId": {
            "title": "Client ID",
            "type": "string",
            "description": "Optional provenance tag copied to every output record."
          },
          "labels": {
            "title": "Labels",
            "type": "array",
            "description": "Optional provenance labels copied to every output record.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}