Mediation Impression Level Revenue Data API

Use the Mediation Impression Level Revenue Data (ILRD) API to access impression stats based on the performance of one of your games. Download a CSV file to view data for a specific platform that the game is on (iOS or Android), per app, per day.

Note: Impression event data is not included on the Mediation Reporting page.

The Mediation Impression Level Revenue Data API uses rate limiting to control server request/response load. Requests are limited on a per-app basis to:

  • 1 request per second
  • 50 requests per 30 minutes

Authentication

The Mediation Impression Level Revenue Data API requires an API key that is associated with your Unity developer account. To access your API Key, go to the Unity Dashboard and then create a service account with the Mediation Reporting API Viewer role. For more information on how to manage service accounts, see the Unity Admin API Authentication documentation.

After you have created a key, you can authenticate with the API. For more information, see the Unity Services API documentation.

The following image displays an example of where you can find the Mediation Reporting API Viewer role, which you must enable on your service account to use the Mediation Impression Level Revenue Data API.

A service account dashboard with a list of user roles

API request

Data availability range

The following data availability range limits apply to impression event data reporting when using the Mediation Impression Level Revenue Data API:

  • No more than 180 days prior to the current date

  • Prior or equal to 2 days before the current date

    Note: Data reporting for a specified date is available two days later at UTC 00:00:00 (Coordinated Universal Time).

Report data can be updated up to 31 days after the event date to account for retroactive ad network data updates.

Request fields

The Mediation Impression Level Revenue Data API includes fields that you can use to specify which dimensions and metrics should be included in the report. If nothing is specified, or if no valid dimensions or metrics are supplied, then the report uses default dimensions and metrics.

To make a request, use the following format:

The API request uses the following fields:

FieldDescriptionNote
app_idThe ID of a platform version of a project. 
api_keyThe Unity Mediation reporting API key.See Authentication.
dateThe day of the report.ISO-8601
file_format“csv” 
organization_idThe ID of the organization 
return_fieldsA list of requested fields. If this is left blank, then the default fields are returned.See Return fields.

API response

The Mediation Impression Level Revenue Data API response is a URL to a CSV file. Access to this CSV file is unauthenticated and expires after 10 minutes.

The API response returns the following fields:

FieldDescriptionNote
statusThe response status code.See the status codes documentation.
urlA URL to the CSV file. 

Note: The API can take up to approximately 30 seconds to respond.

Return fields

The following table lists the impression event data that you can retrieve in the CSV file that is generated by using the Mediation Impression Level Revenue Data API.

FieldDescriptionNote
ad_source_instance_idThe ID of the ad network’s Ad Unit, Placement, or Zone.Default
ad_source_nameThe name of the ad network that is serving the impression (for example, the ad network ID).Optional
ad_unit_format

The Ad Unit format of the Ad Unit that is serving the impression:

  • INTERSTITIAL

  • REWARDED

Optional
ad_unit_idThe ID of the Ad Unit that is serving the impression.Default
ad_unit_nameThe name of the Ad Unit that is serving the impression.Default
app_idThe ID of a platform version of a project.Default
app_nameThe project name.Optional
country_code

The ISO-2 country code for the device location when the load request occurred.

See the ISO documentation on ISO 3166-1 alpha-2 codes.

Optional
impression_clickedIf the user clicked the impression.Optional
impression_idThe unique impression ID.Default
impression_revenue

The single impression estimated revenue for an impression event.

For example, a CPM of 2.55 returns a value of 0.00255 for that impression.

Note: Meta revenue data is not available.
Default
line_item_idThe line item ID for the impression event.Default
line_item_nameThe line item name for the impression event.Optional
mediation_group_ab_variant Optional
mediation_group_id Optional
mediation_group_name Optional
mediation_networkThis is always “Unity”.Optional
os_versionThe project operating system: “ios, android”Optional
platform Optional
revenue_currencyThe currency denomination of the impression event.Optional
revenue_precision

The accuracy of the revenue:

  • “ESTIMATED” (non-bidding)

  • “EXACT” (bidding)

Default
timestampThe timestamp of the impression event (ISO format).Default

Client-side connection

As an alternative solution, Unity Mediation also supports a client-side connection that generates reports based on impression revenue data from users. Publishers can pass this event data to mobile measurement partners (MMPs) or connect to their own first-party systems to help with user acquisition efforts.

For more information on how to implement listeners into your code to pass along impression revenue data, see the Unity Mediation documentation on Android impression events and iOS impression events.

Error messages

The following table lists the error messages that might occur when you use the Mediation Impression Level Revenue Data API.

Status codeError messageDescription
400

query parameters are invalid: (detailed error description)

or

error generating report: (detailed error description)

There is something wrong with the parameters passed in the request.
404

error generating report: no data is available for the requested date

There is no data available.

500

sorry can't handle request

There is an internal error.

Troubleshooting

For additional assistance with using the Mediation Impression Level Revenue Data API, contact Unity Support.