微信公众号 icon

微信公众号

微信公众号 API

Overview

This node integrates with the WeChat Official Account API, specifically providing functionality to manage users. The "获取用户列表" (Get User List) operation retrieves a list of users who follow the official account. This is useful for scenarios where you want to analyze your audience, segment users, or perform bulk messaging based on user data.

For example, you might use this node to:

  • Fetch all followers of your WeChat Official Account to sync them with your CRM.
  • Paginate through large follower lists by using the last retrieved OpenID.
  • Extract user identifiers for targeted marketing campaigns.

Properties

Name Meaning
最后的OpenID The last OpenID from the previous batch of the user list; if empty, fetching starts from the beginning.
选项 Additional options:
   仅输出数据列表 Boolean option to return only the array of user data instead of the full response object.

Output

The node outputs JSON data containing the user list information retrieved from the WeChat API. The main output field json includes:

  • A list/array of user OpenIDs representing the followers.
  • Pagination information such as the next OpenID to continue fetching more users.
  • Other metadata related to the user list retrieval.

If the option "仅输出数据列表" (onlyReturnData) is enabled, the output will be simplified to just the array of user OpenIDs without additional metadata.

The node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the WeChat Official Account API.
  • The base URL defaults to https://api.weixin.qq.com/cgi-bin/ but can be overridden via credentials.
  • Proper configuration of the WeChat Official Account API credentials in n8n is necessary.

Troubleshooting

  • Empty or incomplete user list: Ensure that the "最后的OpenID" property is correctly set when paginating through large user lists. If omitted, the node fetches from the start.
  • Authentication errors: Verify that the API key credential is valid and has sufficient permissions.
  • API rate limits: The WeChat API may limit the number of requests; consider adding delays or handling pagination carefully.
  • Incorrect output format: If enabling "仅输出数据列表," expect only the user array; otherwise, the full response object is returned.

Links and References

Discussion