Skip to main content

Convenient interface to **download Analytics Reports** from the [App Store Connect API](https://developer.apple.com/documentation/appstoreconnectapi). It handles authentication using JWT, manages requests, and retrieves analytics data for app usage, sales, crashes, and more.

Project description

📊 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: app-usage, crashes, sales, etc.
  • 🗓️ Date range selection with proper ISO 8601 formatting
  • 🧪 Unit-tested core components

📦 Installation

pip install surquest-utils-appstoreconnect-analytics-reports

Or clone this repo:

git clone https://github.com/surquest/python-appstoreconnect-analyticsreports
cd src/surquest/utils
pip install -e .

🔧 Setup

To use this package, you will need:

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

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

APPSTORE_ISSUER_ID=your_issuer_id
APPSTORE_KEY_ID=your_key_id
APPSTORE_PRIVATE_KEY_PATH=AuthKey_XXXXXXXXXX.p8

🧑‍💻 Usage Example

from surquest.utils.appstoreconnect.credentials import Credentials
from surquest.utils.appstoreconnect.analyticsreports.client import Client as AnalyticsClient

credentials = Credentials(
    issuer_id="your_issuer_id",
    key_id="your_key_id",
    private_key_path="AuthKey_XXXXXXXXXX.p8"
)

client = AnalyticsClient(
    credentials=credentials
)

report_data = client.download_report(
    app_id="1234567890",
    report_type="app-usage",
    report_subtype="DAILY",
    frequency="DAILY",
    report_date="2024-07-01"
)

📚 Supported Report Parameters

Parameter Description
report_type Type of report (app-usage, crashes, sales)
report_subtype Format/subtype of report (DAILY, WEEKLY, MONTHLY)
frequency Time granularity (DAILY, WEEKLY, etc.)
report_date Date in YYYY-MM-DD format

🧪 Running Tests

pytest tests/

📁 Project Structure

appstoreconnect_analytics/
│
├── client.py            # API client logic
├── auth.py              # JWT generation
├── utils.py             # Helpers for requests, validation
├── __init__.py
└── ...
tests/
└── test_client.py

🛡️ 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.

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

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.1rc7.tar.gz.

File metadata

File hashes

Hashes for surquest_utils_appstoreconnect_analyticsreports-0.0.1rc7.tar.gz
Algorithm Hash digest
SHA256 80d1afbcabb81b07298c11212ce621c4692d23459c14416f6eb200e14272717b
MD5 d4c17d2eaf13edc86839ef6df17313ac
BLAKE2b-256 87219a1a22054083c34d9981c9b80e22579004f7fcb7d9d1e7d8897d6a290ad2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for surquest_utils_appstoreconnect_analyticsreports-0.0.1rc7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b04e2551808956a3613359b8c4dc18f25a0c80bcaa80aa2f1228e30bf024549e
MD5 3cc2cf144e6fb768d7624d832211bf30
BLAKE2b-256 8838329fbd3b8360dcd6d236609ad4cc7c37dcc529f5d52f9ffc7651289768dc

See more details on using hashes here.

Supported by

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