# Get basic user information in bulk

Debugging Tools

Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide

Interface English name: batchUserinfo

This interface is used for bulk retrieval of user basic information. A maximum of 100 pieces is supported at a time.

# 1. How to call

# HTTPS calls

POST https://api.weixin.qq.com/cgi-bin/user/info/batchget?access_token=ACCESS_TOKEN

# Cloud Calls

  • Call method: officialAccount.user.batchGetInfo

  • The input and exit parameters are the same as the HTTPS call, which can be called in the cloud call documentation

# Third party invocation

  • This interface supports Third Party Platform generation business call.

  • The permission set id to which the interface belongs is: 2,100

  • When a service provider is authorized by one of the permissions set, it can call on behalf of the merchant by using authorizer_access_token , which can be viewed in the third-party call documentation.

# 2. Request parameters

# Query parametersQuery String parameters

Parameter NametypeRequired to fill inIntroductions
access_tokenstringyesInterface invocation credentials, using access_token , authorizer_access_token

# Request BodyRequest Payload

Parameter NametypeRequired to fill inIntroductions
user_listobjarrayyesList of users

# Body.user_list(Array)Object Payload

List of users

Parameter NametypeRequired to fill inExampleIntroductions
openidstringyesotvxTs4dckWG7imySrJd6jSi0CWEThe user's identity is unique to the current Official Account;Must be the openid of the user you care about
langstringnozh_CNNational and regional language version, zh_CN simplified, zh_TW traditional, en English, default to zh_CN

# 3. Return Parameters

# Response Payload

Parameter NametypeIntroductions
user_info_listobjarrayList of users

# Res.user_info_list(Array)Object Payload

List of users

Parameter NametypeIntroductions
subscribenumberIf the user subscribes to the Official Account ID, a value of 0 means that the user does not follow the Official Account message template and cannot pull the rest of the message.
openidstringUser's ID, unique to the current Official Account
nicknamestringUser nickname
sexnumberUser's gender, when the value is 1 is male, when it is 2 is female, when its value is 0 is unknown
languagestringUser's language, simplified Chinese for zh_CN
citystringCities populated by the average user's profile
provincestringProvinces in which the user's profile was filled
countrystringCountries, such as China for CN
headimgurlstringUser avatar. The last value represents the square avatar size (there are 0, 46, 64, 96, 132 values optional, and 0 represents a 640 * 640 square avatar). This item is empty when the user does not have a avatar.If the user changes the avatar, the original avatar URL will become invalid.
subscribe_timenumberUsers pay attention to the time, which is a time stamp. If the user has followed it several times, then the last followed time is taken
unionidstringThis field appears only after the user has bound Official Account to WeChat open platform account.See: Access to user personal information (UnionID mechanism)
remarkstringOfficial Account The Official Account message template can be added by WeChat Official Account message.
groupidnumberThe user's group ID (temporarily compatible with the old user group interface)
tagid_list-List of tag IDs the user has been hit with
subscribe_scenenumberReturn to the channel source of user concern, ADD_STORY_SEARCH Official Account search, ADD_STORY_ACCOUNT_MIGRATION Official Account, ADD_STORY_PROFILE_CARD business card sharing, ADD_STORY_QR_CODE scan two-dimensional code,ADD_SCENE_PROFILE_LINK: Click the name on the graphic page, ADD_SCENE_PROFILE_ITEM: Menu in the upper right corner of the graphic page, ADD_SCREEN_PAID: Follow after payment, ADD_SCENE_WECHAT_ADVERTISEMENT: WeChat Advertisement, ADD_SCENE_REPRINT: Others' reposts, ADD_SCENE_LIVESTREAM WeChat Channels live streaming,ADD_SCENE_CHANNELS WeChat Channels,ADD_SCENE_WXA Weixin Mini Program Attention, ADD_SCENE_OTHERS Other
qr_scenenumberQR code scanning scene (developer customized)
qr_scene_strstringQR code scanning scene description (developer customized)

# 4. Note

All openids must be users who have been followed

# 5. Code examples

# 5.1 Normal Requests

Example Requests

{
  "user_list": [
    {
      "openid": "otvxTs4dckWG7imySrJd6jSi0CWE",
      "lang": "zh_CN"
    },
    {
      "openid": "otvxTs_JZ6SEiP0imdhpi50fuSZg",
      "lang": "zh_CN"
    }
  ]
}

Return an example

{
  "user_info_list": [
    {
      "subscribe": 1,
      "openid": "otvxTs4dckWG7imySrJd6jSi0CWE",
      "language": "zh_CN",
      "subscribe_time": 1434093047,
      "unionid": "oR5GjjgEhCMJFyzaVZdrxZ2zRRF4",
      "remark": "",
      "groupid": 0,
      "tagid_list": [
        128,
        2
      ],
      "subscribe_scene": "ADD_SCENE_QR_CODE",
      "qr_scene": 98765,
      "qr_scene_str": ""
    }
  ]
}

# 5.2 Error Request

Example Requests

{
  "user_list": [
    {
      "openid": "otvxTs4dckWG7imySrJd6jSi0CWE",
      "lang": "zh_CN"
    },
    {
      "openid": "otvxTs_JZ6SEiP0imdhpi50fuSZg",
      "lang": "zh_CN"
    }
  ]
}

Return an example

{
  "errcode":40013,
  "errmsg":"invalid appid"
}

# 6. Error code

The following is a list of error codes for this interface, other error codes can refer to General error codes

Error codeError DescriptionSolutions
-1system errorThe system is busy, so the developer is asked to try again in a few minutes.
40001invalid credential  access_token isinvalid or not latestAppSecret error while getting access_token, or access_token is invalid.Developers should check that AppSecret is correct, or that they are calling interfaces for the appropriate Official Account
40003invalid openidUser not interested or openid error
40013invalid appidInvalid AppID error
40032invalid openid list sizeIllegal openid list length

# 7. Scope of application

How this interface can be invoked under different account types:
Official Account Service Account
Certification only Certification only
  • Authentication only: means that only authenticated accounts are allowed to be invoked by the enterprise entity, and accounts that are not authenticated or do not support authentication cannot be invoked.
  • Other account types that are not expressly stated may not be called on this interface without special instructions;