{
  "openapi": "3.0.1",
  "info": {
    "title": "WeChat Official Accounts Scraper",
    "description": "📣 Scrape WeChat (Weixin) Official Accounts — user posts, full article content, comments with reader province, engagement metrics, and keyword search. Five operations in one actor. No setup. Independent third-party tool; not affiliated with Tencent / WeChat / Weixin.",
    "version": "1.1",
    "x-build-id": "AfbGDjxAEmaraFfwV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~wechat-official-accounts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-wechat-official-accounts-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/sian.agency~wechat-official-accounts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-wechat-official-accounts-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/sian.agency~wechat-official-accounts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-wechat-official-accounts-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"
        ],
        "properties": {
          "operation": {
            "title": "🎯 Operation — what do you want to scrape?",
            "enum": [
              "userPosts",
              "articleDetail",
              "articleComments",
              "articleFeedback",
              "keywordSearch"
            ],
            "type": "string",
            "description": "🎯 **PICK ONE OPERATION PER RUN.** Each run produces one clean dataset matching the chosen mode.\n\n- **📣 User Posts** — full post history for a WeChat OA, by `wxid` (e.g. `rmrbwx` = People's Daily)\n- **📄 Article Detail** — full article content (title, body text, publish time, author) by `articleUrl`\n- **💬 Article Comments** — reader comments with text, likes, country, province, and reply threads\n- **📊 Article Engagement** — read count, like count, watch count, share count, and comment count for one article\n- **🔍 Keyword Search** — search WeChat by keyword across articles, accounts, channels, or other content types\n\n💡 **TIP:** Run `User Posts` first to discover article URLs, then chain into `Article Detail` / `Comments` / `Engagement` for deep enrichment.",
            "default": "userPosts"
          },
          "wxid": {
            "title": "📣 WeChat Account ID (wxid)",
            "type": "string",
            "description": "📣 **Required for `User Posts` operation.**\n\nThe short ID of the WeChat Official Account. Examples:\n- `rmrbwx` — 人民日报 (People's Daily)\n- `iMacTalk` — 移动新发现\n- `Apple` — Apple official China\n\n💡 **TIP:** Use the `Keyword Search` operation with searchType `accounts` to discover the `wxid` of any account by its display name. The wxid appears in the `aliasName` field of the results.\n\n⚠️ **Ignored** for other operations."
          },
          "articleUrl": {
            "title": "📄 Article URL",
            "type": "string",
            "description": "📄 **Required for `Article Detail`, `Article Comments`, and `Article Engagement` operations.**\n\nThe full WeChat article URL. Format: `https://mp.weixin.qq.com/s/...` or `http://mp.weixin.qq.com/s?__biz=...&mid=...&idx=...&sn=...`\n\nFind these URLs:\n- In the `url` field of any `User Posts` result row\n- In the `doc_url` field of any keyword-search result row\n- Direct copy from any shared WeChat article\n\n💡 **TIP:** Both `http://` and `https://` URLs work. Hash fragments (`#rd`) are optional.\n\n⚠️ **Ignored** for User Posts and Keyword Search operations."
          },
          "keyword": {
            "title": "🔍 Search Keyword",
            "type": "string",
            "description": "🔍 **Required for `Keyword Search` operation.**\n\nAny search query. Supports Chinese, English, and mixed:\n- `人工智能` (AI)\n- `电动汽车` (electric vehicles)\n- `iPhone 15`\n- `双十一` (Singles Day)\n\n💡 **TIP:** Pair with `Search Type` to target accounts (`accounts`), articles (`articles`), or specific content like news (`news`) or mini-programs (`mini_programs`)."
          },
          "searchType": {
            "title": "🗂️ Search Type",
            "enum": [
              "articles",
              "accounts",
              "all",
              "channels",
              "mini_programs",
              "news",
              "moments",
              "live_streams",
              "books",
              "music",
              "emoji",
              "encyclopedia",
              "weixin_index"
            ],
            "type": "string",
            "description": "🗂️ **Applies to `Keyword Search` only.** What kind of content to return.\n\n- `all` — All result types (default)\n- `accounts` — Official Accounts (公众号) — best for discovering `wxid` values\n- `articles` — Articles (文章) — best for trend research\n- `channels` — WeChat Channels videos\n- `mini_programs` — Mini Programs\n- `news` — News results\n- `moments` — Moments posts\n- `live_streams` — Live streams\n- `books` — Books\n- `music` — Music\n- `emoji` — Emoji / stickers\n- `encyclopedia` — Encyclopedia entries\n- `weixin_index` — WeChat Index trends",
            "default": "articles"
          },
          "sortType": {
            "title": "📊 Sort Order",
            "enum": [
              "_0",
              "_4",
              "_2",
              "_3"
            ],
            "type": "string",
            "description": "📊 **Applies to `Keyword Search` only.** How to order results.\n\n- `_0` — Default sort\n- `_4` — By popularity (hot)\n- `_2` — By recency\n- `_3` — By relevance",
            "default": "_0"
          },
          "maxPages": {
            "title": "📄 Max pages to fetch",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "📄 **Applies to paginated operations** (User Posts, Keyword Search, Article Comments). Ignored for Article Detail and Article Engagement.\n\n- **User Posts:** posts are returned in a single call; pagination unused\n- **Keyword Search:** ~20 results per page (offset increments by 20)\n- **Article Comments:** all comments returned in a single call; pagination unused\n\n💡 **TIP:** Start small (1–3 pages) to preview results before scaling up.\n\n⚠️ Hard cap: 50 pages to prevent runaway runs.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}