AppsFlyer Reporting
Use the bundled read-only CLI for AppsFlyer Master API and Aggregate Pull API reports.
Requirements
- Require Python 3.9 or newer.
- Require
APPSFLYER_API_TOKEN in the environment.
- Require AppsFlyer subscription access to the requested report and app.
- Never print, quote, save, or pass the token on the command line.
- Use
scripts/appsflyer_reporting.sh; do not construct ad hoc AppsFlyer URLs.
AppsFlyer revoked API V2 tokens generated before March 10, 2026 at 19:00 UTC. If a previously working token receives 401, tell the user to regenerate it in AppsFlyer before retrying.
Workflow
- Select
master-last-update, master-report, or pull.
- Collect the required app ID, dates, groupings, and KPIs. Do not guess them.
- Route freshness, custom KPI, retention, cohort, and Protect360 requests to Master API. Route fixed daily, partner, and geo aggregates to Pull API; use Pull
daily for ordinary daily performance requests.
- Keep Master reports within 31 inclusive days. Let the script split and merge only date-grouped Pull reports; never merge independently aggregated Master,
partners, or geo chunks.
- Return a concise summary and the saved output path. Do not paste a large report unless requested.
- Preserve the raw report unless the user explicitly chooses Pull API
--format json, which performs a local CSV-to-JSON conversion.
Commands
Check Master data freshness
bash <skill-path>/scripts/appsflyer_reporting.sh master-last-update
Get a Master report
bash <skill-path>/scripts/appsflyer_reporting.sh master-report \
--app-id com.example.app \
--from 2026-08-01 \
--to 2026-08-31 \
--groupings install_time,pid,c \
--kpis installs,revenue \
--format json
Master Report checks master-last-update first and writes the freshness value to stderr. Use --skip-last-update only when that extra request is undesirable. Master API accepts at most 31 inclusive days; run separate reports for longer periods.
Add a calculated KPI with a name that starts with calculated_kpi_:
bash <skill-path>/scripts/appsflyer_reporting.sh master-report \
--app-id com.example.app \
--from 2026-08-01 \
--to 2026-08-07 \
--groupings install_time,pid \
--kpis installs,revenue \
--calculated-kpi 'calculated_kpi_revenue_per_install=revenue/installs'
Get an Aggregate Pull report
bash <skill-path>/scripts/appsflyer_reporting.sh pull \
--report partners-daily \
--app-id com.example.app \
--from 2026-08-01 \
--to 2026-08-31 \
--media-source facebook \
--category facebook
Supported Pull report names:
partners
partners-daily
daily
geo
geo-daily
Use --format json to convert the returned CSV rows into a JSON array locally. Aggregate Pull API itself returns CSV. Only daily, partners-daily, and geo-daily are split and merged across long ranges because they include a date dimension; partners and geo are sent as one aggregate request.
Output and errors
- Save every successful response under
./out/ by default; use --output to select a path.
- Print the saved path to stderr. Add
--stdout only when the user explicitly requests the complete report on stdout.
- Validate that report responses have a compatible CSV or JSON content type.
- Keep CSV headers once when merging safe, date-grouped Pull chunks.
- Merge JSON arrays, or objects containing a
data array, across chunks.
- Retry
429 and 5xx responses with bounded exponential backoff and honor numeric Retry-After values.
- Sanitize API error text and never include the token or full request URL.
- Treat
401 as invalid/revoked credentials or account suspension, 404 as an invalid app ID or unavailable subscription feature, and other non-2xx responses as failures.
For endpoint and parameter details, read references/api.md.
1---2name: appsflyer-reporting3description: Query AppsFlyer reporting APIs for Master API campaign KPIs, Master data freshness, and Aggregate Pull API partner, daily, and geo reports. Use when the user asks for AppsFlyer LTV, activity, retention, cohort, Protect360, installs, revenue, media-source, campaign, country, or daily aggregated performance data, or wants AppsFlyer reports exported as CSV or JSON.4---56# AppsFlyer Reporting78Use the bundled read-only CLI for AppsFlyer Master API and Aggregate Pull API reports.910## Requirements1112- Require Python 3.9 or newer.13- Require `APPSFLYER_API_TOKEN` in the environment.14- Require AppsFlyer subscription access to the requested report and app.15- Never print, quote, save, or pass the token on the command line.16- Use `scripts/appsflyer_reporting.sh`; do not construct ad hoc AppsFlyer URLs.1718AppsFlyer revoked API V2 tokens generated before March 10, 2026 at 19:00 UTC. If a previously working token receives `401`, tell the user to regenerate it in AppsFlyer before retrying.1920## Workflow21221. Select `master-last-update`, `master-report`, or `pull`.232. Collect the required app ID, dates, groupings, and KPIs. Do not guess them.243. Route freshness, custom KPI, retention, cohort, and Protect360 requests to Master API. Route fixed daily, partner, and geo aggregates to Pull API; use Pull `daily` for ordinary daily performance requests.254. Keep Master reports within 31 inclusive days. Let the script split and merge only date-grouped Pull reports; never merge independently aggregated Master, `partners`, or `geo` chunks.265. Return a concise summary and the saved output path. Do not paste a large report unless requested.276. Preserve the raw report unless the user explicitly chooses Pull API `--format json`, which performs a local CSV-to-JSON conversion.2829## Commands3031### Check Master data freshness3233```bash34bash <skill-path>/scripts/appsflyer_reporting.sh master-last-update35```3637### Get a Master report3839```bash40bash <skill-path>/scripts/appsflyer_reporting.sh master-report \41 --app-id com.example.app \42 --from 2026-08-01 \43 --to 2026-08-31 \44 --groupings install_time,pid,c \45 --kpis installs,revenue \46 --format json47```4849Master Report checks `master-last-update` first and writes the freshness value to stderr. Use `--skip-last-update` only when that extra request is undesirable. Master API accepts at most 31 inclusive days; run separate reports for longer periods.5051Add a calculated KPI with a name that starts with `calculated_kpi_`:5253```bash54bash <skill-path>/scripts/appsflyer_reporting.sh master-report \55 --app-id com.example.app \56 --from 2026-08-01 \57 --to 2026-08-07 \58 --groupings install_time,pid \59 --kpis installs,revenue \60 --calculated-kpi 'calculated_kpi_revenue_per_install=revenue/installs'61```6263### Get an Aggregate Pull report6465```bash66bash <skill-path>/scripts/appsflyer_reporting.sh pull \67 --report partners-daily \68 --app-id com.example.app \69 --from 2026-08-01 \70 --to 2026-08-31 \71 --media-source facebook \72 --category facebook73```7475Supported Pull report names:7677- `partners`78- `partners-daily`79- `daily`80- `geo`81- `geo-daily`8283Use `--format json` to convert the returned CSV rows into a JSON array locally. Aggregate Pull API itself returns CSV. Only `daily`, `partners-daily`, and `geo-daily` are split and merged across long ranges because they include a date dimension; `partners` and `geo` are sent as one aggregate request.8485## Output and errors8687- Save every successful response under `./out/` by default; use `--output` to select a path.88- Print the saved path to stderr. Add `--stdout` only when the user explicitly requests the complete report on stdout.89- Validate that report responses have a compatible CSV or JSON content type.90- Keep CSV headers once when merging safe, date-grouped Pull chunks.91- Merge JSON arrays, or objects containing a `data` array, across chunks.92- Retry `429` and `5xx` responses with bounded exponential backoff and honor numeric `Retry-After` values.93- Sanitize API error text and never include the token or full request URL.94- Treat `401` as invalid/revoked credentials or account suspension, `404` as an invalid app ID or unavailable subscription feature, and other non-2xx responses as failures.9596For endpoint and parameter details, read [references/api.md](references/api.md).