人流统计接口

4.1 接口描述

人流统计接口是用来查询智能摄像机所监控和存储的人流信息和历史记录。目前分为三种统计维度:历史人流统计信息(T+1),当日人流统计信息(T+0),实时人流信息。

其中T+1和T+0的统计信息由HTTP接口提供,SaaS合作方可以通过发起请求获得结果,当日统计信息更新频率为15s内,实时人流信息通过消息推送获取,具体参考 《消息推送中心》文档

4.2 接口列表

接口名称接口描述
/passengerFlow/stat/today/getLatest获取当日实时人流量(实时总人流量)
/passengerFlow/stat/today/groupByTag获取当日人流统计信息(按照年龄以及生熟客人脸分组)
/passengerFlow/stat/today/groupByGender获取当日人流统计信息(按照年龄以及性别分组)
/passengerFlow/stat/today/getTrendByHour获取当日人流变化趋势(人流总数,时间粒度为小时)
/passengerFlow/stat/history/groupByTag获取历史人流统计信息(人流总数/生熟客/会员)
/passengerFlow/stat/history/groupByGender获取历史客群详情(年龄以及性别)
/passengerFlow/stat/history/getTrendByHour获取历史人流变化趋势(人流总数/生熟客,时间粒度为小时)
/passengerFlow/stat/history/getTrendByDay获取历史人流变化趋势(人流总数/生熟客,时间粒度为天)
/passengerFlow/stat/history/person/frequency/getList 获取顾客到店频率分布统计数据

4.3 接口详情

4.3.1 获取当日实时人流量

接口描述:通过本接口调用,用户可以获取当日的人流统计。

请求链接:/passengerFlow/stat/today/getLatest

接口版本:v2.0

接口参数

参数名称是否必须类型说明示例
sunmi_shop_no string商米数字店铺平台的门店组织编号 100939020409
shop_idstring 第三方对接软件中门店的标识,对接的软件提供 (作为门店唯一标识即可,shop_id与sunmi_shop_no可互为替代,使用时传输任意一个即可)7948

请求示例

  "method": "POST",
  "url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/today/getLatest",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  formData: {
    "sunmi_shop_no": "560279010307",
    "app_id": "LMWWQVTW4QGCC",
    "timestamp": 1581383983,
    "random": "5dsf6698",
    "sign": "33C18A18282733A71F998BB5A5E4319D"
  }

返回值: 

{
    "code": 0, /* 其他错误参考错误列表 */
    "msg": "succeed",
    "data": {
        "total_count": 123, /* 已捕捉到有效人脸数量 */ (原count字段)
        "unexposed_count": 0, /* 未捕捉到有效人脸数量 */
        "pass_count": 110 /* 过店客流数量 */
    }
}

备注:
total_count字段:    摄像机识别到进店人员,同时识别出相应的faceID,具体包含生客,熟客和会员等
unexposed_count字段:摄像机识别到进店人员,但是未能识别出相应的faceID,只能记录为进店人次
pass_count字段:     摄像机识别到人员在门口经过,没有进店

错误码:

错误码说明
5000数据库错误
5013未找到数据

4.3.2 获取当日人流统计信息(按照生熟客人脸分组以及年龄范围)

接口描述:通过本接口调用,用户可以获取当日各个年龄段生熟客人流统计

请求链接:/passengerFlow/stat/today/groupByTag

接口版本:v2.0

接口参数

参数名称是否必须类型说明示例
sunmi_shop_no string商米数字店铺平台的门店组织编号 100939020409
shop_idstring第三方对接软件中门店的标识,对接的软件提供 (作为门店唯一标识即可,shop_id与sunmi_shop_no可互为替代,使用时传输任意一个即可) 7948

请求示例:  

  "method": "POST",
  "url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/today/groupByTag",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  formData: {
    "sunmi_shop_no": "560279010307",
    "app_id": "LMWWQVTW4QGCC",
    "timestamp": 1581383983,
    "random": "5dsf6698",
    "sign": "33C18A18282733A71F998BB5A5E4319D"
  }

返回值: 

