Master API - Customizable Aggregated Data API

  • Advertisers
  • Developers

Introduction

AppsFlyer's customizable aggregated data API allows you to create your own custom report with the groupings and KPIs of your choice. You can have Lifetime Value (LTV), Retention, Cohort, Activity and even Protect360 based KPIs, for either one or all of your apps, in a single report!

This is an AppsFlyer premium feature.

 Note

Master API is not available for agencies and partners.

 

In addition, you can define the different groups according to which you want to view the data.

To use the API, compose the URL which defines the data that you want to view. As with AppsFlyer's Pull API, the result is returned as a CSV file.

Master API is the infrastructure upon which AppsFlyer's pivot table is built. Both features are bundled as an AppsFlyer premium feature.

Master API Structure

All Master API links have different parts, mandatory or optional, which are detailed below. These include: Master API base endpoint, mandatory parameters, groupings, KPIs, calculated KPIs, filters, time frame and localization fields. 

1. Master API Base Endpoint

Every call to the Master Report API must begin with the following endpoint:

https://hq.appsflyer.com/export/master_report/v4?

All the dynamic parameters in any master API URL follow the '?' character.

2. Mandatory Parameters

All Master API URLs have the same general format:

https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=[app_id]&from=[from_date]&to=[to_date]&groupings=[list]&kpis=[list]

 Important!

The names of KPIs, Groupings and others parameters are case-sensitive and should be in lowercase.

The table below describes these mandatory parameters:

Parameter Description Example Mandatory?

api_token

API token identifying your account, as appears under the API Access page in the dashboard

123510e9-1111-2222-3333-123bd8eeca9f

Yes

from

Start date

2016-08-02, 2017-w23

Yes

to

End date

2016-08-08, 2017-w24

Yes

app_id

Represents the apps included in the reports.  Either comma separated or "all". 

app_id=app_id1,app_id2

app_id=all

Yes 

groupings

comma separated, representing the different group by parameters for the selected query

groupings=pid,geo

Yes

kpis

comma separated – See below

kpis=installs,clicks, impressions,sessions,retention_day_7

Yes

3. Available Groupings

These are for collecting the data into groups to allow easier and more accurate examination of the information.

Dimension Display Name LTV KPIs Retention KPIs Activity KPIs Protect360 Cohort

app_id

App ID

Yes

Yes

Yes

Yes

Yes

pid

Media Source

Yes

Yes

Yes

Yes

Yes

af_prt

Agency

Yes

Yes

Yes

Yes

No

c

Campaign

Yes

Yes

Yes

Yes

Yes

af_adset

Adset

Yes

Yes

Yes

Yes

No

af_ad

Ad

Yes

Yes

Yes

Yes

No

af_channel

Channel

Yes

Yes

Yes

Yes

No

af_siteid

Publisher ID

Yes

Yes

Yes

Yes

Yes

af_keywords

Keywords

Yes

Yes

Yes

No

No

is_primary

Is Primary Attribution 

Yes

No

Yes

Yes

No

af_c_id

Campaign ID

Yes

No

Yes

Yes

No

af_adset_id

Adset ID

Yes

No

Yes

Yes

No

af_ad_id

Ad ID

Yes

No

Yes

Yes

No

install_time

Install Time

Yes

Yes

Yes

Yes

Yes

attributed_touch_type 

Touch Type

Yes

Yes

Yes

Yes

No

geo

GEO

Yes

Yes

Yes

Yes

Yes

4. KPIs

The Key Performance Indicators (KPI) are the metrics used for gaining an insight into the behavior of your app in different ways. Click each tab to view the available KPIs under their associated group.

LTV Retention Activity Cohort Protect360
Lifetime Value - Aggregated Events cohorted by install day up and until today
KPI Description
impressions Number of impressions within the selected time frame
clicks Number of clicks within the selected time frame
installs Number of installs within the selected time frame
cr Conversion Rate
sessions Number of sessions created by the users who installed within the selected time frame
loyal_users Number of loyal users who installed within the selected time frame
loyal_users_rate Loyal users / installs
cost Total cost in the selected time frame
revenue Lifetime revenue generated by the users who installed in the selected time frame
roi Return on Investment over a certain time frame
arpu_ltv Average revenue per user, for the users who installed in the selected time frame
average_ecpi Effective Cost per Installation (eCPI) over a certain time frame
uninstalls Uninstalling users, who installed in the selected time frame
uninstalls_rate Uninstallation rate
event_counter_[event%20name] Number of event occurrences
unique_users_[event%20name] Number of unique users who performed the event
sales_in_usd_[event%20name] Revenue reported as part of the reported events

 Warning

