iTunesConnectの売上やダウンロード数などのデータを取得するプログラムに関する話です。
今まではiTunesConnectのSalesデータをAutoIngestion Toolというものを使って取得できました。
しかしこのツールは非推奨になり、2016年12月で停止してしました。
AppleからはReporterというツールを使うよう通知があったので今回はそれを試してみました。
ダウンロード
ダウンロードは下ページのSetup
にあるダウンロードリンクから行います。
ダウンロードすると、Reporter.jar
とReporter.properties
の2つのファイルが入っています。
Reporter.jar
が実際にデータを取得するプログラムで、Reporter.properties
はユーザー情報を書くファイルです。
Salesデータの取得方法
まずは認証情報を記入します。
Reporter.properties
を開くと以下のようになっているので、userIDとpasswordを埋めます。
userID = password = Mode=Robot.xml SalesUrl=https://reportingitc-reporter.apple.com/reportservice/sales/v1 FinanceUrl=https://reportingitc-reporter.apple.com/reportservice/finance/v1
入力が終わったらReporter.jarを使ってSalesデータを取得します。
java -jar Reporter.jar p=Reporter.properties Sales.getReport [vendor id], Sales, Summary, Daily, 20161201
vendor idは以下コマンドで取得する事ができます。
java -jar Reporter.jar p=[properties file] Sales.getVendors
コマンドは以下のようなXML返します。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Output> <Message>Successfully downloaded xxxxxxx.txt.gz</Message> </Output>
xxxxxxx.txt.gzファイルには各アプリのダウンロード数などのデータが入っています。
形式は以下のように1行1アプリ、各要素タブ区切りになります。
Provider Provider Country SKU Developer Title Version Product Type Identifier Units Developer Proceeds Begin Date End Date Customer Currency Country Code Currency of Proceeds Apple Identifier Customer Price Promo Code Parent Identifier Subscription Period Category CMB Device Supported Platforms Proceeds Reason Preserved Pricing Client APPLE US com.example developername appname 1.0 0 0 0 12/16/2016 12/16/2016 JPY JP JPY 123456789 0 Business iPhone iOS