{
    "data": {
        "count_list": [
            {
                "age_range": 1,
                "stranger_count": 0, /* 生客数量 */ 
                "regular_count": 0, /* 熟客数量 */ 
                "member_count": 0  /* 会员数量 */ 
            },
            {
                "age_range": 2,
                "stranger_count": 0,
                "regular_count": 0,
                "member_count": 0
            },
            {
                "age_range": 3,
                "stranger_count": 0,
                "regular_count": 0,
                "member_count": 0
            },
            {
                "age_range": 4,
                "stranger_count": 0,
                "regular_count": 0,
                "member_count": 0
            },
            {
                "age_range": 5,
                "stranger_count": 0,
                "regular_count": 0,
                "member_count": 0
            },
            {
                "age_range": 6,
                "stranger_count": 0,
                "regular_count": 0,
                "member_count": 0
            },
            {
                "age_range": 7,
                "stranger_count": 0,
                "regular_count": 0,
                "member_count": 0
            },
            {
                "age_range": 8,
                "stranger_count": 0,
                "regular_count": 0,
                "member_count": 0
            }
        ]
    },
    "code": 0,  /* 其他错误参考错误列表 */
    "msg": "succeed"
}

字段描述:age_range

age_range 取值说明
10~6岁
27~12岁
313~18岁
419~28岁
529~35岁
636~45岁
746~55岁
856~ 岁

错误码:

错误码说明
5000数据库错误
5013未找到数据

4.3.3 获取当日人流统计信息(按照性别年龄)

请求链接:/passengerFlow/stat/today/groupByGender

接口描述:通过本接口调用,用户可以获取当日各个年龄段不同性别的人流统计

接口版本:v2.0

接口参数

参数名称是否必须类型说明示例
sunmi_shop_no string商米数字店铺平台的门店组织编号 100939020409
shop_idstring第三方对接软件中门店的标识,对接的软件提供 (作为门店唯一标识即可,shop_id与sunmi_shop_no可互为替代,使用时传输任意一个即可)7948

请求示例

  "method": "POST",
  "url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/today/groupByGender",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  formData: {
    "sunmi_shop_no": "560279010307",
    "app_id": "LMWWQVTW4QGCC",
    "timestamp": 1581383983,
    "random": "5dsf6698",
    "sign": "33C18A18282733A71F998BB5A5E4319D"
  }

返回值: 

{
    "data": {
        "count_list": [
            {
                "age_range": 1,
                "male_count": 0, /* 男性总数  */
                "male_regular_count": 0, /* 男性熟客数量 */
                "male_member_count": 0, /* 男性会员数量 */
                "female_count": 0, /* 女性总数  */
                "female_regular_count": 0, /* 女性熟客数量 */
                "female_member_count": 0 /* 女性会员数量  */
            },
            {
                "age_range": 2,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0
            },
            {
                "age_range": 3,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0
            },
            {
                "age_range": 4,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0
            },
            {
                "age_range": 5,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0
            },
            {
                "age_range": 6,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0
            },
            {
                "age_range": 7,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0
            },
            {
                "age_range": 8,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0
            }
        ]
    },
    "code": 0,  /* 其他错误参考错误列表 */
    "msg": "succeed"
}

字段描述:age_range

age_range 取值说明
10~6岁
27~12岁
313~18岁
419~28岁
529~35岁
636~45岁
746~55岁
856~ 岁

错误码:

错误码说明
5000数据库错误
5013未找到数据

4.3.4 获取当日人流变化趋势(人流总数,时间粒度为小时)

请求链接:/passengerFlow/stat/today/getTrendByHour

接口描述:通过本接口调用,用户可以获取当日各个时间段的人流统计

接口版本:v2.0

接口参数

参数名称是否必须类型说明示例
sunmi_shop_no string商米数字店铺平台的门店组织编号 100939020409
shop_idstring第三方对接软件中门店的标识,对接的软件提供 (作为门店唯一标识即可,shop_id与sunmi_shop_no可互为替代,使用时传输任意一个即可)7948

请求示例:  

  "method": "POST",
  "url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/today/getTrendByHour",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  formData: {
    "sunmi_shop_no": "560279010307",
    "app_id": "LMWWQVTW4QGCC",
    "timestamp": 1581383983,
    "random": "5dsf6698",
    "sign": "33C18A18282733A71F998BB5A5E4319D"
  }

