Giter Club home page Giter Club logo

itunes-sales-client's Introduction

Itunes Sales & Analytics Client

A fastlane extension gem to get apps sales and analytics reports from itunes connect. Get multiple apps reports with single request.

Installation

Add these lines to your application's Gemfile:

gem 'fastlane'
gem 'itunes-sales-client', '~> 1.0.0'

And then execute:

$ bundle

Usage

Sales

# Assign the apps itunes ids to an array
ids = ["1234567..", "1234567..", "1234567.."]
sales = Spaceship::SalesClient.login("username", "password")
result = sales.get_data(ids, Date.today - 3.day, Date.today - 1.day)

=>
  [{"metadata"=>{"key"=>"1234567..", "title"=>"Title",
    ...
    {"date"=>"2017-05-21", "total_tax_usd_utc"=>1.733, "units_utc"=>1, "Royalty_utc"=>1.182}
    ...
  }]

Analytics

analytics = Spaceship::AnalyticsClient.login("username", "password")
data = analytics.get_units("itunes_id", Date.today - 3.day, Date.today - 1.day)

=>
{
  "size"=>1,
  "results"=>[
    {
      "adamId"=> "asdf12345",
      "meetsThreshold"=> true,
      "group"=> nil,
      "data"=> [
        {
          "date" => "2017-07-15T00:00:00Z",
          "units" => 2.0
          },
        {
          "date" => "2017-07-16T00:00:00Z",
          "units" => 1.0
        },
        {
          "date" => "2017-07-17T00:00:00Z",
          "units"=> 3.0 
        }
      ],
      "totals" => 
      {
        "value" => 6.0,
        "type" => "COUNT",
        "key" => "units" 
      }
    }
  ]
}
  
# available analytics options:
data = analytics.get_units("itunes_id", start_time, end_time)
data = analytics.get_page_view_count("itunes_id", start_time, end_time)
data = analytics.get_iap("itunes_id", start_time, end_time)
data = analytics.get_sales("itunes_id", start_time, end_time)
data = analytics.get_paying_users("itunes_id", start_time, end_time)
data = analytics.get_impressions_total("itunes_id", start_time, end_time)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/svtek/itunes-sales-client.

License

The gem is available as open source under the terms of the MIT License.

itunes-sales-client's People

Contributors

adamdilek avatar sadikay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

itunes-sales-client's Issues

Sales parsing does not work

We should change
@sadikay new request payload

{"filters":[{"dimensionKey":"content","optionKeys":["1089497832","1153431461","1154341476","1154369664","1155913693","1158557258","1189244996","1199107764","1218019266","1224687331"]}],"group":["content"],"interval":{"key":"day","startDate":"2017-07-25T00:00:00.000Z","endDate":"2017-08-23T00:00:00.000Z"},"limit":100,"measures":[{"key":"units_utc"}],"optionalParams":{},"cubeApiType":"TIMESERIES","order":[],"sorting":"DESC"}

Can you check ?

Thanks!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.