> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

# Find new WeChat articles and import selected links into ima

> Discover new WeChat articles, import approved links into a chosen ima knowledge base and verify each item.

To add an article link you already have, call the ima Skill's `import_urls` operation with the target knowledge base. To follow ten WeChat accounts each week, find new articles with BeatAPI's `wechat_mp.v2.fetch_account_articles`, select the articles relevant to the project, then send the selected links to ima with `import_urls`. Test the flow with one article in a test folder of your research library first.

## Build the import queue

1. Start with a verified Official Account `username`.
2. Send a POST to `https://api.beatapi.io/v1/social-data/call` with `Authorization: Bearer <BEATAPI_API_KEY>` from the scheduler's credentials and `Content-Type: application/json`. Establish a baseline on the first run. If you need older articles, set a separate date range for the backfill.

```json
{"action":"wechat_mp.v2.fetch_account_articles","params":{"username":"<verified_username>","offset":"","item_show_type":0,"raw":false}}
```

3. In a successful response, take each article URL, title, `app_msg_id` and `idx` from `data.articles`. Deduplicate by account and article key. The [incremental collection guide](/guides/wechat-incremental-articles) explains how to bound paging.
4. Record `article_key`, `article_url`, `destination`, `status` and the BeatAPI request ID for each queue entry. Skip entries already imported to the same destination. If one link goes into two libraries, track each destination as a separate entry.

## Import into the chosen library

1. Choose a test knowledge base in ima. Import one webpage URL in the ima client and check that the item reached the right knowledge base.
2. For automation, install the official Skill from the [ima integration page](https://ima.qq.com/agent-interface) and configure the Skill's Client ID and API Key as the installed version instructs. Store the ima credentials separately from the BeatAPI key.
3. Use the Skill to find the knowledge base by name and verify the knowledge base ID. For a subfolder, look up the folder ID as well.
4. Call the installed Skill's `import_urls` operation with the inputs below. Start with one URL, then send batches within the Skill's stated limits. To import into the root, omit `folder_id`.

```json
{"knowledge_base_id":"<knowledge_base_id>","folder_id":"<folder_id>","urls":["https://mp.weixin.qq.com/s/example"]}
```

## Verify each import

1. Mark each URL that returns `ret_code: 0` and a `media_id` as accepted.
2. Find the matching item in the destination folder and check the original link and the readable content. Record each successful item against the item's article key.
3. Retry failed URLs one at a time.
4. After a timeout, search the destination folder for the same link before you send the link again.
5. If the entry exists but the content cannot be read yet, keep the entry pending.

For example, suppose you find three articles and an editor selects two. The first article returns a `media_id` and opens in the destination folder, so mark the first article imported. The request for the second article times out, so look for the second article's original link in the destination folder: verify the content if the item is there, or retry the same URL if the item is still absent. Leave the third article in the candidate list. On the next run, resume from the candidate list and skip the first article, which is already imported. If the team also needs the first article in a second library, queue a new entry for the second library with the same source URL and article key.

Before scheduling, check the flow with one working article and one replay of the same input. Checking one page for each of 10 accounts every week takes 40 list requests over four weeks. If you only send links to ima, BeatAPI usage is the list pages actually requested. To keep an independent local copy of the text, [read the selected article text](/guides/read-wechat-article) as well. Check the price of both BeatAPI call types on the [pricing page](https://beatapi.io/pricing), and account for ima usage under ima's own rules.

[Official ima integration page](https://ima.qq.com/agent-interface) · [Tencent Cloud's ima Skill setup](https://cloud.tencent.com/document/product/248/139217)