{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Scraper API by SocialScrape",
    "description": "Scrape TikTok profiles, videos, comments, search results, hashtags, songs, transcripts, the Ad Library and TikTok Shop as JSON. 27 endpoints in one actor, with the same field names on every platform. Pay per result: no API key and no other account needed.",
    "version": "0.1",
    "x-build-id": "Kle2uhprfGGyyouOt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/socialscrape~tiktok-scraper-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-socialscrape-tiktok-scraper-api",
        "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/socialscrape~tiktok-scraper-api/runs": {
      "post": {
        "operationId": "runs-sync-socialscrape-tiktok-scraper-api",
        "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/socialscrape~tiktok-scraper-api/run-sync": {
      "post": {
        "operationId": "run-sync-socialscrape-tiktok-scraper-api",
        "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": [
          "endpoint"
        ],
        "properties": {
          "endpoint": {
            "title": "Endpoint",
            "enum": [
              "profile",
              "profile.region",
              "profile.videos",
              "collection.videos",
              "video",
              "video.transcript",
              "video.comments",
              "video.comment.replies",
              "profile.followers",
              "profile.following",
              "search.users",
              "search.suggestions",
              "search.keyword",
              "search.hashtag",
              "search.top",
              "videos.popular",
              "song",
              "song.videos",
              "trending",
              "profile.live",
              "live",
              "ad_library.search",
              "ad_library.ad",
              "shop.search",
              "shop.products",
              "shop.product",
              "shop.product.reviews"
            ],
            "type": "string",
            "description": "What to fetch. The fields below are shared by the endpoints; each endpoint uses only the ones it needs.",
            "default": "profile"
          },
          "handle": {
            "title": "Handle",
            "type": "string",
            "description": "Username, with or without the leading @. Used by: profile, profile.followers, profile.following, profile.live, profile.region, profile.videos."
          },
          "id": {
            "title": "ID",
            "type": "string",
            "description": "For profile, profile.videos, profile.followers, profile.following: TikTok user id (numeric) or secUid. For video, video.transcript, video.comments, video.comment.replies: Numeric video id. For song, song.videos: Sound (music) id. For live: Live room id. For ad_library.ad: Ad id in the library. For shop.product, shop.product.reviews: Product id."
          },
          "trim": {
            "title": "Trim",
            "type": "boolean",
            "description": "Smaller response: drops null fields and `extra`.",
            "default": false
          },
          "raw": {
            "title": "Raw",
            "type": "boolean",
            "description": "Also return the platform's original object as `raw`.",
            "default": false
          },
          "max_age_days": {
            "title": "Max Age Days",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Accept a cached result fetched within this many days. It answers faster."
          },
          "sort": {
            "title": "Sort",
            "type": "string",
            "description": "For profile.videos: Order of results. Changing it restarts the cursor chain (one of: latest, popular). For search.keyword, search.top: Order of results. Changing it restarts the cursor chain (one of: relevance, likes, latest). For videos.popular: Accepted for compatibility; not applied (one of: views, likes, comments, shares). For shop.products: Order of results. Changing it restarts the cursor chain (one of: top, new_releases)."
          },
          "include_pinned": {
            "title": "Include Pinned",
            "type": "boolean",
            "description": "Set false to drop the pinned videos that can be told from the page order. Used by: profile.videos.",
            "default": true
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Two-letter country code (ISO 3166-1) for results that vary by country. Used by: ad_library.search, profile.videos, search.hashtag, search.keyword, search.suggestions, search.top, shop.product, shop.product.reviews, shop.products, shop.search, trending, video, videos.popular."
          },
          "url": {
            "title": "URL",
            "type": "string",
            "description": "For collection.videos: Public collection URL (tiktok.com/@user/collection/<name>-<id>). For video, video.transcript, video.comments, video.comment.replies: Video URL (www.tiktok.com/@user/video/..., vm.tiktok.com/..., vt.tiktok.com/...). For song, song.videos: Sound URL (tiktok.com/music/...). For live: Live URL (tiktok.com/@user/live). For ad_library.ad: Ad URL (library.tiktok.com/ads/detail/?ad_id=...). For shop.products: Shop URL (tiktok.com/shop/store/<name>/<id>). For shop.product, shop.product.reviews: Product URL (tiktok.com/shop/pdp/...)."
          },
          "get_transcript": {
            "title": "Get Transcript",
            "type": "boolean",
            "description": "Include the video's native captions when it has them. Used by: video.",
            "default": false
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Preferred caption language (2-letter code: en, es, fr, de, it, ja, ko, zh). Used by: video.transcript."
          },
          "ai_fallback": {
            "title": "AI Fallback",
            "type": "boolean",
            "description": "Transcribe the audio with AI when the video has no captions. Set false to get no transcript instead, and no AI charge. Used by: video.transcript.",
            "default": true
          },
          "comment_id": {
            "title": "Comment ID",
            "type": "string",
            "description": "TikTok comment id (the `cid` from the comments list). Used by: video.comment.replies."
          },
          "query": {
            "title": "Query",
            "type": "string",
            "description": "For search.users, search.keyword, search.top, shop.search: Search terms. For search.suggestions: Partial or complete search text. For ad_library.search: General ad search."
          },
          "date_posted": {
            "title": "Date Posted",
            "enum": [
              "any",
              "day",
              "week",
              "month",
              "three_months",
              "six_months"
            ],
            "type": "string",
            "description": "Posted within. Used by: search.keyword."
          },
          "hashtag": {
            "title": "Hashtag",
            "type": "string",
            "description": "Hashtag, with or without #. Used by: search.hashtag."
          },
          "publish_time": {
            "title": "Publish Time",
            "enum": [
              "any",
              "day",
              "week",
              "month",
              "three_months",
              "six_months"
            ],
            "type": "string",
            "description": "Posted within. Used by: search.top."
          },
          "period": {
            "title": "Period",
            "enum": [
              "7",
              "30"
            ],
            "type": "string",
            "description": "Accepted for compatibility; the Explore feed has no time window. Used by: videos.popular."
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "TikTok's numeric Explore category id (default 1). Used by: videos.popular."
          },
          "user_id": {
            "title": "User ID",
            "type": "string",
            "description": "Numeric TikTok user id of the live's owner (`id` from the profile); speeds the lookup. Used by: live."
          },
          "advertiser_name": {
            "title": "Advertiser Name",
            "type": "string",
            "description": "Advertiser name to resolve and search by advertiser entity. Used by: ad_library.search."
          },
          "adv_biz_ids": {
            "title": "Adv Biz Ids",
            "type": "string",
            "description": "TikTok advertiser business id from a See all ads link; pins the exact advertiser. Only works together with `advertiser_name`. Used by: ad_library.search."
          },
          "start_date": {
            "title": "Start Date",
            "type": "string",
            "description": "Ads shown from this date, YYYY-MM-DD (default: a year before `end_date`). Used by: ad_library.search."
          },
          "end_date": {
            "title": "End Date",
            "type": "string",
            "description": "Ads shown up to this date, YYYY-MM-DD (default: today). Used by: ad_library.search."
          },
          "start_time": {
            "title": "Start Time",
            "type": "string",
            "description": "The same window as `start_date` in Unix seconds (milliseconds also work). Give it with `end_time`; it wins over the dates. Used by: ad_library.search."
          },
          "end_time": {
            "title": "End Time",
            "type": "string",
            "description": "Upper bound of the window in Unix seconds; give it with `start_time`. Used by: ad_library.search."
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Follow the cursor for up to this many pages. You pay for the results, not for the pages.",
            "default": 1
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many results. 0 means no limit other than Max pages.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}