Event names are case-sensitive. You MUST use the same exact event names as sent to AppsFlyer with any KPIs containing the event names.

5. Calculated KPIs

On top of the KPIs described above, you can add calculated KPIs to your master API reports. These present an easy way to receive the quick KPI analysis you need automatically with every Master API report.

You can insert any number of built-in KPIs in the calculated KPI formulas. 

The supported math actions are: + (MUST be used encoded to %2b), -, *, / (MUST be used encoded to %2f) and (). 

Every calculated KPI's field name MUST start with "calculated_kpi_", followed by any valid string, e.g., calculated_kpi_purchaserate.

Examples:

First three days combined retention

kpis=installs,loyal_users_rate&calculated_kpi_3days_retention=retention_day_1%2Bretention_day_2%2Bretention_day_3

Average revenue per impression 

kpis=installs&calculated_kpi_rev_per_impression=revenue%2Fimpression

Cohort day 7 ROI 

kpis=installs,roi,arpu_ltv,cost,revenue&calculated_kpi_roi_day_7=(cohort_day_7_total_revenue_per_user-average_ecpi)%2Faverage_ecpi

6. Filters

Parameter Description Example Mandatory?

pid

Used for selecting the rows, which the specified media source/s are displayed in. Comma separated multiple selection is supported

pid=organic,applovin_int

No

c

Used for filtering by campaign name, comma separated multiple selection is supported

c=my_sample_campaign

No

af_prt

Used for filtering by agency name, comma separated multiple selection is supported

af_prt=moburst

No

af_channel

Used for filtering by channel name, comma separated multiple selection is supported

af_channel=Instagram

No

af_siteid

Used for filtering by publisher id, comma separated multiple selection is supported

af_siteid=12345678

No

geo

Used for filtering by country, comma separated multiple selection is supported

geo=US,DE

No

7. Time Frame Fields

Master API has two time granularity options:
  • Daily
  • Weekly
You can use the time frame fields, To and From, to determine the desired granularity in the selected time range. KPIs are displayed in accordance with your selection of either daily or weekly granularity.
Exact week numbers can be found here.

 Example

For a report using Daily granularity choose a date range such as From=2017-08-15&to=2017-08-17 and for Weekly granularity choose From=2017-w27&to=2017-w28

8. Localization

You can set local currency and timezone for your apps on the app settings page. The same localization preferences can also be reflected on master API reports using the parameters below.

Parameter Description Example Mandatory?

currency

All monetary values in the report are according to the App's Admin's choice of currency

currency=preferred

No

timezone

The report is generated according to the App's Admin's choice of time.

timezone=preferred

No

  • If all apps have the same configuration (whether by default or not), the common configuration is used. Otherwise, (different configurations per app), GMT and USD are used.
  • Localization (time zone and currency change) is not supported in Weekly Retention KPIs
  • If the preferred time zone was changed in the dashboard within the requested time range, the generated report contains values starting from the last change only.

 Note

For results to appear in the Master API according to Time Zone, the timezone=preferred parameter must be used.

Response Format

All the received fields in the response are according to V5 format.

By default, the response data is received in CSV file format. If you prefer to get the data in JSON format add &format=json to the URL. 

Request Examples

To save you time, here is a list of Master API URLs you can cut and paste to get different reports. Before using a URL make sure to:

  1. Replace the app name from com.greatapp to your android or iOS app's ID
  2. Replace [TOKEN] with your account's API token
  3. Replace the from and to dates to your preferred date range
  4. Change the KPIs according to your preferences
  5. If your app has a different timezone or currency than the default UTC (GMT) and USD add &timezone=preferred and/or &currency=preferred to the query URL
Elaborate Facebook Report

Compare all your Facebook ads performance:

