Load App Store Connect data to PostgreSQL

Build a App Store Connect to PostgreSQL pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the App Store Connect API base URL, auth, endpoints, and incremental loading.

Source
App Store Connect
Destination
PostgreSQL
PostgreSQL is an open-source object-relational database system that uses and extends the SQL language.

Apple App Store Connect API is a REST API for automating actions and accessing data in App Store Connect. Everything needed to build a working App Store Connect → PostgreSQL pipeline is on this page: the API's base URL, authentication, endpoints, pagination and incremental field — plus a prompt that hands the whole job to your coding agent.


Build your App Store Connect to PostgreSQL pipeline

Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.

Prompt
Run uvx dlthub-init@latest to build a pipeline from App Store Connect to PostgreSQL and run it on dltHub

That scaffolds a dltHub workspace and installs the dltHub AI harness — the project rules, the secrets-management skill, and the dlt MCP server your agent needs to work safely. From there it reads the App Store Connect API, proposes the endpoints to load, then writes, runs and validates the pipeline while you review rather than type. Credentials are inspected through MCP tools, so your agent never reads secrets.toml itself. How the LLM-native workflow works →

Prefer to write it yourself? Every fact the agent uses is below.


App Store Connect API at a glance

Base URLhttps://api.appstoreconnect.apple.com/v1
Example endpointGET apps
Records found atdata
Authenticationall requests require an ES256-signed JWT bearer token — sent in the Authorization header, prefixed Bearer
PaginationCursor-based via cursor, next cursor at links.next, page size via limit (default 50, max 200). App Store Connect uses cursor-based pagination for list endpoints. Set the page size with the limit query parameter; the documented/open-source specification gives a default of 50 and maximum of 200, although individual endpoints can impose lower limits. The response exposes the continuation as links.next, a URL containing an opaque cursor; follow that URL or extract its cursor and send it as cursor on the next request. A date filter is an ordinary endpoint-specific filter and does not replace pagination.
Incremental fieldupdatedDate
Record idid
API referencehttps://developer.apple.com/documentation/appstoreconnectapi/generating-tokens-for-api-requests.md

These values come from the App Store Connect API reference — the authoritative source if anything here looks out of date.


How do I authenticate with the App Store Connect API?

Generate a JWT with header alg=ES256, kid=, and typ=JWT; payload includes iss=, aud=appstoreconnect-v1, and exp. Sign it with the downloaded .p8 private key and send it on every request as Authorization: Bearer . The documented request examples do not require an additional header.

1. Get your credentials

  1. Sign in to App Store Connect as the Account Holder and request App Store Connect API access: Users and Access → Integrations → App Store Connect API → Request Access, accept the terms, and submit. 2. For a team-wide credential, remain in Users and Access → Integrations → App Store Connect API, open Team Keys, click Generate API Key (or +), enter a reference name, choose the required role permissions, and click Generate. Copy the Issuer ID shown on the API page and the generated Key ID. Download the private .p8 key immediately; Apple provides the private key download only at creation. 3. Alternatively, an individual user can create an individual key from the App Store Connect username menu → Edit Profile → Individual API Key → Generate Key → Download; it uses that user’s permissions. 4. Create a short-lived JWT for each request: header alg=ES256, kid=Key ID, typ=JWT; team-key payload iss=Issuer ID, iat=current Unix time, exp no more than 20 minutes after iat, and aud=appstoreconnect-v1. Sign with the downloaded .p8 private key and send Authorization: Bearer to https://api.appstoreconnect.apple.com. Store the .p8 securely and never commit it to source control.

2. Add them to .dlt/secrets.toml

[sources.app_store_connect_source] issuer_id = "your_issuer_id_uuid" key_id = "your_key_id" private_key = "-----BEGIN PRIVATE KEY-----\nYOUR_P8_KEY_CONTENT\n-----END PRIVATE KEY-----"

dlt reads this file automatically at runtime. With the harness, the setup-secrets skill prompts you for the values and never handles the raw credential in chat. For production, see setting up credentials with dlt.


What App Store Connect data can I load into PostgreSQL?

These are the App Store Connect endpoints dlt can load into PostgreSQL:

