Skip to main content

Client library for AppStore Connect Analytics API

Project description

GitHub GitHub Workflow Status (with branch) Coverage PyPI - Downloads PyPI

Introduction

This is a Python library for the AppStore Analytics API and allows you to easily access the analytics data of your python apps.

Installation

pip install surquest-utils-appstoreconnect-analytics-api

Usage

import datetime as dt
from surquest.utils.appstoreconnect.analytics import (
    Client as AppStoreConnectClient,
    Analytics as AppStoreConnectAnalytics,
    Formatter,
    Frequency,
    Measures,
    Dimension,
)

# Create client
client = AppStoreConnectClient(
    mayacinfo="ADD-YOUR-MYACINFO", # is a Cookie value from https://appstoreconnect.apple.com/
)

# Create analytics object
analytics = AppStoreConnectAnalytics(
    client=client
)

# Get time series data
data = analytics.get_time_series(
    app_ids=["ADD-YOUR-APP-ID"],
    measure=Measures.INSTALLS,
    start_date=dt.date(2021, 1, 1),
    end_date=dt.date(2021, 1, 31),
    grouping=Group.COUNTRY
    frequency=Frequency.DAY,
    )

print("YOUR DATA:", data)

Development

docker build `
     --tag surquest/utils/appstoreconnect:dev `
     --file package.base.dockerfile `
     --target test .

docker run --rm -it `
 -v "${pwd}:/opt/project" `
 -w "/opt/project/test" `
 -e "APPID={ADD-YOUR-APP-ID}" `
 -e "MYACINFO={ADD-YOUR-MYACINFO}" `
 surquest/utils/appstoreconnect:dev pytest

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page