# nearbyPoi.getList
Call this API at the server side. For more information, see Server API.
This API supports Cloud Calls. The WeChat DevTools version must be
1.02.1904090or later (download the latest stable version here), and thewx-server-sdkversion must be0.4.0or later.
Views the location list.
Calling methods:
# HTTPS Call
# Request Address
GET https://api.weixin.qq.com/wxa/getnearbypoilist?page=1&page_rows=20&access_token=ACCESS_TOKEN
# Request Parameters
| Attribute | Type | Default | Required | Description |
|---|---|---|---|---|
| access_token | string | Yes | Credentials to call API | |
| page | number | Yes | The ID of the start page, starting from 1. | |
| page_rows | number | Yes | The quantity of rows displayed on each page. The upper limit is 1,000. |
# Return Value
# Object
| Property | Type | Description |
|---|---|---|
| errmsg | string | Error message |
| errcode | number | Error code |
| data | object | Returned data |
data is composed as follows
| Property | Type | Description |
|---|---|---|
| left_apply_num | number | The quantity of remaining locations that can be added. |
| max_apply_num | number | The maximum quantity of locations that can be added. |
| data | string | The address list. It is a string in JSON format. |
data.data is composed as follows
| Property | Type | Description |
|---|---|---|
| poi_list | Array.<Object> | The address list |
data.data.poi_list is composed as follows
| Property | Type | Description |
|---|---|---|
| poi_id | string | The ID of the location nearby |
| qualification_address | string | The address of the business qualification document |
| qualification_num | string | The ID of the business qualification document |
| audit_status | number | The review status of the location |
| display_status | number | Specifies whether to display the nearby status of the location |
| refuse_reason | string | The cause of the review failure. It is returned when audit_status=4. |
Valid values of audit_status
| Value | Description | Minimum Version |
|---|---|---|
| 3 | Under review | |
| 4 | Rejected | |
| 5 | Approved |
Valid values of display_status
| Value | Description | Minimum Version |
|---|---|---|
| 0 | Not displayed | |
| 1 | Being displayed |
# Errors
| Error Code | Error Message | Description |
|---|---|---|
| 0 | ok | Normal |
| 47001 | Incorrect JSON format of POST data. | |
| 20002 | Invalid POST parameter. | |
| 44002 | POST data is empty. | |
| 92000 | The business qualification has been added. Do not repeatedly add it. | |
| 92002 | Unable to add more locations. The number of locations nearby has reached the upper limit. | |
| 92003 | The location has been occupied by another Mini Program. | |
| 92004 | The nearby feature has been banned. | |
| 92005 | The location is under review. | |
| 92006 | The Mini Program is being displayed at the location. | |
| 92007 | The location is rejected. | |
| 92008 | The Mini Program is not displayed at the location. | |
| 93009 | The Mini Program is not released or is invisible. | |
| 93010 | The location does not exist. | |
| 93011 | Personal Mini Programs are not supported. | |
| 93011 | Personal Mini Programs are not supported. | |
| 93012 | Non-common Mini Programs (for example, Mini Programs of stores and Mini Programs of WeChat shops) are not supported. | |
| 93013 | Failed to obtain address details from Tencent Map. | |
| 93014 | This qualification document ID is repeatedly added. |
# Return Data Example
{
"errcode": 0,
"errmsg": "",
"data": {
"left_apply_num": 9,
"max_apply_num": 10,
"data": "{\"poi_list\": [{\"poi_id\": \"123456\",\"qualification_address\": \"No. 123, Xingang Middle Road, Haizhu District, Guangzhou, Guangdong Province\",\"qualification_num\": \"123456789-1\",\"audit_status\": 3,\"display_status\": 0,\"refuse_reason\": \"\"}]}"
}
}
# Cloud Call
Cloud call is a capability provided by Mini Program·Cloud Base that allows you to call WeChat APIs in a cloud function. It must be used via
wx-server-sdkin the cloud function.
# API Calling Method
openapi.nearbyPoi.getList
You need to configure the permissions for the
nearbyPoi.getListAPI viaconfig.json. Details
# Request Parameters
| Attribute | Type | Default | Required | Description |
|---|---|---|---|---|
| page | number | Yes | The ID of the start page, starting from 1. | |
| pageRows | number | Yes | The quantity of rows displayed on each page. The upper limit is 1,000. |
# Return Value
# Object
| Property | Type | Description |
|---|---|---|
| errMsg | string | Error message |
| errCode | number | Error code |
| data | object | Returned data |
data is composed as follows
| Property | Type | Description |
|---|---|---|
| leftApplyNum | number | The quantity of remaining locations that can be added. |
| maxApplyNum | number | The maximum quantity of locations that can be added. |
| data | string | The address list. It is a string in JSON format. |
data.data is composed as follows
| Property | Type | Description |
|---|---|---|
| poiList | Array.<Object> | The address list |
data.data.poiList is composed as follows
| Property | Type | Description |
|---|---|---|
| poiId | string | The ID of the location nearby |
| qualificationAddress | string | The address of the business qualification document |
| qualificationNum | string | The ID of the business qualification document |
| auditStatus | number | The review status of the location |
| displayStatus | number | Specifies whether to display the nearby status of the location |
| refuseReason | string | The cause of the review failure. It is returned when audit_status=4. |
Valid values of auditStatus
| Value | Description | Minimum Version |
|---|---|---|
| 3 | Under review | |
| 4 | Rejected | |
| 5 | Approved |
Valid values of displayStatus
| Value | Description | Minimum Version |
|---|---|---|
| 0 | Not displayed | |
| 1 | Being displayed |
# Exceptions
# Object
Thrown Exceptions
| Property | Type | Description |
|---|---|---|
| errMsg | string | Error message |
| errCode | number | Error code |
Valid values of errCode
| Value | Description | Minimum Version |
|---|
# Errors
| Error Code | Error Message | Description |
|---|---|---|
| 0 | ok | Normal |
| 47001 | Incorrect JSON format of POST data. | |
| 20002 | Invalid POST parameter. | |
| 44002 | POST data is empty. | |
| 92000 | The business qualification has been added. Do not repeatedly add it. | |
| 92002 | Unable to add more locations. The number of locations nearby has reached the upper limit. | |
| 92003 | The location has been occupied by another Mini Program. | |
| 92004 | The nearby feature has been banned. | |
| 92005 | The location is under review. | |
| 92006 | The Mini Program is being displayed at the location. | |
| 92007 | The location is rejected. | |
| 92008 | The Mini Program is not displayed at the location. | |
| 93009 | The Mini Program is not released or is invisible. | |
| 93010 | The location does not exist. | |
| 93011 | Personal Mini Programs are not supported. | |
| 93011 | Personal Mini Programs are not supported. | |
| 93012 | Non-common Mini Programs (for example, Mini Programs of stores and Mini Programs of WeChat shops) are not supported. | |
| 93013 | Failed to obtain address details from Tencent Map. | |
| 93014 | This qualification document ID is repeatedly added. |
# Request Example
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.nearbyPoi.getList({
page: '',
pageRows: ''
})
console.log(result)
return result
} catch (err) {
console.log(err)
return err
}
}
# Return Data Example
{
"errCode": 0,
"errMsg": "openapi.nearbyPoi.getList:ok",
"data": {
"data": "{\"poi_list\": [{\"poi_id\": \"123456\",\"qualification_address\": \"No. 123, Xingang Middle Road, Haizhu District, Guangzhou, Guangdong Province\",\"qualification_num\": \"123456789-1\",\"audit_status\": 3,\"display_status\": 0,\"refuse_reason\": \"\"}]}",
"leftApplyNum": 9,
"maxApplyNum": 10
}
}