0.01
No commit activity in last 3 years
No release in over 3 years
A fastlane extension to get your app transactions
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.14
~> 10.0
 Project Readme

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.