GooglePlay 
Developer APIを使ってみた 
2014/8/20 
@sakebook 
http://github.com/sakebook 
http://sakebook.hatenablog.com/
自己紹介 
酒本伸也! 
Android Developer & 初級ライフロガー! 
マーケットアプリとかゲームメディアとか 
ニュースアプリとか! 
potatotips #3 ちょっと優しい入力項目! 
potatptips #6 インストールリファラでハマった話
Developer APIとは? 
以下の2つのAPIがあります。! 
Subscriptions and In-App Purchases! 
ユーザのアプリ内課金のアイテムの制御や 
Subscriptionの確認・キャンセルができる! 
Publishing API! 
APKのアップロードやテスト配布 
説明文の編集などができる
PublishingAPIを試す 
https://github.com/googlesamples/android-play-publisher-api/ 
tree/master/v2/python
初期設定 
プロジェクトを作り Developer APIをONにする 
https://play.google.com/apps/publish/ 
#ApiAccessPlace! 
以下の3つを取得! 
CLIENT ID ! 
CLIENT SECRET! 
REDIRECT URIS
client_secrets.json 
{! 
"installed": {! 
"client_id": "xxxxxxxxxx",! 
"client_secret": "xxxxxxxxx",! 
"redirect_uris": [“xxxxx”,”xxx"],! 
…! 
}! 
} 
basic_upload_apks.py 
…! 
TRACK = ‘production’! 
…
$ python basic_upload_apks.py {PKG_NAME} {APK_FILE}
APKアップロード完了
API Reference 
OAUTH 2.0認証! 
Edits! 
insert: APIで編集を行う際に始めに呼ぶ! 
commit: APIでの編集の確定時に呼ぶ! 
get: APIでの編集内容を表示! 
delete: APIの編集内容を破棄する
Edits.apks: APKのアップロードと現在公開されているAPKの確認! 
Edits.apklistings: APKのアップロードと、アップデート説明文の編集! 
Edits.details: 連絡先方法の編集! 
Edits.extensionfiles: 追加ファイルのアップロード! 
Edits.images: 動画以外の、アイコンを含む画像のアップロード! 
Edits.listings: 動画とタイトルを含めた説明文の編集! 
Edits.tracks: テスト配布や段階的公開中のアプリの状態の編集! 
Edits.testers: 各trackのテスターの確認と編集
スクリプトで完結しちゃう
リリース作業を含めて自動化! 
! サードパーティの 
テスト配布機能が不要に!
参考 
https://developers.google.com/android-publisher/ 
! 
https://github.com/googlesamples/android-play-publisher- 
api/tree/master/v2/python! 
https://developers.google.com/api-client-library/ 
python/! 
https://support.google.com/googleplay/android-developer/ 
answer/6071616?hl=ja
以上

Google Play Developer APIを使ってみた