ResourceEndpointMethodData selectorDescription
appsappsGETdataList apps; supports filters, sorting, includes, and limit.
actorsactorsGETdataList actors; documented maximum limit is 200.
app_price_pointsapps/{id}/appPricePointsGETdataList price points for an app.
game_center_leaderboard_sets_v2gameCenterDetails/{id}/gameCenterLeaderboardSetsV2GETdataList leaderboard sets for a Game Center detail.
game_center_leaderboards_v2gameCenterDetails/{id}/gameCenterLeaderboardsV2GETdataList leaderboards for a Game Center detail.
scm_providersscmProvidersGETdataList source-control providers.
ci_productsciProductsGETdataList Xcode Cloud products.
app_availabilities_v2v2/appAvailabilitiesPOSTdataCreate/query-style v2 app-availability operations; not a GET list endpoint.

How do I load only new App Store Connect records?

App Store Connect exposes updatedDate on apps, so dlt can request only the records that changed since the last run. Set it as the cursor_path and dlt tracks the high-water mark for you between runs.

{"name": "apps", "endpoint": { "path": "apps", "data_selector": "data", "incremental": {"cursor_path": "updatedDate", "initial_value": "2024-01-01T00:00:00Z"}, }}

On the first run dlt loads everything from initial_value; on every run after that it requests only what changed and appends with write_disposition="merge" if you set a primary key. See incremental loading.


What does the generated App Store Connect pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading apps and salesReports from the App Store Connect API into PostgreSQL:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def app_store_connect_source(api_key=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.appstoreconnect.apple.com/v1", "auth": {"type": "bearer", "token": api_key}, }, "resources": [ {"name": "apps", "endpoint": {"path": "apps", "data_selector": "data"}}, {"name": "actors", "endpoint": {"path": "actors", "data_selector": "data"}} ], } yield from rest_api_resources(config) def load_app_store_connect_to_postgres() -> None: pipeline = dlt.pipeline( pipeline_name="app_store_connect_pipeline", destination="postgres", dataset_name="app_store_connect_data", ) load_info = pipeline.run(app_store_connect_source()) print(load_info) if __name__ == "__main__": load_app_store_connect_to_postgres()

Run it with uv run python app_store_connect_pipeline.py. The agent iterates on this until it loads cleanly — you review and approve, rather than write it from scratch.


How do I query App Store Connect data in PostgreSQL?

dlt creates one table per resource. Query the loaded data with Python or SQL — or ask your agent to, through the MCP server's execute_sql_query tool.

Python (pandas DataFrame):

import dlt data = dlt.pipeline("app_store_connect_pipeline").dataset() df = data.apps.df() print(df.head())

SQL:

SELECT * FROM app_store_connect_data.apps LIMIT 10;

See querying your data with dataset and exploring it in marimo notebooks.


How do I deploy the App Store Connect to PostgreSQL pipeline in production?

The pipeline runs locally, which is ideal for prototyping and one-off analysis. When you need it on a schedule, monitored on every load, and shared with your team, deploy the same dlt code on the dltHub platform — no infrastructure to maintain. The prompt above already ends with "run it on dltHub", so your agent can take it there directly.

  • Deploy & schedule — run the pipeline as a managed job with automatic retries.
  • Monitor — observable job queues, alerting, and load metrics for every run.
  • Transform — promote raw App Store Connect loads into governed, documented models.
  • Visualize & share — explore data in notebooks and publish live dashboards instead of static screenshots.

Book a demo →


What other destinations can I load App Store Connect data to?

dlt loads into any of these — only the destination argument changes:

DestinationExample value
PostgreSQL"postgres"
BigQuery"bigquery"
Snowflake"snowflake"
Redshift"redshift"
Databricks"databricks"
Filesystem (S3, GCS, Azure)"filesystem"

Set dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. On the dltHub platform the same pipeline runs against a managed Iceberg lakehouse. See the full destinations list.


Next steps

Was this page helpful?

Community Hub

Need more dlt context for App Store Connect to PostgreSQL?

Request dlt skills, commands, AGENT.md files, and AI-native context.