Skip to main content

📊 AppStoreConnect Analytics Reports Python Package

Simplified access to Apple App StoreConnect Analytics Reports via API

Apple API Docs →


✨ Overview

This Python package provides a convenient interface to download Analytics Reports from the App Store Connect API. It handles authentication using JWT, manages requests, and retrieves analytics data for app usage, sales, crashes, and more.


🚀 Features

  • JWT Authentication using private key and issuer ID
  • Download Analytics Reports for a given app and date
  • Support for report types: ONGOING, ONE_TIME_SNAPSHOT
  • Full fetch of history including APP Customer Reviews
  • Unit-tested core components

📦 Installation

pip install surquest-utils-appstoreconnect-analyticsreports

Or clone this repo:

git clone git@github.com:surquest/python-appstoreconnect-analyticsreports.git
cd src/surquest/utils
pip install --no-cache-dir -r requirements.txt

🔧 Setup

To use this package, you will need:

  • Apple App Store Connect API Issuer ID
  • Your Key ID
  • A .p8 private key downloaded from App Store Connect

Set your credentials in a .env file or pass them directly to the client.

ISSUER_ID=your_issuer_id
KEY_ID=your_key_id
PRIVATE_KEY=-----BEGIN PRIVATE KEY-----???-----END PRIVATE KEY-----

🧑‍💻 Usage Example

import os
from surquest.utils.appstoreconnect.credentials import Credentials
from surquest.utils.appstoreconnect.analyticsreports.client import Client
from surquest.utils.appstoreconnect.analyticsreports.handler import Handler
from surquest.utils.appstoreconnect.analyticsreports.enums.category import Category
from surquest.utils.appstoreconnect.analyticsreports.enums.granularity import Granularity
from surquest.utils.appstoreconnect.analyticsreports.enums.report_name import ReportName

APP_ID = "123456789"
REPORT_NAME = ReportName.APP_SESSIONS_STANDARD
ACCESS_TYPE = "ONGOING"
GRANULARITY = Granularity.DAILY
CSV_PATH = "./your/path/to/export/data.csv"

credentials = Credentials(
    issuer_id=os.getenv('ISSUER_ID'),
    key_id=os.getenv('KEY_ID'),
    private_key_path=os.getenv('PRIVATE_KEY'),
)

client = Client(credentials=credentials)

# Example: Download analytics data
data = client.get_data(
    app_id = APP_ID,
    report_name = REPORT_NAME,
    access_type = "ONE_TIME_SNAPSHOT"
)

Handler.list_of_dicts_to_csv(data, CSV_PATH)

📚 Supported Report Parameters

Parameter Description
report_name Enum specified in ReportName surquest.utils.appstoreconnect.analyticsreports.enums.report_name.ReportName
granularity Enum specified in surquest.utils.appstoreconnect.analyticsreports.enums.granularity.Granularity
dates Set of dates in YYYY-MM-DD format

🧪 Running Tests

pytest tests/

📁 Project Structure

src/
└── surquest/
    └── utils/
        └── appstoreconnect/
            ├── __init__.py
            ├── credentials.py
            ├── requirements.txt
            └── analyticsreports/
                ├── __init__.py
                ├── client.py
                ├── errors.py
                ├── handler.py
                └── enums/
                    ├── __init__.py
                    ├── category.py
                    ├── granularity.py
                    └── report_name.py
tests/
└── surquest/
    └── utils/
        └── appstoreconnect/
            └── analyticsreports/
                └── test_client.py
README.md
pyproject.toml
LICENSE
.gitignore

🛡️ Disclaimer

This project is not affiliated with Apple Inc. Use responsibly and according to Apple’s Terms of Use.


📄 License

MIT License


🙋‍♀️ Contact / Contribute

PRs welcome! For bugs or feature requests, open an issue.

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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file surquest_utils_appstoreconnect_analyticsreports-0.0.1.tar.gz.

File metadata

File hashes

Hashes for surquest_utils_appstoreconnect_analyticsreports-0.0.1.tar.gz
Algorithm Hash digest
SHA256 df997d98890df111044044dcea3ebd55b5a6e106a59f646f0314127f41ccb47a
MD5 b87830fd6d458d019dd1c4e4fee9b5a6
BLAKE2b-256 5577625fefb864163955070b61f6e8854f467cda09f8f8dea56a6682e0426b0a

See more details on using hashes here.

File details

Details for the file surquest_utils_appstoreconnect_analyticsreports-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for surquest_utils_appstoreconnect_analyticsreports-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0dec0f1237e4ef1468f99f38aa018fd551492a3a1bd5c00d4d1994dfe0151fc8
MD5 3fe73d0ab26211a6def11aba4d2806ed
BLAKE2b-256 2f05f0bb902de4f21a30195c5306da037e22ffdd942fdde3ca7db4eb21fb05c0

See more details on using hashes here.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page