{
  "openapi": "3.0.1",
  "info": {
    "title": "Douyin Scraper",
    "description": "This powerful tool enables you to extract data from Douyin, the Chinese version of TikTok. Use it to scrape post data, like URLs, numbers of followers, hearts, video, music-related data and more. Download Douyin data as a HTML, JSON, CSV, Excel, or XML doc.",
    "version": "0.5",
    "x-build-id": "1oQfHsYq7HA2K5ihk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/natanielsantos~douyin-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-natanielsantos-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/natanielsantos~douyin-scraper/runs": {
      "post": {
        "operationId": "runs-sync-natanielsantos-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/natanielsantos~douyin-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-natanielsantos-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": {
          "maxItemsPerUrl": {
            "title": "Max number of posts per search term/hashtag or profile",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of items you want to scrape per hashtag or profile.",
            "default": 0
          },
          "scrapeAdditionalUserInfo": {
            "title": "Scrape Additional User Info",
            "type": "boolean",
            "description": "Whether to scrape additional user profile information such as follower count, following count, total likes and more.",
            "default": false
          },
          "scrapePlayCount": {
            "title": "Scrape Play Count",
            "type": "boolean",
            "description": "Whether to scrape video play count of each video.",
            "default": false
          },
          "searchTermsOrHashtags": {
            "title": "Search Terms or Hashtags",
            "uniqueItems": true,
            "type": "array",
            "description": "List of search terms or hashtags you want to scrape. For example `#chinesetiktok` or `anime edit`.",
            "items": {
              "type": "string"
            }
          },
          "searchSortFilter": {
            "title": "Sort Filter",
            "enum": [
              "general",
              "most_liked",
              "latest"
            ],
            "type": "string",
            "description": "You can choose how the search results are sorted: general, more likes or newest.",
            "default": "general"
          },
          "searchPublishTimeFilter": {
            "title": "Publish Time Filter",
            "enum": [
              "all",
              "last_day",
              "last_week",
              "last_half_year"
            ],
            "type": "string",
            "description": "Filter search results by publish time.",
            "default": "all"
          },
          "searchDurationFilter": {
            "title": "Duration Filter",
            "enum": [
              "all",
              "within_one_minute",
              "one_to_five_minutes",
              "over_five_minutes"
            ],
            "type": "string",
            "description": "Filter search results by video duration.",
            "default": "all"
          },
          "postUrls": {
            "title": "Post URLs",
            "type": "array",
            "description": "Should be a list of post URLs you want to scrape.",
            "items": {
              "type": "string"
            }
          },
          "profileUrls": {
            "title": "Profile URLs or UserSecIDs",
            "type": "array",
            "description": "Should be a list of profile URLs you want to scrape. You can also provide UserSecIDs instead of full URLs.",
            "items": {
              "type": "string"
            }
          },
          "profileSortFilter": {
            "title": "Profile Sort Filter",
            "enum": [
              "latest",
              "popular"
            ],
            "type": "string",
            "description": "You can choose how the profile posts are sorted: by latest or popular.",
            "default": "latest"
          },
          "profileOldestPostDate": {
            "title": "Scrape profile videos published after [date]",
            "type": "string",
            "description": "Optional filter. Only valid for profile scraping. Only videos uploaded after or on this date will be scraped. Alternatively, specify how old the scraped videos should be in days. Putting 1 will get you only today's posts, 2 - yesterday's and today's, and so on. Examples: `2023-01-01`, `30 days`, `2 months`, 1 year."
          },
          "profileNewestPostDate": {
            "title": "Scrape videos published before [date]",
            "type": "string",
            "description": "Optional filter. Only valid for profile scraping. Only videos uploaded before or on this date will be scraped. Format should be `YYYY-MM-DD`."
          },
          "shouldDownloadVideos": {
            "title": "Should Download Videos",
            "type": "boolean",
            "description": "Whether to download Douyin video files. Note that this will increase time required for the scrape.",
            "default": false
          },
          "shouldDownloadCovers": {
            "title": "Should Download Covers",
            "type": "boolean",
            "description": "Whether or not to download the video covers.",
            "default": false
          },
          "maxDownloadSize": {
            "title": "Don't download videos larger than",
            "type": "integer",
            "description": "Maximum size in megabytes of the video that will be stored in Key-Value store. Videos larger than this won't be downloaded.",
            "default": 50
          },
          "storageName": {
            "title": "Name/Choose your storage",
            "type": "string",
            "description": "Choose the Key-Value Store where the videos and covers will be stored. Note that if you leave this empty, an unnamed Key-value store will be created and eventually deleted (keeping time depends on your plan). Write the name of the name storage and click in \"Use unkown storage\" option, or select an existing storage"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}