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
✨ 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
.p8private 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 import Client
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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file surquest_utils_appstoreconnect_analyticsreports-0.0.1rc1.tar.gz.
File metadata
- Download URL: surquest_utils_appstoreconnect_analyticsreports-0.0.1rc1.tar.gz
- Upload date:
- Size: 53.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f03b7226b2f016f901fd21656c2bfb11c37e806f120b111da46cda8a53f769c
|
|
| MD5 |
a08fb2c2756e40a54f47e8fe75e6e207
|
|
| BLAKE2b-256 |
b00d84a5199be927754b1695ed49f4aa9756b3ecf2c6a1c58845c52422e9a1cc
|
File details
Details for the file surquest_utils_appstoreconnect_analyticsreports-0.0.1rc1-py2.py3-none-any.whl.
File metadata
- Download URL: surquest_utils_appstoreconnect_analyticsreports-0.0.1rc1-py2.py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cd94af27407d1aa04be3af6ef9a6801b724c51dd632556d2a3648efef39a245
|
|
| MD5 |
661a5f0449bf599f514c9445042991db
|
|
| BLAKE2b-256 |
db2b6847e4d5e14422f4eea5f8eff67520881c707b155bbe9e7dacd2e2434493
|