[Tenjin API Reference](https://api-docs.tenjin.com/llms.txt) › [Reporting Metrics API](https://api-docs.tenjin.com/reporting-metrics-api.md) › Pull an ad revenue report

- Reporting Metrics API OpenAPI spec: https://api-docs.tenjin.com/openapi/reporting-metrics-api.json

# Pull an ad revenue report

- **Method:** `GET`
- **Path:** `/v2/reports/ad_revenue`
- **Operation ID:** `get_reports_ad_revenue`
- **Tags:** Reporting Metrics

Columns of a row by group_by, besides `date` (absent with `granularity=totals-daily`) and the requested metrics. A combination has the columns of each of its values.

| group_by       | Columns                                                                                               |
| -------------- | ----------------------------------------------------------------------------------------------------- |
| `app`          | `app_id`, `app_name`, `app_icon_url`, `platform`, `bundle_id`, `store_id`                             |
| `channel`      | `ad_network_id`, `ad_network_name`, `ad_network_icon_url`, `ad_network_short_id`, `ad_network_custom` |
| `country`      | `country_name` (the ISO country code)                                                                 |
| `ad_placement` | `ad_placement_id`, `ad_placement_name`, the `app` columns and the `channel` columns                   |

## Effective servers

- `https://api.tenjin.com`

## Authentication

- **Bearer**: HTTP bearer (`JWT`)

  Generate an access token on the [Access Tokens](https://dashboard.tenjin.com/dashboard/access_tokens) page of the Tenjin dashboard and send it as `Authorization: Bearer <access token>`. [API access tokens](https://tenjin.com/docs/api-access-tokens/) explains them.

## Query parameters

- **`start_date`**: `string`, format: `date`

  First day to include, YYYY-MM-DD. Defaults to 30 days before today
- **`end_date`**: `string`, format: `date`

  Last day to include, YYYY-MM-DD. Defaults to today
- **`app_ids`**: `array of string`, explode: `false`

  Ids of the apps to report on, comma-separated; all accessible apps when blank
- **`channel_ids`**: `array of integer`, explode: `false`

  Ids of the channels to report on, comma-separated; all channels when blank
- **`granularity`**: `string`, possible values: `"daily", "weekly", "monthly", "totals-daily"`, default: `"daily"`

  Period of each row. With `totals-daily`, one row covers the whole date range
- **`metrics`**: `array`, default: `["ad_revenue","impressions","clicks","ecpm","ecpc"]`, explode: `false`

  Metrics to report, comma-separated; see the [Metric Definitions](https://api-docs.tenjin.com/metric_definitions#ad_revenue)

  **Array of:**

  `string`, possible values: `"ad_revenue", "clicks", "impressions", "ecpm", "ecpc"`
- **`metric_filters`**: `array of string`, explode: `false`

  Keep only rows where every filter holds. A filter is metric:op:value; op is gt, gte, lt, lte or eq
- **`omit_blank_rows`**: `boolean`

  Drop rows where every requested metric is zero or null
- **`ad_network_ids`**: `integer`

  Deprecated: use channel_ids. One ad network id, or several as `ad_network_ids[]`; ignored when channel_ids is sent
- **`platforms`**: `string`

  Ignored; returned unchanged in meta.platforms
- **`countries`**: `array of string`, explode: `false`

  Keep only these countries: two-letter country codes such as `US`, and `UN` for an unknown country
- **`group_by`**: `array`, default: `["app"]`, explode: `false`

  Dimensions to group the rows by, comma-separated; any combination of them

  **Array of:**

  `string`, possible values: `"channel", "app", "country", "ad_placement"`
- **`page`**: `integer`, default: `1`

  Page of results to fetch.
- **`per_page`**: `integer`, default: `100`, minimum: `0`, maximum: `1000`

  Number of results to return per page.

## Responses

### 200 The report

**Headers:**

- **`Link`**

  URLs of the first, previous, next and last pages (RFC 8288); sent only when the list has more than one page

  `string`
- **`Total`**

  Number of items on all pages

  `integer`
- **`Per-Page`**

  Number of items per page

  `integer`

**Content type:** `application/json`

schema: `AdRevenueReportDocument`

- **`data` (required)**: `array`

  **Items:**

  schema: `AdRevenueReportResource`
  - **`attributes` (required)**: `object`

    The dimension columns of the group_by, and the requested metrics; see the [Metric Definitions](https://api-docs.tenjin.com/metric_definitions#ad_revenue)
    - **`ad_network_custom`**: `boolean`

      Whether the channel is a custom one. Group by channel or ad_placement
    - **`ad_network_icon_url`**: `string | null`

      Icon URL of the channel. Group by channel or ad_placement
    - **`ad_network_id`**: `integer | null`

      Id of the channel. Group by channel or ad_placement
    - **`ad_network_name`**: `string | null`

      Name of the channel. Group by channel or ad_placement
    - **`ad_network_short_id`**: `string | null`

      URL-safe id of the channel. Group by channel or ad_placement
    - **`ad_placement_id`**: `string`, format: `uuid`

      Id of the ad placement. Group by ad_placement
    - **`ad_placement_name`**: `string | null`

      Name of the ad placement. Group by ad_placement
    - **`ad_revenue`**: `number | null`, format: `double`

      Ad Revenue. When requested
    - **`app_icon_url`**: `string | null`

      Icon URL of the app. Group by app or ad_placement
    - **`app_id`**: `string | null`, format: `uuid`

      Id of the app. Group by app or ad_placement
    - **`app_name`**: `string | null`

      Name of the app. Group by app or ad_placement
    - **`bundle_id`**: `string | null`

      Bundle id of the app in its store. Group by app or ad_placement
    - **`clicks`**: `number | null`, format: `double`

      Clicks. When requested
    - **`country_name`**: `string`

      ISO country code, despite the name. Group by country
    - **`date`**: `string`, format: `date`

      First day of the period; absent with granularity=totals-daily
    - **`ecpc`**: `number | null`, format: `double`

      eCPC. When requested
    - **`ecpm`**: `number | null`, format: `double`

      eCPM. When requested
    - **`impressions`**: `number | null`, format: `double`

      Impressions. When requested
    - **`platform`**: `string | null`, possible values: `"amazon", "android", "android_other", "ios", "windows", "unspecified", null`

      Platform of the app. Group by app or ad_placement
    - **`store_id`**: `string | null`

      Id of the app in its store. Group by app or ad_placement
  - **`id` (required)**: `string`
  - **`type` (required)**: `string`, possible values: `"report"`
- **`links` (required)**: `object`, schema: `Links`
  - **`self` (required)**: `string`, format: `uri`

    URL of this request
  - **`first`**: `string`, format: `uri`

    URL of the first page of a list
  - **`last`**: `string`, format: `uri`

    URL of the last page of a list
  - **`next`**: `string`, format: `uri`

    URL of the next page of a list
  - **`prev`**: `string`, format: `uri`

    URL of the previous page of a list
- **`meta` (required)**: `object`, schema: `AdRevenueReportMeta`
  - **`ad_network_ids` (required)**: `(array of integer) | (array of string)`

    The channel_ids param, or the deprecated ad_network_ids param as an array of strings
  - **`app_ids` (required)**: `array of string`

    The app_ids param
  - **`count` (required)**: `integer`

    Number of rows on all pages
  - **`countries` (required)**: `array of string`

    The countries param
  - **`end_date` (required)**: `string`, format: `date`

    The end_date param, or its default
  - **`granularity` (required)**: `string`, possible values: `"daily", "weekly", "monthly", "totals-daily"`

    The granularity param, or its default
  - **`group_by` (required)**: `array`

    Internal dimension names

    **Items:**

    `string`, possible values: `"ad_network_id", "app_id", "country", "ad_placement_id"`
  - **`metrics` (required)**: `array of string`

    The requested metrics
  - **`organization_id` (required)**: `string`, format: `uuid`

    Id of your organization
  - **`per_page` (required)**: `integer`

    Number of rows per page
  - **`platforms` (required)**: `array of string`

    The deprecated platforms param as sent; empty when not sent
  - **`start_date` (required)**: `string`, format: `date`

    The start_date param, or its default

**Example: Group by channel,app,country, monthly**

```json
{
  "data": [
    {
      "id": "2026-08-01,900011,74775bac-ff20-41cd-b129-eb124ae3a338,BR",
      "type": "report",
      "attributes": {
        "date": "2026-08-01",
        "ad_network_id": 900011,
        "app_id": "74775bac-ff20-41cd-b129-eb124ae3a338",
        "country_name": "BR",
        "ad_revenue": 153.26,
        "impressions": 227142,
        "clicks": 11808,
        "ecpm": 0.6747321059073179,
        "ecpc": 0.012979336043360433,
        "app_name": "Alpha",
        "app_icon_url": "/default_app_icon.png",
        "bundle_id": "com.example.alpha",
        "store_id": "2000000001",
        "platform": "ios",
        "ad_network_name": "Network One",
        "ad_network_icon_url": "",
        "ad_network_short_id": "network_one",
        "ad_network_custom": false
      }
    },
    {
      "id": "2026-08-01,900012,74775bac-ff20-41cd-b129-eb124ae3a338,BR",
      "type": "report",
      "attributes": {
        "date": "2026-08-01",
        "ad_network_id": 900012,
        "app_id": "74775bac-ff20-41cd-b129-eb124ae3a338",
        "country_name": "BR",
        "ad_revenue": 212.25,
        "impressions": 193037,
        "clicks": 8249,
        "ecpm": 1.0995301418898968,
        "ecpc": 0.025730391562613652,
        "app_name": "Alpha",
        "app_icon_url": "/default_app_icon.png",
        "bundle_id": "com.example.alpha",
        "store_id": "2000000001",
        "platform": "ios",
        "ad_network_name": "Network Two Account",
        "ad_network_icon_url": "",
        "ad_network_short_id": "network_two",
        "ad_network_custom": true
      }
    }
  ],
  "links": {
    "self": "https://api.tenjin.com/v2/reports/ad_revenue?start_date=2026-08-25&end_date=2026-08-31&group_by=channel%2Capp%2Ccountry&granularity=monthly"
  },
  "meta": {
    "count": 15,
    "per_page": 100,
    "start_date": "2026-08-25",
    "end_date": "2026-08-31",
    "granularity": "monthly",
    "metrics": [
      "ad_revenue",
      "impressions",
      "clicks",
      "ecpm",
      "ecpc"
    ],
    "organization_id": "7fcc8f37-2d3f-4cf7-b109-af97836327a3",
    "app_ids": [],
    "ad_network_ids": [],
    "group_by": [
      "ad_network_id",
      "app_id",
      "country"
    ],
    "countries": [],
    "platforms": []
  }
}
```

**Example: Group by ad_placement, totals**

```json
{
  "data": [
    {
      "id": "bd8380d9-c2fc-40ac-a8d2-322c35ef9494",
      "type": "report",
      "attributes": {
        "ad_network_id": 900011,
        "app_id": "b9313013-ef8d-4ca1-80e9-0c3966f9d624",
        "ad_placement_id": "bd8380d9-c2fc-40ac-a8d2-322c35ef9494",
        "ad_revenue": 875.27,
        "ecpm": 0.8716891011723839,
        "app_name": "Alpha",
        "app_icon_url": "/default_app_icon.png",
        "bundle_id": "com.example.alpha",
        "store_id": "2000000001",
        "platform": "ios",
        "ad_network_name": "Network One",
        "ad_network_icon_url": "",
        "ad_network_short_id": "network_one",
        "ad_network_custom": false,
        "ad_placement_name": "Placement Alpha One"
      }
    },
    {
      "id": "508b4810-88d3-4a90-8723-b38e7d2cee61",
      "type": "report",
      "attributes": {
        "ad_network_id": 900012,
        "app_id": "b9313013-ef8d-4ca1-80e9-0c3966f9d624",
        "ad_placement_id": "508b4810-88d3-4a90-8723-b38e7d2cee61",
        "ad_revenue": 914.09,
        "ecpm": 0.9819949508513725,
        "app_name": "Alpha",
        "app_icon_url": "/default_app_icon.png",
        "bundle_id": "com.example.alpha",
        "store_id": "2000000001",
        "platform": "ios",
        "ad_network_name": "Network Two Account",
        "ad_network_icon_url": "",
        "ad_network_short_id": "network_two",
        "ad_network_custom": true,
        "ad_placement_name": "Placement Alpha Two"
      }
    }
  ],
  "links": {
    "self": "https://api.tenjin.com/v2/reports/ad_revenue?start_date=2026-08-25&end_date=2026-08-31&group_by=ad_placement&granularity=totals-daily&metrics=ad_revenue%2Cecpm"
  },
  "meta": {
    "count": 3,
    "per_page": 100,
    "start_date": "2026-08-25",
    "end_date": "2026-08-31",
    "granularity": "totals-daily",
    "metrics": [
      "ad_revenue",
      "ecpm"
    ],
    "organization_id": "75fe3cdd-3b96-4372-afe6-abaf376b7b44",
    "app_ids": [],
    "ad_network_ids": [],
    "group_by": [
      "ad_placement_id"
    ],
    "countries": [],
    "platforms": []
  }
}
```

### 400, 401, 403, 498

- `400` A param is missing or invalid, a record is not found, or the request cannot be served
- `401` Missing or invalid credentials, or no access to the requested data
- `403` Invalid token, or the user's role does not allow the request
- `498` Expired token, or a token with an invalid signature

**Content type:** `application/json`

schema: `Error`

- **`error` (required)**: `string`

  What went wrong

**Example:**

```json
{
  "error": ""
}
```

### 429 More than 100 report requests in a minute with one access token

**Headers:**

- **`X-Retry-After`**

  Length of the rate limit period, in seconds

  `integer`

**Content type:** `application/json`

*Schema `Error` is shown above.*

**Example:**

```json
{
  "error": ""
}
```

## Schemas

- `Error` — shown above.
- `AdRevenueReportDocument` — shown above.
- `Links` — shown above.
- `AdRevenueReportMeta` — shown above.
- `AdRevenueReportResource` — shown above.