返回值: 

{
    "data": {
        "count_list": [
            {
                "time": "2020-02-11 00:00",
                "total_count": 0, /* 已捕捉到有效人脸数量 */
                "pass_count": 110, /* 过店客流数量 */
                "unexposed_count": 0 /* 未捕捉到有效人脸数量 */
            },
            {
                "time": "2020-02-11 01:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 02:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 03:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 04:00",
                "total_count": 0,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 05:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 06:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 07:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 08:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 09:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 10:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 11:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 12:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 13:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 14:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 15:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-02-11 16:00",
                "total_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            }
        ]
    },
    "code": 0, /* 其他错误参考错误列表 */
    "msg": "succeed",
}

备注:
total_count字段:    摄像机识别到进店人员,同时识别出相应的faceID,具体包含生客,熟客和会员等
unexposed_count字段:摄像机识别到进店人员,但是未能识别出相应的faceID,只能记录为进店人次
pass_count字段:     摄像机识别到人员在门口经过,没有进店

字段描述:age_range

age_range 取值说明
10~6岁
27~12岁
313~18岁
419~28岁
529~35岁
636~45岁
746~55岁
856~ 岁

错误码:

错误码说明
5000数据库错误
5013未找到数据

4.3.5 获取历史人流统计信息(总数/生熟客/会员)

接口描述:通过本接口调用,用户可以获取历史数据中三个主要人脸分组的人流统计

请求链接:/passengerFlow/stat/history/groupByTag

接口版本:v2.0

接口参数

参数名称是否必须类型说明示例
sunmi_shop_no string 商米数字店铺平台的门店组织编号 100939020409
shop_idstring第三方对接软件中门店的标识,对接的软件提供 (作为门店唯一标识即可,shop_id与sunmi_shop_no可互为替代,使用时传输任意一个即可)7948
start_timestring筛选开始时间 “YYYY-MM-DD” (如果需要查询某一天,开始和结束时间相同)2020-01-01
end_timestring筛选结束时间 “YYYY-MM-DD” (如果需要查询某一天,开始和结束时间相同)2020-01-16

备注:

每次接口调用, 开始时间和结束时间的区间限制为30天

请求示例:  

  "method": "POST",
  "url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/history/groupByTag",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  formData: {
    "sunmi_shop_no": "560279010307",
    "app_id": "LMWWQVTW4QGCC",
    "start_time": "2020-01-01",
    "end_time": "2020-01-16",
    "timestamp": 1581383983,
    "random": "5dsf6698",
    "sign": "33C18A18282733A71F998BB5A5E4319D"
  }

返回值: 

{
    "data": {
        "total_count": 0,   /* 已捕捉到有效人脸数量(人次) */
        "regular_count": 0,   /* 熟客数量(人次) */
        "stranger_count": 0,   /* 生客数量(人次) */
        "member_count": 0,   /* 会员数量(人次)  */
        "uniq_total_count": 0,   /* 已捕捉到有效人脸数量(去重) */
        "uniq_regular_count": 0,   /* 熟客数量(去重) */
        "uniq_stranger_count": 0,   /* 生客数量(去重) */
        "uniq_member_count": 0,   /* 会员数量(去重) */
      
        "pass_count": 110,   /* 过店客流数量*/
        "unexposed_count": 0 /* 未捕捉到有效人脸数量 */
    },
    "code": 0,   /* 其他错误参考错误列表 */
    "msg": "succeed"
}

备注:

total_count字段:    摄像机识别到进店人员,同时识别出相应的faceID,具体包含生客,熟客和会员等
unexposed_count字段:摄像机识别到进店人员,但是未能识别出相应的faceID,只能记录为进店人次
pass_count字段:     摄像机识别到人员在门口经过,没有进店

对于unexposed_count和pass_count, 无法获取faceID并进行去重

错误码:

错误码说明
5000数据库错误
5013未找到数据

4.3.6 获取历史客群详情(按照年龄性别) 

请求链接:/passengerFlow/stat/history/groupByGender

接口描述:通过本接口调用,用户可以获取当日各个年龄段不同性别的人流统计

接口版本:v2.0

接口参数

参数名称是否必须类型说明示例
sunmi_shop_no string商米数字店铺平台的门店组织编号100939020409
shop_idstring第三方对接软件中门店的标识,对接的软件提供 (作为门店唯一标识即可,shop_id与sunmi_shop_no可互为替代,使用时传输任意一个即可)7948
start_timestring筛选开始时间 “YYYY-MM-DD” (如果需要查询某一天,开始和结束时间相同) 2020-01-01
end_time string筛选结束时间 “YYYY-MM-DD” (如果需要查询某一天,开始和结束时间相同) 2020-01-01

备注:

每次接口调用, 开始时间和结束时间的区间限制为30天

请求示例:  

  "method": "POST",
  "url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/history/groupByGender",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  formData: {
    "sunmi_shop_no": "560279010307",
    "app_id": "LMWWQVTW4QGCC",
    "start_time": "2020-01-01",
    "end_time": "2020-01-01",
    "timestamp": 1581383983,
    "random": "5dsf6698",
    "sign": "33C18A18282733A71F998BB5A5E4319D"
  }

返回值: 

{
    "data": {
        "count_list": [
            {
                "age_range": 1,
                "male_count": 0, /* 男性总数(人次)  */
                "male_regular_count": 0, /* 男性熟客数量(人次) */
                "male_member_count": 0, /* 男性会员数量(人次) */
                "female_count": 0, /* 女性总数(人次)  */
                "female_regular_count": 0, /* 女性熟客数量(人次) */
                "female_member_count": 0, /* 女性会员数量(人次)  */
                "uniq_male_count": 0, /* 男性总数(去重) */
                "uniq_male_regular_count": 0, /* 男性熟客数量(去重) */
                "uniq_male_member_count": 0, /* 男性会员数量(去重) */
                "uniq_female_count": 0, /* 女性总数(去重) */
                "uniq_female_regular_count": 0, /* 女性熟客数量(去重) */
                "uniq_female_member_count": 0 /* 女性会员数量(去重) */
            },
            {
                "age_range": 2,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0,
                "uniq_male_count": 0,
                "uniq_male_regular_count": 0,
                "uniq_male_member_count": 0,
                "uniq_female_count": 0,
                "uniq_female_regular_count": 0,
                "uniq_female_member_count": 0
            },
            {
                "age_range": 3,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0,
                "uniq_male_count": 0,
                "uniq_male_regular_count": 0,
                "uniq_male_member_count": 0,
                "uniq_female_count": 0,
                "uniq_female_regular_count": 0,
                "uniq_female_member_count": 0
            },
            {
                "age_range": 4,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0,
                "uniq_male_count": 0,
                "uniq_male_regular_count": 0,
                "uniq_male_member_count": 0,
                "uniq_female_count": 0,
                "uniq_female_regular_count": 0,
                "uniq_female_member_count": 0
            },
            {
                "age_range": 5,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0,
                "uniq_male_count": 0,
                "uniq_male_regular_count": 0,
                "uniq_male_member_count": 0,
                "uniq_female_count": 0,
                "uniq_female_regular_count": 0,
                "uniq_female_member_count": 0
            },
            {
                "age_range": 6,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0,
                "uniq_male_count": 0,
                "uniq_male_regular_count": 0,
                "uniq_male_member_count": 0,
                "uniq_female_count": 0,
                "uniq_female_regular_count": 0,
                "uniq_female_member_count": 0
            },
            {
                "age_range": 7,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0,
                "uniq_male_count": 0,
                "uniq_male_regular_count": 0,
                "uniq_male_member_count": 0,
                "uniq_female_count": 0,
                "uniq_female_regular_count": 0,
                "uniq_female_member_count": 0
            },
            {
                "age_range": 8,
                "male_count": 0,
                "male_regular_count": 0,
                "male_member_count": 0,
                "female_count": 0,
                "female_regular_count": 0,
                "female_member_count": 0,
                "uniq_male_count": 0,
                "uniq_male_regular_count": 0,
                "uniq_male_member_count": 0,
                "uniq_female_count": 0,
                "uniq_female_regular_count": 0,
                "uniq_female_member_count": 0
            }
        ]
    },
    "code": 0,  /* 其他错误参考错误列表 */
    "msg": "succeed"
}

字段描述:age_range

age_range 取值说明
10~6岁
27~12岁
313~18岁
419~28岁
529~35岁
636~45岁
746~55岁
856~ 岁

错误码:

错误码说明
5000数据库错误
5013未找到数据

4.3.7 获取历史人流变化趋势(总数/生熟客,时间粒度为小时)

请求链接:/passengerFlow/stat/history/getTrendByHour

接口描述:通过本接口调用,用户可以获取一段时间内的人流变化趋势

接口版本:v2.0

接口参数

参数名称是否必须类型说明示例
sunmi_shop_no stirng商米数字店铺平台的门店组织编号 100939020409
shop_idstring第三方对接软件中门店的标识,对接的软件提供 (作为门店唯一标识即可,shop_id与sunmi_shop_no可互为替代,使用时传输任意一个即可)7948
start_timestring筛选开始时间 “YYYY-MM-DD” (如果需要查询某一天,开始和结束时间相同) 2020-01-01
end_time string筛选结束时间 “YYYY-MM-DD” (如果需要查询某一天,开始和结束时间相同) 2020-01-01

备注:

每次接口调用, 开始时间和结束时间的区间限制为24小时

请求示例:  

  "method": "POST",
  "url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/history/getTrendByHour",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  formData: {
    "sunmi_shop_no": "560279010307",
    "app_id": "LMWWQVTW4QGCC",
    "start_time": "2020-01-01",
    "end_time": "2020-01-01",
    "timestamp": 1581383983,
    "random": "5dsf6698",
    "sign": "33C18A18282733A71F998BB5A5E4319D"
  }

返回值: 

{
    "data": {
        "count_list": [
            {
                "time": "2019-12-01 0:00",
                "total_count": 0, /* 已捕捉到有效人脸数量(人次) */
                "regular_count": 0, /* 熟客数量(人次) */
                "stranger_count": 0, /* 生客数量(人次) */
                "member_count": 0, /* 会员数量(人次) */
                "uniq_total_count": 0, /* 已捕捉到有效人脸数量(去重)*/
                "uniq_regular_count": 0, /* 熟客数量(去重)*/
                "uniq_stranger_count": 0, /* 生客数量(去重)*/
                "uniq_member_count": 0, /* 会员数量(去重)*/
                "pass_count": 110,  /* 过店客流数量 */
                "unexposed_count": 0 /* 未捕捉到有效人脸数量 */
            },
            {
                "time": "2019-12-01 1:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 2:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 3:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 4:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 5:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 6:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 7:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 8:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 9:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 10:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 11:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 12:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 13:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 14:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 15:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 16:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 17:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 18:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 19:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 20:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 21:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 22:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2019-12-01 23:00",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            }
        ]
    },
    "code": 0, /* 其他错误参考错误列表 */
    "msg": "succeed"
}

错误码:

错误码说明
5000数据库错误
5013未找到数据

4.3.8 获取历史人流变化趋势(总数/生熟客,时间粒度为天)

请求链接:/passengerFlow/stat/history/getTrendByDay

接口描述:通过本接口调用,用户可以获取一段时间内的人流变化趋势

接口版本:v2.0

接口参数

参数名称是否必须类型说明示例
sunmi_shop_no string 商米数字店铺平台的门店组织编号 100939070408
shop_idstring第三方对接软件中门店的标识,对接的软件提供 (作为门店唯一标识即可,shop_id与sunmi_shop_no可互为替代,使用时传输任意一个即可)15220
start_timestring筛选开始时间 “YYYY-MM-DD” 2020-01-01
end_time string筛选结束时间 “YYYY-MM-DD” 2020-01-03

备注:

每次接口调用, 开始时间和结束时间的区间限制为30天

请求示例:  

  "method": "POST",
  "url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/history/getTrendByDay",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  formData: {
    "sunmi_shop_no": "560279010307",
    "app_id": "LMWWQVTW4QGCC",
    "start_time": "2020-01-01",
    "end_time": "2020-01-03",
    "timestamp": 1581383983,
    "random": "5dsf6698",
    "sign": "33C18A18282733A71F998BB5A5E4319D"
  }

返回值: 

{
    "data": {
        "count_list": [
            {
                "time": "2020-01-01",
                "total_count": 0, /* 已捕捉到有效人脸数量(人次) */
                "regular_count": 0, /* 熟客数量(人次) */
                "stranger_count": 0, /* 生客数量(人次) */
                "member_count": 0, /* 会员数量(人次) */
                "uniq_total_count": 0, /* 已捕捉到有效人脸数量(去重)*/
                "uniq_regular_count": 0, /* 熟客数量(去重)*/
                "uniq_stranger_count": 0, /* 生客数量(去重)*/
                "uniq_member_count": 0, /* 会员数量(去重)*/
                "pass_count": 110,  /* 过店客流数量 */
                "unexposed_count": 0 /* 未捕捉到有效人脸数量 */
            },
            {
                "time": "2020-01-02",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            },
            {
                "time": "2020-01-03",
                "total_count": 0,
                "regular_count": 0,
                "stranger_count": 0,
                "member_count": 0,
                "uniq_total_count": 0,
                "uniq_regular_count": 0,
                "uniq_stranger_count": 0,
                "uniq_member_count": 0,
                "pass_count": 110,
                "unexposed_count": 0
            }
        ]
    },
    "code": 0, /* 其他错误参考错误列表 */
    "msg": "succeed"
}

错误码:

错误码说明
5000数据库错误
5013未找到数据

4.3.11 获取顾客到店频率分布统计数据

接口描述:通过本接口调用,用户可以获取顾客到店频率分布情况

请求链接: /passengerFlow/stat/history/person/frequency/getList

接口版本:v2.0

接口参数:

参数名称是否必须类型说明示例
sunmi_shop_no string商米数字店铺平台的门店组织编号 560279010307
start_timestring 筛选开始时间 “YYYY-MM-DD” (如果需要查询某一天,开始和结束时间相同) 2020-01-01
end_timestring 筛选结束时间 “YYYY-MM-DD” (如果需要查询某一天,开始和结束时间相同,end_time日期需要小于当前日期) 2020-01-16
  • 每次接口调用, 开始时间和结束时间的区间限制为30天

请求示例:

  "method": "POST",
  "url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/history/person/frequency/getList",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  formData: {
    "sunmi_shop_no": "560279010307",
    "app_id": "LMWWQVTW4QGCC",
    "start_time": "2020-01-01",
    "end_time": "2020-01-16",
    "timestamp": 1581383983,
    "random": "5dsf6698",
    "sign": "33C18A18282733A71F998BB5A5E4319D"
  }

返回值:

{
	"code": 1,
	"msg": "",
	"data": {
		"frequency_list": [{
			"frequency": 1,            /*到店频次*/
			"stranger_uniq_count": 76, /*生客数量(去重)*/
			"regular_uniq_count": 4,   /*熟客数量(去重)*/
			"member_uniq_count": 0     /*会员数量(去重)*/
		}, {
			"frequency": 2,
			"stranger_uniq_count": 13,
			"regular_uniq_count": 2,
			"member_uniq_count": 0
		}, {
			"frequency": 3,
			"stranger_uniq_count": 5,
			"regular_uniq_count": 2,
			"member_uniq_count": 0
		}, {
			"frequency": 4,
			"stranger_uniq_count": 5,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 5,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 6,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 7,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 8,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 9,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 10,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 11,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 12,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 13,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 14,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 15,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 16,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 17,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 18,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 19,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 20,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 21,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 22,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 23,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 24,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 25,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 26,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 27,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 28,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 29,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 30,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 31,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 32,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 33,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 34,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 35,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 36,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 37,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 38,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 39,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 40,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 41,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 42,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 43,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 44,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 45,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 46,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 47,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 48,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 49,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}, {
			"frequency": 50,
			"stranger_uniq_count": 0,
			"regular_uniq_count": 0,
			"member_uniq_count": 0
		}]
	}
}

错误码:

错误码说明
5025时间参数错误