{
  "openapi": "3.0.1",
  "info": {
    "title": "Douyin Scraper",
    "description": "Scrape Douyin (抖音) videos by keyword, creator, hashtag or URL: likes, comments, shares, music, hashtags and IP region, plus optional creator details, play counts and comments. No login or cookies.",
    "version": "1.0",
    "x-build-id": "lG9YnbAxhKFC4YTDK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~douyin-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-douyin-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/coregent~douyin-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-douyin-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/coregent~douyin-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-douyin-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": {
          "keywords": {
            "title": "Keywords",
            "maxItems": 100,
            "type": "array",
            "description": "Search Douyin for these terms, in Chinese or English (e.g. 咖啡, 露营, iPhone). Each keyword is one source. If you give no keyword, creator, hashtag or video URL at all, the Actor runs a short demo search for 咖啡. Up to 100 per run.",
            "items": {
              "type": "string"
            }
          },
          "creators": {
            "title": "Creators",
            "maxItems": 100,
            "type": "array",
            "description": "Creator profile URLs (https://www.douyin.com/user/MS4wLjAB…), sec_uid values, or Douyin IDs (抖音号). A profile URL is the most reliable; a Douyin ID needs an extra search to find the creator. Up to 100 per run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "Hashtags",
            "maxItems": 100,
            "type": "array",
            "description": "Hashtag names, with or without # (e.g. 露营), or hashtag URLs (https://www.douyin.com/hashtag/<id>). Up to 100 per run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "Video URLs (https://www.douyin.com/video/<id>), short share links (https://v.douyin.com/…), share text containing such a link, or video IDs. Up to 1,000 per run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max videos (whole run)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The total number of video rows for the whole run, across all sources. Split evenly across sources unless you set a per-source limit. Comments do not count toward this limit.",
            "default": 10
          },
          "maxResultsPerSource": {
            "title": "Max videos per source",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional. The most videos from any one keyword, creator or hashtag. Leave empty to split the run's limit evenly across sources."
          },
          "sortBy": {
            "title": "Sort (keywords)",
            "enum": [
              "relevance",
              "most_liked",
              "newest"
            ],
            "type": "string",
            "description": "How keyword search results are ordered.",
            "default": "relevance"
          },
          "publishedWithin": {
            "title": "Published within (keywords)",
            "enum": [
              "any",
              "day",
              "week",
              "half_year"
            ],
            "type": "string",
            "description": "Only keyword results published within this period.",
            "default": "any"
          },
          "duration": {
            "title": "Video length (keywords)",
            "enum": [
              "any",
              "under_1m",
              "1_to_5m",
              "over_5m"
            ],
            "type": "string",
            "description": "Only keyword results of this length.",
            "default": "any"
          },
          "oldestPostDate": {
            "title": "Oldest post date (creators)",
            "type": "string",
            "description": "Stop reading a creator's posts at the first one older than this. A date (YYYY-MM-DD) or a period such as \"30 days\" or \"2 weeks\"."
          },
          "skipPinned": {
            "title": "Skip pinned posts (creators)",
            "type": "boolean",
            "description": "Leave out posts the creator pinned to the top of their profile.",
            "default": false
          },
          "includeCreatorDetails": {
            "title": "Include creator details",
            "type": "boolean",
            "description": "Add each creator's profile to their videos: followers, following, total likes, post count, bio, IP region and verification. Fetched and charged once per creator per run. Without it, video rows still carry the creator's name, Douyin ID and profile URL.",
            "default": false
          },
          "includePlayCounts": {
            "title": "Include play counts",
            "type": "boolean",
            "description": "Fill playCount (views). Douyin hides view counts in most listings, so this is an extra lookup per video. Without it, playCount is empty (null), never 0.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Add top-level comments for each video as separate rows (recordType \"comment\"). Comments are slow to load: allow about 20 seconds per 20 comments.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "With \"Include comments\" on: the most comments per video.",
            "default": 20
          },
          "skipVideoIds": {
            "title": "Skip these videos",
            "type": "array",
            "description": "Video IDs or URLs to leave out, for example the ones a previous run already collected.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "deduplicate": {
            "title": "Remove duplicates across sources",
            "type": "boolean",
            "description": "Deliver (and charge) a video only once, even when several keywords, creators or hashtags return it.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}