{
  "openapi": "3.0.1",
  "info": {
    "title": "Douyin Search Scraper",
    "description": "Search Douyin (抖音, Chinese TikTok) videos by keyword, signed out. One row per video with caption, hashtags, likes, comments, collects, shares, publish time, duration, cover, author and a link, plus the related searches Douyin suggests. Each keyword says whether its results were complete.",
    "version": "0.2",
    "x-build-id": "eYqqv2Ffwx4LOaQYd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lanternlab318~douyin-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lanternlab318-douyin-search",
        "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/lanternlab318~douyin-search/runs": {
      "post": {
        "operationId": "runs-sync-lanternlab318-douyin-search",
        "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/lanternlab318~douyin-search/run-sync": {
      "post": {
        "operationId": "run-sync-lanternlab318-douyin-search",
        "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": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "One search per keyword, in Chinese or English, as you would type it on Douyin.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerKeyword": {
            "title": "Max results per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop each keyword after this many search results. Douyin may end a search earlier; the keyword's summary row says which happened.",
            "default": 100
          },
          "includeRelatedSearches": {
            "title": "Include related searches",
            "type": "boolean",
            "description": "Also write the searches Douyin suggests for each keyword (\"大家还在搜\", people also search) as rows with recordType \"related_search\". Free: only videos are charged.",
            "default": true
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "general",
              "latest",
              "mostLiked"
            ],
            "type": "string",
            "description": "Order of the search results, as in the Douyin app. Douyin web search has no filters: any value other than the default uses a backup data source, and the run stops at once with a message if that source is not available.",
            "default": "general"
          },
          "publishedWithin": {
            "title": "Published within",
            "enum": [
              "any",
              "day",
              "week",
              "halfYear"
            ],
            "type": "string",
            "description": "Only posts published in this period. Douyin offers no other ranges. Douyin web search has no filters: any value other than the default uses a backup data source, and the run stops at once with a message if that source is not available.",
            "default": "any"
          },
          "duration": {
            "title": "Video length",
            "enum": [
              "any",
              "under1min",
              "from1to5min",
              "over5min"
            ],
            "type": "string",
            "description": "Only videos of this length. Douyin web search has no filters: any value other than the default uses a backup data source, and the run stops at once with a message if that source is not available.",
            "default": "any"
          },
          "contentType": {
            "title": "Post type",
            "enum": [
              "all",
              "video",
              "image"
            ],
            "type": "string",
            "description": "Only videos, only image posts (图文), or both. Douyin web search has no filters: any value other than the default uses a backup data source, and the run stops at once with a message if that source is not available.",
            "default": "all"
          },
          "maxUpstreamRequests": {
            "title": "Max backup data source requests",
            "minimum": 0,
            "type": "integer",
            "description": "Hard ceiling on the requests this run may send to the backup data source. Counted in HTTP attempts, so an internal retry uses one up. The run never sends more than this, whatever the keywords or filters ask for; when the ceiling is reached, collection stops there and the keyword's summary row is partial or failed with stopReason \"upstream_request_cap\", so results can be incomplete. 0 switches the backup data source off for the whole run: keywords that signed-out web search cannot read are then reported as failed, and filtered runs are refused before anything is searched. Leave empty and the Actor works the ceiling out from the rest of your input - keywords x ceil(maxResultsPerKeyword / 10) x 2 + 2, which is 22 for one keyword and 100 results - so a run always has an upper bound; RUN_SUMMARY reports the number used in backupCap and where it came from in backupCapSource."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}