ナビゲーションにスキップ

How do I index Videos and Pictures from a WeChat account and choose useful examples?

Index each homepage tab as its own list with wechat_mp.v2.fetch_account_articles: pass the verified WeChat Official Account username, set item_show_type:5 for the Videos tab or 8 for the Pictures tab, and start each tab with an empty offset. Continue each tab with that tab’s data.next_offset. wechat_mp.v2.fetch_account_articles ignores page_size, so count the items you actually receive. Choose examples by real publication date after opening the original items. With only a display name, first verify the account from a public article.

Fetch one video page, then repeat for Pictures

curl -sS https://api.beatapi.io/v1/social-data/call \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"action":"wechat_mp.v2.fetch_account_articles","params":{"username":"<username>","item_show_type":5,"raw":false,"offset":""}}' \
-o wechat-videos-page-1.json

Set item_show_type to 8 for Pictures, 0 for Articles or 7 for Audio. Articles, Videos, Audio and Pictures are tabs on the Official Account homepage. For a separate WeChat Channels account, start with its Channels ID.

Continue inside the same tab

  1. Check that the request succeeded. With raw:false, save titles, original links and publication dates from data.articles. Record the number of items actually returned.
  2. When there is another page, pass the tab’s data.next_offset unchanged as the next offset. Keep the account, the item_show_type value and the raw setting the same. Stop at data.is_end, a missing or repeated cursor, an error or your page limit.
  3. To collect 50 items from each tab, deduplicate and count the rows you receive. wechat_mp.v2.fetch_account_articles ignores page_size. If you stop before 50, report how many unique items you found, how many pages you checked and why you stopped.

For example, a team needs last month’s product demos and event posters. The first scan returns 12 videos and eight picture posts. Record the Videos count and the Pictures count separately, filter both lists by actual publication date and open the original items to verify what each item covers. If the page budget runs out, record which dates remain unchecked. One page per tab is two requests, and each additional page is one more request. BeatAPI pricing

Export two lists from saved responses

Use wechat_history.py from the account history guide. Write one manifest with item_show_type:5 and a second manifest with item_show_type:8. Start both manifests with an empty offset and raw:false. For each call, save the actual HTTP status, the collection time and the response file.

python3 wechat_history.py - video-pages.json videos-001
python3 wechat_history.py - image-pages.json images-001

To resume a tab, pass that tab’s own next-request.json and output directory. To start a new tab, pass -. Read counts and stop reasons in coverage.json, the tab’s current list in state.json, and new rows in new-articles.csv. The export contains post metadata only; to watch a video or read a picture post, open the original item.