{
  "openapi": "3.0.1",
  "info": {
    "title": "Tiktok Scraper",
    "description": "Extract TikTok data from profiles, videos, and hashtags using URLs or search queries. Scrape usernames, followers, likes, shares, videos, music, and post details. Export data, run via API, automate schedules, monitor runs, or integrate with your tools.",
    "version": "0.0",
    "x-build-id": "YbOQmwKA1jNJIKQqj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datadoping~tiktok-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datadoping-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/datadoping~tiktok-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datadoping-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/datadoping~tiktok-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datadoping-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": {
          "profiles": {
            "title": "Profiles",
            "type": "array",
            "description": "TikTok usernames, profile URLs, or user IDs. One per line. Duplicate entries are removed automatically.",
            "items": {
              "type": "string"
            }
          },
          "includeRecentPosts": {
            "title": "Include Recent Posts",
            "type": "boolean",
            "description": "Fetch recent videos for each profile.",
            "default": true
          },
          "maxPostsPerProfile": {
            "title": "Posts Per Profile",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum recent posts to collect per profile. Only used when Include Recent Posts is enabled. Minimum is 10.",
            "default": 50
          },
          "includeProfileAnalytics": {
            "title": "Include Profile Analytics",
            "type": "boolean",
            "description": "Compute engagement rate, averages, posting frequency, and viral post count from profile and post data already collected in this run.",
            "default": true
          },
          "videoUrls": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "TikTok video URLs or numeric video IDs. One per line.",
            "items": {
              "type": "string"
            }
          },
          "includeRelatedVideos": {
            "title": "Include Related Videos",
            "type": "boolean",
            "description": "Collect videos related to each input video.",
            "default": true
          },
          "maxRelatedVideos": {
            "title": "Related Videos Per Input",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum related videos to collect per input video. Only used when Include Related Videos is enabled. Minimum is 10.",
            "default": 20
          },
          "followersProfiles": {
            "title": "Profiles for Followers / Following",
            "type": "array",
            "description": "TikTok usernames, profile URLs, or user IDs to scrape followers or following lists from.",
            "items": {
              "type": "string"
            }
          },
          "scrapeFollowers": {
            "title": "Scrape Followers",
            "type": "boolean",
            "description": "Collect accounts that follow the provided profiles.",
            "default": true
          },
          "scrapeFollowing": {
            "title": "Scrape Following",
            "type": "boolean",
            "description": "Collect accounts followed by the provided profiles.",
            "default": false
          },
          "maxItemsPerProfile": {
            "title": "Maximum Items Per Profile",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum followers or following accounts to scrape per source profile. Minimum is 10.",
            "default": 1000
          },
          "commentVideoUrls": {
            "title": "Video URLs or IDs for Comments",
            "type": "array",
            "description": "TikTok video URLs or IDs to scrape comments from. One per line.",
            "items": {
              "type": "string"
            }
          },
          "includeCommentReplies": {
            "title": "Include Replies",
            "type": "boolean",
            "description": "Collect replies for each comment.",
            "default": true
          },
          "maxComments": {
            "title": "Comments Per Video",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum comments to collect per video. Minimum is 10.",
            "default": 100
          },
          "maxReplies": {
            "title": "Replies Per Comment",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum replies to collect per comment. Only used when Include Replies is enabled. Minimum is 10.",
            "default": 20
          },
          "creatorSearchKeywords": {
            "title": "Creator Search Keywords",
            "type": "array",
            "description": "Keywords to search for TikTok creators. Examples: fitness, gaming, fashion, ai.",
            "items": {
              "type": "string"
            }
          },
          "videoSearchKeywords": {
            "title": "Video Search Keywords",
            "type": "array",
            "description": "Keywords to search for TikTok videos.",
            "items": {
              "type": "string"
            }
          },
          "maxSearchResultsPerQuery": {
            "title": "Results Per Search Query",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum results to collect per search keyword. Minimum is 10.",
            "default": 100
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtag names or URLs (with or without #). One per line.",
            "items": {
              "type": "string"
            }
          },
          "maxHashtagPosts": {
            "title": "Posts Per Hashtag",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum posts to collect per hashtag. Minimum is 10.",
            "default": 50
          },
          "musicUrlsOrIds": {
            "title": "Music URLs or IDs",
            "type": "array",
            "description": "TikTok music/sound URLs or numeric music IDs. One per line.",
            "items": {
              "type": "string"
            }
          },
          "maxMusicPosts": {
            "title": "Videos Per Sound",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum videos to collect per music/sound. Minimum is 10.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}