{
  "openapi": "3.0.1",
  "info": {
    "title": "WeChat Official Account Scraper",
    "description": "WeChat Official Account (公众号) articles with read, like and share counts in one row, comments with reply threads, article and account search, and account post history. Every row says whether collection was complete.",
    "version": "0.2",
    "x-build-id": "H7SFauZiiHcpWOPHP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lanternlab318~wechat-official-account/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lanternlab318-wechat-official-account",
        "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~wechat-official-account/runs": {
      "post": {
        "operationId": "runs-sync-lanternlab318-wechat-official-account",
        "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~wechat-official-account/run-sync": {
      "post": {
        "operationId": "run-sync-lanternlab318-wechat-official-account",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to collect",
            "enum": [
              "articles",
              "comments",
              "articleSearch",
              "accountSearch",
              "accountArticles"
            ],
            "type": "string",
            "description": "articles: full article with read, like, wow, share, favorite and comment counts (one row per link). comments: comments and reply threads of each article. articleSearch: articles matching keywords. accountSearch: Official Accounts matching keywords. accountArticles: the post history of accounts.",
            "default": "articles"
          },
          "articleUrls": {
            "title": "Article links",
            "type": "array",
            "description": "WeChat article links: https://mp.weixin.qq.com/s/... or the long https://mp.weixin.qq.com/s?__biz=...&mid=...&idx=...&sn=... form.",
            "items": {
              "type": "string"
            }
          },
          "includeText": {
            "title": "Include article text",
            "type": "boolean",
            "description": "articles mode: add the article body as plain text.",
            "default": true
          },
          "includeHtml": {
            "title": "Include article HTML",
            "type": "boolean",
            "description": "articles mode: add the article body as HTML. Rows get large.",
            "default": false
          },
          "maxCommentsPerArticle": {
            "title": "Max comments per article",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "comments mode: top-level comments to collect per article.",
            "default": 100
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "comments mode: also collect the replies under each comment.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "comments mode: replies to collect per comment thread.",
            "default": 20
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "One search per keyword, in Chinese or any language WeChat search supports.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerKeyword": {
            "title": "Max results per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Results to collect for each keyword.",
            "default": 20
          },
          "maxPagesPerKeyword": {
            "title": "Max search pages per keyword",
            "minimum": 1,
            "type": "integer",
            "description": "Search modes: hard ceiling on the search pages read per keyword. Each page is one upstream request and one charged page event. The whole page that is read is kept, so 1 means exactly one request per keyword and every result that page returns. When WeChat still has more, the keyword summary is partial with stopReason \"max_pages_per_keyword\", which is not the same as stopping at maxResultsPerKeyword. Leave empty for no page ceiling; paging then stops at maxResultsPerKeyword, when WeChat runs out of results, or at maxUpstreamRequests, whichever comes first. Setting it also lowers the request ceiling the Actor derives when maxUpstreamRequests is empty."
          },
          "searchSort": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "latest",
              "popular"
            ],
            "type": "string",
            "description": "Order of search results.",
            "default": "relevance"
          },
          "searchTimeRange": {
            "title": "Published within",
            "enum": [
              "any",
              "day",
              "week",
              "halfYear"
            ],
            "type": "string",
            "description": "articleSearch: only articles published in this period.",
            "default": "any"
          },
          "accounts": {
            "title": "Accounts",
            "type": "array",
            "description": "Official Account IDs (gh_...) or exact account names. A name is looked up first and must match an account name or WeChat ID exactly.",
            "items": {
              "type": "string"
            }
          },
          "maxArticlesPerAccount": {
            "title": "Max articles per account",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Articles to collect per account, newest first.",
            "default": 20
          },
          "publishedAfter": {
            "title": "Published on or after",
            "type": "string",
            "description": "accountArticles: skip articles published before this date (UTC)."
          },
          "publishedBefore": {
            "title": "Published on or before",
            "type": "string",
            "description": "accountArticles: skip articles published after this date (UTC)."
          },
          "maxUpstreamRequests": {
            "title": "Max data source requests",
            "minimum": 0,
            "type": "integer",
            "description": "Hard ceiling on the requests this run may send to the WeChat data source, across every mode and every input line. Counted in HTTP attempts, so an internal retry uses one up. The run never sends more than this, whatever the input asks for; when the ceiling is reached, collection stops there and the rows already written are kept, with the affected summary row partial or failed and stopReason \"upstream_request_cap\", so results can be incomplete. 0 means no request is sent at all. Leave empty and the Actor works the ceiling out from the mode and the limits you set - input lines x requests per line x 2 + 2, which is 6 for one keyword and 20 results - so a run always has an upper bound; the run summary reports the number used in upstreamCap and where it came from in upstreamCapSource."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}