📊 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:
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
.p8private 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.
Metadata
Release files for surquest-utils-appstoreconnect-analyticsreports 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| surquest_utils_appstoreconnect_analyticsreports-0.0.1.tar.gz | 24.4 kB | Without provenance | Details for surquest_utils_appstoreconnect_analyticsreports-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| surquest_utils_appstoreconnect_analyticsreports-0.0.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for surquest_utils_appstoreconnect_analyticsreports-0.0.1-py2.py3-none-any.whl |
Total release size: 42.2 kB
Release files / surquest_utils_appstoreconnect_analyticsreports-0.0.1.tar.gz
| Download URL | surquest_utils_appstoreconnect_analyticsreports-0.0.1.tar.gz |
|---|---|
| Size | 24.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df997d98890df111044044dcea3ebd55b5a6e106a59f646f0314127f41ccb47a
|
|
BLAKE2b-256 checksum How to use checksums |
5577625fefb864163955070b61f6e8854f467cda09f8f8dea56a6682e0426b0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Release files / surquest_utils_appstoreconnect_analyticsreports-0.0.1-py2.py3-none-any.whl
| Download URL | surquest_utils_appstoreconnect_analyticsreports-0.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0dec0f1237e4ef1468f99f38aa018fd551492a3a1bd5c00d4d1994dfe0151fc8
|
|
BLAKE2b-256 checksum How to use checksums |
2f05f0bb902de4f21a30195c5306da037e22ffdd942fdde3ca7db4eb21fb05c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Security for surquest-utils-appstoreconnect-analyticsreports 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.