使用Node.js访问itunesConnect API获取应用下载/安装信息 [英] Accessing itunesConnect API for App Download/Installation information using nodejs

查看:126
本文介绍了使用Node.js访问itunesConnect API获取应用下载/安装信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用nodejs实现 https://www.npmjs.com/package/itunesconnect 访问我的App的iTunes连接API. 我需要的是与应用程序下载/安装有关的数据. 基本上,我想知道每个月有多少次下载. 我不确定如何获取此信息.

I am using the nodejs implementation https://www.npmjs.com/package/itunesconnect to access itunes-connect API for my App. What I need is data pertaining to the App-download/Install. Basically I want to know how many downloads happened for each month. I am not sure how to get this information.

推荐答案

注册表进行了修改: a>

Taken and modified from registry:

基本示例

此示例显示了如何以一周的间隔获取最近30天的排名报告数据和最近4周的定时报告.

This example shows how to fetch ranked report data from last 30 days and timed report from last 4 weeks with a week interval.

查询:

var itc = require("itunesconnect");
var Report = itc.Report;

// Connect to iTunes 
var itunes = new itc.Connect('apple@id.com', 'password');

// Simple ranked report 
itunes.request(Report.ranked().time(30, 'days'), function(error, result) {
    console.log(result);
});

// Or 
itunes.request(Report('timed').time(4, 'weeks').interval('week'), function(error, result) {
    console.log(result);
});

结果:

[
  {
    "key": 0,
    "title": "App Name ",
    "rptgDesc": "App",
    "contentSpecificTypeId": 1,
    "contentSpecificTypeName": "iOS App",
    "contentGrpCd": "Apps",
    "contentProviderId": 0,
    "artistName": "Artist Name",
    "contentProviderName": "Provider Name",
    "units": 7684
  },
  {
    "key": 0,
    "title": "In App Name ...",
    "rptgDesc": "In App",
    "contentSpecificTypeId": 3,
    "contentSpecificTypeName": "Auto-Renewable Subscription",
    "contentGrpCd": "Apps",
    "contentProviderId": 0,
    "contentProviderName": "Provider Name",
    "units": 2886
  }



]

现在,您可以通过返回的json中的units键访问下载量.

Now you can access the amount of downloads through the units key in the returned json.

希望有帮助,朱利安.

这篇关于使用Node.js访问itunesConnect API获取应用下载/安装信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