{
  "openapi": "3.0.1",
  "info": {
    "title": "Zhihu Scraper: Answers, Articles, Comments & Hot List",
    "description": "Zhihu Scraper for answers and articles by keyword, the answers under a question, the posts of any user, single answers by link, comments and the live hot list. Plain text, upvotes, dates and authors. No login, date and upvote filters, pay only for real rows.",
    "version": "0.1",
    "x-build-id": "O1Bli4xS6LMfZaC4V"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apisamurai~zhihu-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apisamurai-zhihu-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/apisamurai~zhihu-scraper/runs": {
      "post": {
        "operationId": "runs-sync-apisamurai-zhihu-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/apisamurai~zhihu-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-apisamurai-zhihu-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": {
          "searchKeywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Find answers and articles that match these keywords. One per line. Chinese keywords work best, for example 人工智能.",
            "items": {
              "type": "string"
            }
          },
          "searchSort": {
            "title": "Search order",
            "enum": [
              "relevance",
              "upvotes",
              "newest"
            ],
            "type": "string",
            "description": "How keyword search results are ordered.",
            "default": "relevance"
          },
          "searchTime": {
            "title": "Search time window",
            "enum": [
              "any",
              "day",
              "week",
              "month",
              "3months",
              "6months",
              "year"
            ],
            "type": "string",
            "description": "Only search results from this period. This narrows the search itself; for exact days use Posted on or after.",
            "default": "any"
          },
          "searchContentTypes": {
            "title": "Search results to keep",
            "enum": [
              "both",
              "answers",
              "articles"
            ],
            "type": "string",
            "description": "Keep answers, articles or both from keyword search. Rows of the other kind are skipped and not charged.",
            "default": "both"
          },
          "questionUrls": {
            "title": "Question links",
            "type": "array",
            "description": "Get the answers under these questions. Links like https://www.zhihu.com/question/2111578255526466833 or bare question numbers. A link with /answer/ after it still means the whole question here. One per line.",
            "items": {
              "type": "string"
            }
          },
          "questionAnswerSort": {
            "title": "Answer order under a question",
            "enum": [
              "default",
              "newest"
            ],
            "type": "string",
            "description": "Zhihu's default order, or the most recently updated answers first.",
            "default": "default"
          },
          "users": {
            "title": "Users",
            "type": "array",
            "description": "Get the latest answers and articles of these accounts, newest first. Profile links like https://www.zhihu.com/people/zai-ping-lun-wo-jiu-shi-zhu or just the name at the end of the link. One per line.",
            "items": {
              "type": "string"
            }
          },
          "userContent": {
            "title": "What to get from a user",
            "enum": [
              "both",
              "answers",
              "articles"
            ],
            "type": "string",
            "description": "Answers, articles or both. With both, the answers come first.",
            "default": "both"
          },
          "postUrls": {
            "title": "Answer and article links",
            "type": "array",
            "description": "Get one answer or article for each link, with all its numbers: https://www.zhihu.com/question/2111578255526466833/answer/2111582747298902450, https://www.zhihu.com/answer/2063420040297308669 or https://zhuanlan.zhihu.com/p/2109831131503784733. One per line.",
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Also get comments of the answers found",
            "type": "boolean",
            "description": "On: for the answers saved from search, questions, users and links, also save their comments (up to Max comments per answer). An answer with no comments costs nothing. Articles have no comments here.",
            "default": false
          },
          "includeHotList": {
            "title": "Add the hot list",
            "type": "boolean",
            "description": "On: also save the current Zhihu hot list (about 30 questions with rank, heat and counts).",
            "default": false
          },
          "maxPostsPerSource": {
            "title": "Max answers and articles per keyword, question or user",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum answers and articles saved for each keyword, each question and each user. Enforced exactly.",
            "default": 100
          },
          "maxCommentsPerPost": {
            "title": "Max comments per answer",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum comments saved for each answer. Enforced exactly.",
            "default": 20
          },
          "maxTotalItems": {
            "title": "Max rows for the whole run",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Optional hard cap on all rows (answers, articles, comments and hot questions) across the run. Answers and articles are saved before comments. Leave empty for no total cap."
          },
          "postedAfter": {
            "title": "Posted on or after",
            "type": "string",
            "description": "Only answers and articles published on or after this day (UTC). Also accepts relative dates such as 7 days. Applies to answers and articles, not comments. Rows outside the range are skipped and not charged. A user's feed stops once its rows are older than this day."
          },
          "postedBefore": {
            "title": "Posted on or before",
            "type": "string",
            "description": "Only answers and articles published on or before this day (UTC, the whole day is included). Rows outside the range are skipped and not charged."
          },
          "minUpvotes": {
            "title": "Min upvotes",
            "minimum": 0,
            "type": "integer",
            "description": "Skip answers and articles with fewer upvotes. Skipped rows are not charged."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}