janhalozan / itunesconnectanalytics Goto Github PK
View Code? Open in Web Editor NEWNodeJS package for iTunes Connect app analytics API
License: Other
NodeJS package for iTunes Connect app analytics API
License: Other
Hey,
Is it possible to use location like on node-itunesconnect ? I want to retrieve the sales by countries, is there any way of doing this ?
Thanks.
I used the API for a few calls and then, since I was going to share my code, decided to change my password in itunes connect. After that I received the following error for example on the quickstart code.
var itc = require('itunesconnectanalytics');
var Itunes = itc.Itunes;
var AnalyticsQuery = itc.AnalyticsQuery;
var username = 'MyUserName';
var password = 'MyPassWord';
var appId = '12345'; //Found in My Apps -> App -> Apple ID or read below on getting the app id.
var instance = new Itunes(username, password, {
errorCallback: function(e) {
console.log('Error logging in: ' + e);
},
successCallback: function(d) {
console.log('Logged in');
}
});
instance.getApps(function(error, data) {
console.log(JSON.stringify(data, null, 2));
});
returns Error: No account cookie :( Apple probably changed the login process
.
Same also occurs with a new or incorrect user name or password. Any ideas how to address this?
Thanks
Hey,
I'm trying to use your wrapper but i can't make it work. I followed your installation guide but i get the above error.
Any idea on how i can fix this ?
thanks !
Hi There,
I am unable to login due to having two factor authentication. The two factor prompt appears on my iPhone but doesn't allow me to login.
Thanks! :)
This issue is persistent. I have verified that it is not a credentials issue. I have been able to access ITC.
I am getting the same issue when using the default password as well as using the app-specific password. Appreciate any help with this.
How can I do if my iTune connect but I use two factor authentication? what code should I add?
Hi @JanHalozan
Since I didn't update my node-itunesconnect tool in years and I'm cleaning my github account I've asked anyone interested to use your great tool. .
I hope it's ok with you.
Regards
M
Hey,
Since you closed the other issue I didn't found any other way to reach you but opening another issue, sorry about that. Could you please release your Ruby Tool so I can check the code and try to adapt it to my needs ? That would be really great !
Thank you again for your time.
Hey!
First of all great job @JanHalozan ! I am working on a project that aggregates the analytics data from different platforms for my podcast.
I was wondering is this project still active? If so, are you accepting any new pull requests? I would love to convert this to promises, it would make my life much easier.
Thanks!
I can successfully log in and create a query, however, when I execute instance.request I get the following error message: (node:5597) UnhandledPromiseRejectionWarning: StatusCodeError: 400 . This only happens when I try to use Analytics Query. GetApps and GetSettings work just fine. Any idea what I'm doing wrong?
Here is what my code looks like, I basically copied it from READ.ME and updated the access tokens. I run this code from my terminal using node: node "file_name".js
`var itc = require('itunesconnectanalytics');
var Itunes = itc.Itunes;
var AnalyticsQuery = itc.AnalyticsQuery;
var username = '';
var password = '';
var appId = ''; //Found in My Apps -> App -> Apple ID or read below on getting the app id.
var instance = new Itunes(username, password, {
errorCallback: function(e) {
console.log('Error logging in: ' + e);
},
successCallback: function(d) {
console.log('Logged in');
}
});
// Get installs for each day in date range 2016-04-10 to 2016-05-10
var query = AnalyticsQuery.metrics(appId, {
measures: itc.measures.installs,
}).date('2016-04-10','2016-05-10');
instance.request(query, function(error, result) {
console.log(JSON.stringify(result, null, 2));
});`
It would be great if this could be expanded to Apple's new Subscription analytics. This could be used to track how many active subscriptions you have, and their daily change. In addition, it provides Retention and Conversion rates, as well as the number of free trials.
var query = new AnalyticsQuery.metrics(appId, { measures: [itc.measures.iap] }).time(10, 'days');
My query returns the correct number of IAP's purchased on these days, however it doesn't return the actual revenue made. Is there a way to modify this query to show this information?
Hi people, i'm testing this module but i have some problems.
I created a new empty node project with a new file "index.js" with this boilerplate code:
var itc = require('itunesconnectanalytics');
var Itunes = itc.Itunes;
var AnalyticsQuery = itc.AnalyticsQuery;
var username = 'UNAME';
var password = 'PASS';
var appId = '12345'; //Found in My Apps -> App -> Apple ID or read below on getting the app id.
var instance = new Itunes(username, password, {
errorCallback: function(e) {
console.log('Error logging in: ' + e);
},
successCallback: function(d) {
console.log('Logged in');
}
});
But when i run the command node index.js
i get this error:
Error: Cannot find module 'request'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
thanks
Hi, I was beginning to write something similar to this library myself when I stumbled across this. (I had some issues getting login to work). I see there is a header sent "X-Apple-Widget-Key" during login, and you have a value hardcoded in the options. I tried to do some research on this to no avail. Can you explain what this is, and if I should be generating my own widget key for my usage? Thanks!
Edit: it appears this is a query parameter in the login url Apple uses for CSRF. Seems odd that you can just generate one and hardcode it though
Connecting to iTunes Connect now results in a 412 error.
const i = new itc.Itunes(
config.appstore.login,
config.appstore.password,
{
errorCallback: reject,
successCallback: () => resolve(i),
}
);
Will reject with StatusCodeError: 412 - {"authType":"sa"}
error.
See the PR below for a possible fix:
#52
Cannot login if iCloud account uses 2-Step verification
please help: this module always working fine for me but recently it happened to show error from the module.
Like this:
C:\Users\Username\Documents\KITInternship\VKDashboard\node_modules\itunesconnectanalytics\src\analytics.js:42
var requestBody = query.assembleBody();
TypeError: Cannot read property 'assembleBody' of undefined
I have an account with 2fa, which I cannot disable. Could this utility be implemented with an api key?
Running a simple test.js like this (copied from examples):
var itc = require('itunesconnectanalytics');
var Itunes = itc.Itunes;
var AnalyticsQuery = itc.AnalyticsQuery;
var username = 'xxxxxxxx'; //REAL USERNAME AND PW REMOVED
var password = 'yyyyyyyy';
var appId = '12345'; //Found in My Apps -> App -> Apple ID or read below on gett
ing the app id.
var instance = new Itunes(username, password, {
errorCallback: function(e) {
console.log('Error logging in: ' + e);
},
successCallback: function(d) {
console.log('Logged in');
}
});
instance.getApps(function(error, data) {
console.log(JSON.stringify(data, null, 2));
});
When I run this from the command line, I get inconsistent results. Some requests return the expected result (which confirms the roles are set up correcting in iTC). Also note that I consistently get the same server IP from apple/akamai, but some percentage of requests result in this error:
{
"itcBaseUrl": "https://appstoreconnect.apple.com",
"message": "Invalid iTC User Role",
"l10n": {
"Crossfire-response-invalidrole-message": "If you think you should have access to App Analytics, contact your iTunes Connect user with the admin role.",
"Crossfire-response-invalidrole-link": "iTunes Connect Homepage",
"Crossfire-response-invalidrole-title": "You don’t have access to App Analytics."
},
"redirectUrl": "/"
}
Other details :
NodeJS version: v6.11.3 (bundled with OS) and node v8.11.4 (latest) produce the same result.
OS version: RHEL 7.5. One theory is that their might be a race condition inside the library which produces different a different result based on the order of execution.
Thanks for making this package!
Do you happen to have a link to any documentation for the API -- I.e. the return data format, fields, error conditions, etc.? (My google-fu is failing me!) Or is it undocumented/reverse-engineered?
in appstore i have a multiple account, i just want to switch between the accounts, i found the providerId solution. but i dont knw where to find it. i just want to know where can i find the provider ID, thanks in advance.
How can I use itunesconnectanalytics with proxy authentication?
i try to go to this URL
https://analytics.itunes.apple.com/analytics/api/v1
but it was not found can you update the your files with the new URL
I noticed that if you use the the group option with 1 metric, it takes the first char as group metric.
for example:
options = {
measures:itc.measures.units,
group: {
dimension: itc.dimension.territory
}
}
will result in:
"errors": [
{
"message": "Invalid measure: u"
}
]
It happens because the query initialization happens before the assembleBody function, that puts the measures in an array.
For anybody facing title issue, please change:
https://olympus.itunes.apple.com/v1/session
to:
https://appstoreconnect.apple.com/olympus/v1/session
in analytics.js file
I'm getting the message after the 2FA code:
Error logging in: Error: No itCtx cookie :( Apple probably changed the login process
When creating a new Itunes instance I got this error: No account cookie :( Apple probably changed the login process
Here is my code:
const instance = new Itunes(config.env.itunes.username, config.env.itunes.password, {
errorCallback: (error) => {
throw new BadRequestError(error);
},
successCallback: () => {
console.log('Logged in');
},
});
I'm not sure how can I help with that.
Hi,
I was trying out your node js package and is currently facing some issue such that after logging when I am trying to get the app units metrics it's giving me the output in Unicode.
Code:
var itc = require('itunesconnectanalytics');
var Itunes = itc.Itunes;
var AnalyticsQuery = itc.AnalyticsQuery;
var username = 'XXXXX';
var password = 'XXXX';
var appId = 'XXXX'; //Found in My Apps -> App -> Apple ID or read below on getting the app id.
var instance = new Itunes(username, password, {
errorCallback: function(e) {
console.log('Error logging in: ' + e);
},
successCallback: function(d) {
console.log('Logged in');
}
});
var query = AnalyticsQuery.metrics(appId, {
measures: itc.measures.units,
}).date('2018-04-10','2018-04-15');
instance.request(query, function(error, result) {
console.log(JSON.stringify(result, null, 2));
});
Output:
Logged in
"\u001f�\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000��AK\u0003A\f��Jȹ��\u0016�2G=\u0015�\"���C�����̘d\u0005Y����b=)x\f��K�\u001b0��!�Dtx6+�K*E-\u000b��\u0012{��9r�s�\u000b�X�N<��� �0ؙa�p\u0007A�g�t\u0006�Z0y\u0007:QH����*�\u001b�V��s\u0010����\\=Q+�ڳZe��콻8��F1������}6.�E�(���#���,PK\u001d���zݬ�����R��\u0012��Ŀ\"<R�g��;�x\u001c?\u0000F�3|�\u0001\u0000\u0000"
Querying e.g. the last 7 days (e.g. units, sales) should only return the days for which Apple provided data.
Currently, the last days always have a value of 0, making it hard to distinguish if the value is really zero or if the data is not yet available.
Is there any API to accomplish that?
When I first started using this, I only had to enter code the first time as the readme states, now it is being asked every time I run this. Was wondering if you could look into this!
On the web interface, we're able to do account switching.
Is there a way to switch accounts using this module?
Hi,
I noticed that if I'm logged in on iTunes connect in an account different than the one I'm making the request, it returns an error saying that the adamId is wrong, if I disconnect the account, or if I connect the same account it works fine. Is this the expected behavior or is this an issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.