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

File metadata

File hashes

Hashes for surquest_utils_appstoreconnect_analyticsreports-0.0.1rc5.tar.gz
Algorithm Hash digest
SHA256 1530ea4d7e21cdc8170b044ede62d8cb43c336afd5b7a87b4884d500f521140c
MD5 de102e733002071a10eb9ce6a858bbec
BLAKE2b-256 d4cb09a333f058c2d3206648594ad57a7e8e2072594709276cdf86ea4e71d0fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for surquest_utils_appstoreconnect_analyticsreports-0.0.1rc5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0fe582c001aa4a010721a8791aa4d0047ac62bb9674ecd9fadff52a9feb141c4
MD5 b86ab291dba08e31192eccf9f5c5dc7f
BLAKE2b-256 200a24e5a5bc0d8d5a1a6e48df378469249517213e52465b35aa399f7d7dde3b

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