{
  "openapi": "3.0.1",
  "info": {
    "title": "Zhihu Scraper",
    "description": "Zhihu Scraper extracts Zhihu questions, answers, articles, user profiles, comments, followers, and engagement data automatically for research, marketing, and lead generation. 高效抓取知乎问题、回答、文章、用户资料、评论、粉丝及互动数据，助力数据分析与市场研究。",
    "version": "0.1",
    "x-build-id": "ejZEJzQDwJvxbGd4N"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-fleet~zhihu-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-fleet-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/scraper-fleet~zhihu-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-fleet-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/scraper-fleet~zhihu-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-fleet-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",
        "required": [
          "operation",
          "cookie"
        ],
        "properties": {
          "operation": {
            "title": "1️⃣ Operation 操作",
            "enum": [
              "search",
              "question_answers",
              "content_detail",
              "comments",
              "comment_replies",
              "user_profile",
              "user_content",
              "hot_list"
            ],
            "type": "string",
            "description": "What to scrape. 选择要执行的操作。 search/question_answers/content_detail/user_profile/user_content need Keywords or URLs below; comments/comment_replies need URLs or Comment IDs.",
            "default": "search"
          },
          "cookie": {
            "title": "Cookie",
            "type": "string",
            "description": "Paste a `Cookie:` header string (DevTools → Network → any www.zhihu.com request → Copy as cURL, take the -b/--cookie value) OR a Cookie-Editor/EditThisCookie JSON export. Only z_c0, __zse_ck and d_c0 are required; extra cookies are harmless. These expire — re-harvest when runs start failing. 仅需 z_c0、__zse_ck 、d_c0 三个 Cookie，过期后请重新获取。"
          },
          "keywords": {
            "title": "Keywords 关键词",
            "type": "array",
            "description": "search only. One search per keyword, results deduped globally. 仅用于 search 操作，每个关键词独立执行一次搜索。",
            "default": [
              "ai"
            ],
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "URLs 链接",
            "type": "array",
            "description": "question_answers / content_detail / comments / user_profile / user_content: one or more Zhihu URLs (question/answer/article/pin/people) or bare numeric IDs. 适用于以上操作，填入知乎链接或纯ID。",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "comment_ids": {
            "title": "Comment IDs 评论 ID",
            "type": "array",
            "description": "comment_replies only: one or more root comment IDs to fetch replies for. 仅用于 comment_replies 操作。",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "max_items": {
            "title": "Max items (this run) 本次运行最大条数",
            "minimum": 1,
            "type": "integer",
            "description": "Run-wide cap across all keywords/targets combined. A per-run limit also applies on top of this (see Actor log if it is hit). 本次运行跨所有关键词/目标的总上限。",
            "default": 20
          },
          "max_per_target": {
            "title": "Max items per target 每个目标最大条数",
            "minimum": 1,
            "type": "integer",
            "description": "Cap for a single keyword / URL / comment ID. 单个关键词或链接的最大采集条数。",
            "default": 20
          },
          "maxRetries": {
            "title": "Max retries per request 每个请求重试次数",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Retries for a single failed HTTP request before giving up on it. 单个请求失败后的重试次数。",
            "default": 3
          },
          "maxScanned": {
            "title": "Max rows scanned per search target 每个搜索最大扫描行数",
            "minimum": 100,
            "type": "integer",
            "description": "search only: rows examined before giving up on a client-side content-type filter. 仅用于 search，防止过滤条件过严导致无限扩展。",
            "default": 20000
          },
          "content_type": {
            "title": "Content type 内容类型",
            "enum": [
              "all",
              "answer",
              "article",
              "video",
              "pin",
              "question"
            ],
            "type": "string",
            "description": "search: filter results by type. content_detail/comments bare-ID hint: tells the scraper what a bare numeric ID is. 用于 search 结果过滤，或给 content_detail/comments 的纯 ID 指定类型。",
            "default": "all"
          },
          "sort": {
            "title": "Sort 排序",
            "enum": [
              "relevance",
              "upvotes",
              "newest"
            ],
            "type": "string",
            "description": "search only. upvotes/newest are applied client-side after fetching. 仅用于 search，upvotes/newest 在客户端重新排序。",
            "default": "relevance"
          },
          "publish_time_range": {
            "title": "Publish time range 发布时间范围",
            "enum": [
              "all",
              "day",
              "week",
              "month",
              "three_months",
              "half_year",
              "year"
            ],
            "type": "string",
            "description": "search only, applied client-side. 仅用于 search，客户端过滤。",
            "default": "all"
          },
          "comment_sort": {
            "title": "Comment sort 评论排序",
            "enum": [
              "popular",
              "newest"
            ],
            "type": "string",
            "description": "comments/comment_replies: popular is the server default; newest is re-sorted client-side. 用于 comments/comment_replies。",
            "default": "popular"
          },
          "include_replies": {
            "title": "Include replies 包含回复",
            "type": "boolean",
            "description": "comments only: also walk reply threads under each root comment. 仅用于 comments，是否采集每条评论的回复。",
            "default": false
          },
          "include_html": {
            "title": "Include HTML content 包含 HTML 内容",
            "type": "boolean",
            "description": "Keep the raw content_html field in the output. 输出保留 content_html 原始 HTML。",
            "default": true
          },
          "include_markdown": {
            "title": "Include Markdown content 包含 Markdown 内容",
            "type": "boolean",
            "description": "Add a best-effort Markdown conversion of the content. 输出添加 Markdown 转换内容。",
            "default": false
          },
          "proxyOptions": {
            "title": "Proxy configuration 代理设置",
            "type": "object",
            "description": "Apify Proxy configuration (or leave default to run without a proxy)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}