{
  "openapi": "3.0.1",
  "info": {
    "title": "WeChat Official Account Articles Scraper",
    "description": "Scrape WeChat Official Account (公众号) articles by keyword, link, album or account, no login: full text, Markdown, images, permanent link, author, date, IP region, original badge, album. Export to JSON, CSV or Excel.",
    "version": "0.0",
    "x-build-id": "KemShZj4PNHh6xFtF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nice_dev~wechat-articles-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nice_dev-wechat-articles-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/nice_dev~wechat-articles-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nice_dev-wechat-articles-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/nice_dev~wechat-articles-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nice_dev-wechat-articles-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": {
          "query": {
            "title": "Search keyword",
            "maxLength": 200,
            "type": "string",
            "description": "Article search on WeChat (through Sogou WeChat search), Chinese or English, exactly as you would type it (e.g. `人工智能`). WeChat shows at most about 100 articles per keyword (10 pages): add more keywords below to collect more."
          },
          "searchQueries": {
            "title": "More search keywords",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Several keywords in one run: one search per keyword. Added to **Search keyword**; articles found by several searches are saved once. Up to 500 searches in all per run (words, search URLs, albums and accounts together).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "articleUrls": {
            "title": "Article links",
            "maxItems": 1000,
            "uniqueItems": true,
            "type": "array",
            "description": "WeChat article links, any form: permanent (`https://mp.weixin.qq.com/s?__biz=…&mid=…&idx=…&sn=…&chksm=…`), short (`https://mp.weixin.qq.com/s/AbC123`), temporary search links (`…/s?src=11&timestamp=…&signature=…`) or Sogou links (`https://weixin.sogou.com/link?url=…`). With **Full article** on: the whole article. Off: link conversion only (permanent link when WeChat reveals it, IDs, account, title, date), charged as a link conversion. Max 1 000.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "albumUrls": {
            "title": "Album (合集) links",
            "maxItems": 200,
            "uniqueItems": true,
            "type": "array",
            "description": "WeChat album links (`https://mp.weixin.qq.com/mp/appmsgalbum?__biz=…&album_id=…`), or an article link: every article of its album is collected, newest first, with its permanent link. Max 200 albums. Up to 500 searches in all per run (words, search URLs, albums and accounts together).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "Sogou WeChat search links",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Search-result links copied from weixin.sogou.com (`https://weixin.sogou.com/weixin?type=2&query=…`). Pagination is automatic (10 pages at most). Up to 500 searches in all per run (words, search URLs, albums and accounts together).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "accounts": {
            "title": "Official accounts",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Account display names (e.g. `中国基金报`), WeChat IDs (e.g. `chinafundnews`) or any article link of the account. Without login: the account's most visible articles found by search (about 100 at most, not its full archive). With the optional WeChat login below: its full article history, and `gh_` IDs are accepted too. Up to 500 searches in all per run (words, search URLs, albums and accounts together).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max articles",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of articles to save for the whole run (after deduplication and filters). 0 = no limit.",
            "default": 100
          },
          "maxItemsPerQuery": {
            "title": "Max articles per search",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap for EACH keyword, search link, album or account, so that the first one cannot use up the whole **Max articles** budget. 0 = no per-search cap.",
            "default": 0
          },
          "maxPagesPerQuery": {
            "title": "Max search pages per keyword",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Search-result pages read per keyword or search link (10 articles each). WeChat search stops at page 10.",
            "default": 10
          },
          "extractDetails": {
            "title": "Full article",
            "type": "boolean",
            "description": "Open each article page for the full text, author, all images (with size), permanent link (`sn` + `chksm`), original badge, IP region of publication, hashtags, album, video IDs, account WeChat ID and `gh_` ID. Charged as a full article on top of the result (see Pricing). Off = search-card fields only (title, summary, account name, date, cover, temporary link).",
            "default": false
          },
          "includeMarkdown": {
            "title": "Markdown body",
            "type": "boolean",
            "description": "With **Full article**: also return the body as Markdown (headings, lists, links, images kept). Free.",
            "default": true
          },
          "includeHtml": {
            "title": "HTML body",
            "type": "boolean",
            "description": "With **Full article**: also return the raw HTML of the body (large: 20-300 KB per article). Free.",
            "default": false
          },
          "includeAccountProfiles": {
            "title": "Account profiles",
            "type": "boolean",
            "description": "Add one row per official account that has an article row in the results (type `account`): name, WeChat ID, `gh_` ID, biz, description, avatar, verification, number of its articles in this run, latest article. Without `extractDetails`, this reads one more page per account. An account not read in time gets no row and is not charged. Charged per account profile (see Pricing).",
            "default": false
          },
          "includeMarketStats": {
            "title": "Statistics per search (paid option)",
            "type": "boolean",
            "description": "Adds one sheet of figures per search (keyword, album, account or pasted Sogou link): articles delivered and results WeChat search announces, first and last publication date, articles per day (Beijing time, UTC+8), number of accounts and the top 10 accounts, shares of original and paid articles, article types, articles with images, average text length, top 10 hashtags and IP regions. Worked out from the articles this run delivers (with Only new articles, the new ones only); nothing is added to the dataset. Shares count only the articles that give the value, and each share comes with that number: most page fields need Full article. Find it in Storage → Key-value store → `MARKET_STATS`, or in the Output tab. Charged per sheet delivered, at the end of the run (event `market-stats`, see Pricing).",
            "default": false
          },
          "includeWechatIndex": {
            "title": "WeChat Index (paid option)",
            "type": "boolean",
            "description": "Adds one row per keyword (type `wechat-index`) with its WeChat Index: the popularity of the keyword in WeChat, one value a day over the last 30 days (Beijing calendar), the latest value and the change over the period. Uses the keywords of `query` and `searchQueries` only. Paid Apify plan only. Charged per keyword looked up, also when WeChat has no data for it (event `wechat-index`, see Pricing). Rows are always delivered, also with Only new articles.",
            "default": false
          },
          "includeSearchSuggestions": {
            "title": "Search suggestions (paid option)",
            "type": "boolean",
            "description": "Adds one row per keyword (type `search-suggestions`) with the words WeChat search suggests for it, in its order. Uses the keywords of `query` and `searchQueries` only. Paid Apify plan only. Charged per keyword looked up, also when WeChat has no suggestion for it (event `search-suggestions`, see Pricing). Rows are always delivered, also with Only new articles.",
            "default": false
          },
          "suggestionScope": {
            "title": "Suggestions from",
            "enum": [
              "ALL",
              "ACCOUNT",
              "ARTICLE",
              "CHANNEL",
              "MOMENTS",
              "LIVE",
              "EMOJI",
              "AUDIO",
              "BOOK",
              "WECHAT_INDEX",
              "NEWS",
              "MINI_PROGRAM",
              "ENCYCLOPEDIA"
            ],
            "type": "string",
            "description": "With **Search suggestions**: the part of WeChat search the suggestions come from. `ALL` = no filter.",
            "default": "ALL"
          },
          "postedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only articles published on or after this date (publication time of the article, Beijing time converted to UTC): `2026-09-01`, or a period before now such as `7 days`, `2 weeks`, `1 month` (API: `24 hours` and full ISO date-times work too)."
          },
          "postedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only articles published on or before this date (the whole day is included), or older than a period such as `30 days`."
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Drop the articles whose title or summary (the search snippet, or the digest the account wrote) contains one of these words (case ignored).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywordLabels": {
            "title": "Keyword labels (free)",
            "maxItems": 50,
            "type": "array",
            "description": "Put your own labels on the articles, free of charge. One line per label: `Tech: AI, chip, 芯片` adds the label `Tech` to an article when at least one of the words is found in its title, summary or text. Separate the words with a comma, an English one or a Chinese one (， or 、). A line with no colon, such as `blockchain`, is one word that is its own label. Case, accents and full-width letters are ignored; a word is found anywhere in the text, so it also works for Chinese. The text is only available with Full article; without it, only the title and the summary are searched. The labels found are listed in `matchedLabels`. Nothing is dropped: an article with no label is still delivered.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new articles",
            "type": "boolean",
            "description": "Skip the articles that a previous run (same **Memory key**) already delivered: they are not saved again; each one a run reads again costs one filter check (Sogou's results are ordered by relevance, not by date, so a run reads them to find the new ones). For articles found by search, album, account or history, their page is not even opened (a pasted article link is opened to be recognised, but never saved or charged as an article). First run = everything is new.",
            "default": false
          },
          "stateKey": {
            "title": "Memory key",
            "pattern": "^[a-zA-Z0-9_-]{1,64}$",
            "maxLength": 64,
            "type": "string",
            "description": "Name of the memory used by **Only new articles**. Give each schedule / task its own key (e.g. `ai-news`) so that they do not share their memory. Letters, digits, `-` and `_`.",
            "default": "default"
          },
          "resetState": {
            "title": "Reset the memory",
            "type": "boolean",
            "description": "Forget everything remembered under this **Memory key** before the run: this run returns (and charges) every article again. Untick it afterwards.",
            "default": false
          },
          "mpCookie": {
            "title": "mp.weixin.qq.com cookie",
            "type": "string",
            "description": "The `Cookie` header of mp.weixin.qq.com after login (browser developer tools → Network → any request → Cookie). Stored encrypted, never written to the log or the results."
          },
          "mpToken": {
            "title": "mp.weixin.qq.com token",
            "type": "string",
            "description": "The number after `token=` in the address bar of mp.weixin.qq.com once logged in (e.g. `1234567890`)."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy or your own proxies. Keep the default: it is included in the price, and the Actor changes IP by itself when WeChat search asks for a captcha. The residential Apify proxy is not available in this Actor.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of requests processed in parallel.",
            "default": 8
          },
          "maxRequestsPerMinute": {
            "title": "Max requests per minute",
            "minimum": 10,
            "maximum": 2000,
            "type": "integer",
            "description": "Most requests to WeChat and Sogou in any 60 seconds, all of them counted: search pages, link pages, article pages and album pages. A budget, not an even pace: up to this many can leave at once when the minute starts (spread them with the minimum delay below). Lower it if the log shows many captchas.",
            "default": 120
          },
          "minRequestIntervalMs": {
            "title": "Min delay between requests",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Smallest gap between two requests, in milliseconds. Unlike the per-minute rate, this spreads the requests evenly instead of letting them go out in a burst. 0 = no gap.",
            "default": 0
          },
          "maxRequestRetries": {
            "title": "Max request retries",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Retries per request before it is marked as failed. Behind a proxy, a request the site turns away (captcha) is also retried on a new proxy session up to 10 times without using up these retries.",
            "default": 5
          },
          "debugLog": {
            "title": "Debug log",
            "type": "boolean",
            "description": "Include debug messages in the run log.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}