{
  "openapi": "3.0.1",
  "info": {
    "title": "Zhihu Scraper (知乎) | Search, Answers, Comments & Profiles",
    "description": "Search Zhihu and collect answers, articles, comments, replies, creator profiles and trending questions. Export structured JSON, CSV or Excel.",
    "version": "0.0",
    "x-build-id": "7OQ8oxQ3tp42gOWhH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zen-studio~zhihu-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zen-studio-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/zen-studio~zhihu-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zen-studio-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/zen-studio~zhihu-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zen-studio-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": {
          "operation": {
            "title": "Operation · 采集类型",
            "enum": [
              "search",
              "question_answers",
              "content_detail",
              "comments",
              "comment_replies",
              "user_profile",
              "user_content",
              "hot_list"
            ],
            "type": "string",
            "description": "Choose <b>one operation per run</b>.<br><br><b>Question answers:</b> collects an initial batch of up to 100 entries; a complete answer list is not guaranteed, and incomplete targets are flagged.<br><b>Creator articles:</b> collects published articles, not the creator's answers.",
            "default": "search"
          },
          "keywords": {
            "title": "Search keywords · 搜索关键词",
            "maxItems": 100,
            "type": "array",
            "description": "<b>Search only.</b> Add Chinese or English terms, one per entry. Up to 100 keywords.<br><br>Each keyword is searched independently, but <b>Maximum total results</b> is shared across them. Duplicate results are saved once.",
            "items": {
              "type": "string",
              "maxLength": 2048
            }
          },
          "max_items": {
            "title": "Maximum total results · 总结果上限",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Set the <b>run-wide ceiling</b> across all keywords or targets. For example, 20 means at most 20 rows in total, not 20 per keyword.<br><br>The example uses <code>20</code>; omitted programmatic input defaults to <code>100</code>. The per-target limit and available budget also apply. You are charged only for saved results, excluding duplicates and failed targets.<br><br>Free-plan access: 25 results per run and 100 lifetime results, processing the first keyword or target within a bounded collection window. No lifetime run-count cap.",
            "default": 100
          },
          "max_per_target": {
            "title": "Maximum results per target · 单项上限",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Set the ceiling for <b>each individual input</b>: one keyword in Search, one URL for URL-based operations, or one comment ID in Comment replies. For Hot list, this limits the single list.<br><br><b>Maximum total results</b> still caps the whole run. For example, 50 per keyword and 100 total across three keywords can save at most 100 rows. To collect up to 500 rows from one keyword, set <b>both limits to 500</b>.<br><br>These are ceilings, not guaranteed counts. Availability, budget, and free-plan limits still apply.",
            "default": 100
          },
          "urls": {
            "title": "Target URLs or IDs · 链接或 ID",
            "maxItems": 100,
            "type": "array",
            "description": "Add up to 100 URLs or IDs for the selected operation.<br><br><b>Question answers:</b> <code>https://www.zhihu.com/question/21277368</code> or a question ID.<br><b>Content details:</b> question URLs, answer URLs such as <code>https://www.zhihu.com/answer/2018829744922206890</code>, article URLs such as <code>https://zhuanlan.zhihu.com/p/2032860336215307118</code>, or pin URLs.<br><b>Comments:</b> answer, article, or pin URLs, not question URLs.<br><b>Creator profiles / articles:</b> <code>https://www.zhihu.com/people/11-11-98-14</code> or the profile slug <code>11-11-98-14</code>.<br><br>Full URLs identify their own content type. For bare detail/comment IDs, select the matching <b>Content type</b>. Standalone <code>/zvideo/</code> URLs are not supported; pin video URLs are.",
            "items": {
              "type": "string",
              "maxLength": 2048
            }
          },
          "include_replies": {
            "title": "Include replies · 包含回复",
            "type": "boolean",
            "description": "<b>Comments only.</b> Also collect replies under the comments found at your answer, article, or pin URLs. No comment IDs needed.<br><br>Each reply is a separate row linked by <code>parent_comment_id</code>. Comments and replies share <b>both result limits</b> above and your spending limit; each saved row has the same result price. Threads are collected after their parent comments, so a small limit may stop partway through a thread.<br><br>Off by default for top-level comments only. This does not change the separate <b>Comment replies</b> operation.",
            "default": false
          },
          "comment_ids": {
            "title": "Comment IDs for replies · 一级评论 ID",
            "maxItems": 100,
            "type": "array",
            "description": "<b>Comment replies · 评论回复 only.</b> For the simpler URL-based workflow, select <b>Comments</b> and enable <b>Include replies</b> instead; leave this field empty.<br><br>To collect replies to specific comments, take their <code>comment_id</code> values from a previous Comments dataset. Prefer top-level comments with <code>reply_count</code> greater than zero. Your AI assistant or automation can pass these values straight into <code>comment_ids</code>; no manual lookup on Zhihu is needed.<br><br>Use the top-level comment's ID, not an answer or article ID. Enter up to 100 IDs, one per entry, and keep them as strings in JSON to preserve their full precision.",
            "items": {
              "type": "string",
              "maxLength": 2048
            }
          },
          "content_type": {
            "title": "Content type · 内容类型",
            "enum": [
              "all",
              "answer",
              "article",
              "video",
              "pin",
              "question"
            ],
            "type": "string",
            "description": "<b>Search:</b> choose All types, Answers, Articles, or Videos.<br><br><b>Bare numeric detail/comment IDs:</b> choose Answers, Articles, or Pins. Questions is for question details; Question answers already knows its input type. Full URLs identify their own type.<br><br>Pins and Questions are ID-type choices, not dedicated search filters.",
            "default": "all"
          },
          "sort": {
            "title": "Search order",
            "enum": [
              "relevance",
              "upvotes",
              "newest"
            ],
            "type": "string",
            "description": "<b>Search only.</b> Choose the ranking within each keyword's results. Leave <b>Relevance</b> selected for a standard search.<br><br>Results from different keywords can be interleaved; this does not globally sort the combined dataset.",
            "default": "relevance"
          },
          "publish_time_range": {
            "title": "Published in",
            "enum": [
              "all",
              "day",
              "week",
              "month",
              "three_months",
              "half_year",
              "year"
            ],
            "type": "string",
            "description": "<b>Search only.</b> Restrict results to the selected publication window. Use <b>Past week</b> for recent discussions, or <b>Any time</b> for broader coverage.",
            "default": "all"
          },
          "comment_sort": {
            "title": "Comment order",
            "enum": [
              "popular",
              "newest"
            ],
            "type": "string",
            "description": "<b>Comments and Comment replies only.</b> Choose Popular for relevance or Newest for recent discussion.",
            "default": "popular"
          },
          "include_html": {
            "title": "Include HTML",
            "type": "boolean",
            "description": "Keep cleaned <code>content_html</code> alongside plain <code>content</code> where available. Enabled by default so paragraphs, links, and formatting remain usable. Turn off for smaller exports.",
            "default": true
          },
          "include_markdown": {
            "title": "Include Markdown",
            "type": "boolean",
            "description": "Also add <code>content_markdown</code> where available, useful for document processing and knowledge bases. Off by default; enable only when needed.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}