{
  "openapi": "3.0.1",
  "info": {
    "title": "Douyin Video Scraper: Links & Keywords",
    "description": "Douyin 抖音 videos by video link or by keyword search, one row each. $0.70 per 1,000 videos. Caption, publish date, author, sound, hashtags, likes, comments, shares, saves, cover and a direct video link; optional MP4 files and date and length filters. No login or cookies needed.",
    "version": "0.1",
    "x-build-id": "zhxxp6g8TaNWWvF46"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/luzivanlt~douyin-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-luzivanlt-douyin-search-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/luzivanlt~douyin-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-luzivanlt-douyin-search-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/luzivanlt~douyin-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-luzivanlt-douyin-search-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": {
          "videoLinks": {
            "title": "Video links or ids",
            "type": "array",
            "description": "One Douyin video link or video id per line: https://www.douyin.com/video/7575086610825178363, a v.douyin.com short link, or the 19-digit id on its own. Up to 1,000 lines. Each video is one plain request of about a second and is charged once; a video the site has deleted or hidden is not charged. A line that is not a Douyin video link stops the run before anything is read.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "One keyword per line, or a Douyin search link such as https://www.douyin.com/search/coffee. Chinese and English both work. Up to 50 lines; a line that is neither a keyword nor a Douyin link stops the run before anything is read.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort saved videos",
            "enum": [
              "search-order",
              "newest",
              "most-liked",
              "most-commented"
            ],
            "type": "string",
            "description": "Order of the videos saved for each keyword. \"Search order\" keeps the Douyin ranking. The other options reorder the videos that keyword's search shows; every row keeps the search position it had on the site.",
            "default": "search-order"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Keep only videos published on or after this day, in China time, such as \"2026-01-01\". Leave empty to keep every date. A video whose date the site does not show is kept.",
            "default": ""
          },
          "minDurationSeconds": {
            "title": "Minimum length (seconds)",
            "minimum": 0,
            "maximum": 14400,
            "type": "integer",
            "description": "Keep only videos at least this long. 0 keeps every length. A video whose length the site does not show is kept.",
            "default": 0
          },
          "maxDurationSeconds": {
            "title": "Maximum length (seconds)",
            "minimum": 0,
            "maximum": 14400,
            "type": "integer",
            "description": "Keep only videos at most this long. 0 keeps every length. Must not be smaller than the minimum.",
            "default": 0
          },
          "downloadVideos": {
            "title": "Download video files",
            "type": "boolean",
            "description": "Save each video's MP4 to this run's key-value store and add its key and size to the row. Charged separately at $0.0021 per 10 MB block and slower, about 5 to 20 seconds per video. Files up to 50 MB are saved; a larger one keeps its links and is not charged.",
            "default": false
          },
          "maxVideosPerKeyword": {
            "title": "Max videos per keyword",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Search only. Save at most this many videos for each keyword, in search order. 0 saves every video the search shows. A keyword usually shows 5 to 10; 1 to 15 has been measured.",
            "default": 0
          },
          "maxKeywords": {
            "title": "Max keywords",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Search only. Read at most this many keywords, in the order given. 0 reads every keyword. The list itself holds up to 50.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}