https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=com.greatapp&from=[from_date]&to=[to_date]&pid=facebook
&groupings=pid,c,af_adset_id,af_ad_id
&kpis=installs,clicks,impressions,sessions,loyal_users,cost,revenue,arpu_ltv,roi
Elaborate Google Ads Report
Compare all your Google Ads performance:
https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=com.greatapp,id123456789&from=[from_date]&to=[to_date]&pid=googleadwords_int
&groupings=pid,c,af_adset_id,af_ad_id
&kpis=installs,sessions,loyal_users,cost,revenue,arpu_ltv,roi
Specific Countries Report
For Example: US and Canada for North America for all apps in the account:
https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=all&from=[from_date]&to=[to_date]&groupings=geo,pid,c&kpis=
installs,clicks,impressions,sessions,loyal_users,cost,revenue,arpu_ltv,
roi&geo=us,ca	
Keywords Effectiveness Report
Compare ROI and other KPIs of users according to their used keyword for installing:
https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=com.greatapp&from=[from_date]&to=[to_date]&groupings=af_keywords
&kpis=roi,arpu_ltv,average_ecpi,installs,loyal_users_rate,cost,revenue
Agencies Performance Report
Compare performance of all agencies working for you:
https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=com.greatapp,id123456789&from=[from_date]&to=[to_date]&groupings=af_prt,pid,c&kpis=installs,
loyal_users_rate
Affiliates Performance Report
Find the best affiliates that get you most installs from quality users under the media source 'affiliates' (more about Tracking Affiliates):
https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=com.greatapp&from=[from_date]&to=[to_date]&groupings=af_siteid&pid=affiliates
&kpis=installs,loyal_users_rate,arpu_ltv,retention_day_1,retention_rate_day_1,
retention_day_7,retention_rate_day_7,retention_day_15,retention_rate_day_15,
retention_day_30,retention_rate_day_30
Attribution Type Report
Do your best users come from clicks, impressions or organic?:
https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=com.greatapp,id123456789&from=[from_date]&to=[to_date]&groupings=attributed_touch_type
&kpis=installs,sessions,loyal_users_rate,arpu_ltv
Retargeting Users Effectiveness Report
Which type of campaigns gets more revenue, UA or retargeting?
https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=com.greatapp&from=[from_date]&to=[to_date]&groupings=is_primary&kpis=revenue
Networks Retention Report
Compare all networks installs for users retention on day 1, 7, 15, 22 and 30 after the install for all apps ?n the account:
https://hq.appsflyer.com/export/master_report/v4?api_token=[api_token]
&app_id=all&from=[from_date]&to=[to_date]&groupings=pid,c
&kpis=installs,loyal_users_rate,retention_day_1,retention_rate_day_1,
retention_day_7,retention_rate_day_7,retention_day_15,retention_rate_day_15,
retention_day_22,retention_rate_day_22,retention_day_30,retention_rate_day_30

Limitations

Cost Data

Cost data, including eCPI, may not always be available. This depends on whether the network supports cost data, the type of the network, i.e. using AppsFlyer links or self-reporting, and the requested dimensions.

In general, all sources, including owned media, which use AppsFlyer's links and have the cost parameter on the links, fully support cost data, regardless of the requested dimensions. Self-reporting networks, with their own API, usually support cost data with only some of the available dimensions.

In these cases, cost data is not available: A network doesn't have any cost data related to it Self-reporting network does support cost data, but not with the specific requested dimensions. For example, Google Ads doesn't support cost data if the group by is GEO. For the full list of ad networks supporting cost data click here.

 Important Notes

  • Specific groupings are only available for LTV KPIs, Activity or Retention KPIs. The API returns N/A when the data for a specific KPI is not available. For example, requesting retention_rate_day_7 grouped by af_channel will return “N/A”.
  • Data Freshness: The data is aggregated on a daily basis.  For users in time zone UTC - (minus) it may take up to 48 hours and for users in time zone UTC + (plus) it may take up to 24 hours for the report to be populated with data.
  • Maximum lines count: 200K

Troubleshooting

This section discusses common Master API errors and how to handle them.

The Supplied API Token is Invalid

Error Message

The supplied API token is invalid

Error Code

401

Description

The server could not authenticate the request. The API token is either missing or invalid.

How to Solve

Make sure that the URL contains the correct API token. The API token is passed in the api_token parameter.

Unauthorized App-ids

Error Message

Request id: <request_id>. Not authorized app-ids: <app_id>

Error Code

416

Description

This error occurs when you make a request for data related to an app that is not listed in your dashboard.

How to Solve

Verify that the app ID that you pass in the app_id parameter is the correct app ID.

 Note

For Android, the app ID is the package ID.

For iOS, the app ID is the App ID rather than the bundle ID.

No KPIs Provided

Error Message

Request id: <request_id>. [Error] No kpis provided

Error Code

403

Description

The master API provides aggregated reports. These reports require KPIs according to which data is aggregated.

How to Solve

Specify the desired KPis in the kpis parameter.

Wrong API Fields

Wrong API Fields

Error Message

Wrong API Fields: <api_field>

Error Code

416

Description

One or more API fields in the request are incorrect. API fields can be specified in the kpis or groupings parameters.

How to Solve

Make sure to list the correct API field name in the request. See the list of available KPIs or Groupings fields.

No Groupings Selected

Error Message

No Groupings Selected

Error Code

416

Description

The master API provides aggregated reports. These reports require KPIs according to which data is aggregated.

How to Solve

Specify the desired groupings in the groupings parameter.

Was this article helpful?
1 out of 1 found this helpful