---
title: "Reporting API"
description: "This API gives partners the power to access 24-hour detailed insights into their accounts in a way that's easy to use and understand. Here's how it helps:"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.momentscience.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reporting API

> **Note**
>
> **Who is this for:** Partners and developers who need programmatic access to performance data for custom dashboards or automated reporting pipelines.
>
> **Outcome:** Retrieve 24-hour performance reports-including revenue, impressions, clicks, and CTR-with flexible daily or hourly segmentation and optional payload filters.

# Overview

This API gives partners the power to access 24-hour detailed insights into their accounts in a way that's easy to use and understand. Here's how it helps:

1. **Retrieve performance reports:** Access performance reports that include key metrics such as revenue, impressions, clicks, and click-through rate (CTR) for a specified date.
2. **Customize data segmentation**: Choose between daily or hourly segmentation options to analyze activity based on specific time intervals.
3. **Apply filters:** Use optional parameters to filter data based on properties passed in the payload when a MomentScience experience was served. This enables publishers to focus on specific segments of their activity data.

# Quickstart

1. [Obtain your API Key.](https://docs.momentscience.com/get-started/api-key)
2. Make a Fetch Reporting API call to MomentScience to retrieve statistics related to your account.
3. Parse the response and display statistics in the desired fashion.

## Try It Out 

Send a live request and see the response. Paste an API key with the Reports permission into api\_key in the console below and click Try it. The result shows in the Responses panel on the right.

### Fetch Activity Report

`https://api.adspostx.com/native/activity.json`

Returns clicks, revenue, impressions (Views in the dashboard), RPM and CTR for your account. Paste an API key with the Reports permission into api_key, set from and aggregated_by if you like, then click Try it.

#### Query Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `api_key` | `string` | Yes | Your API Key. Required Permission: Reports |
| `from` | `string` | No | Specify the date (YYYY-MM-DD format) for which you want to retrieve reports. It will retrieve data for only 24 hours starting from the specified date's beginning.Default: Yesterday's Date (beginning of the day) |
| `aggregated_by` | `string` | No | Choose between 'day' or 'hour' to segment activity on a daily or hourly basis. Default: 'day'. |

#### Header Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `Content-Type` | `string` | Yes | Should be application/json |

#### Request Examples

### cURL

```bash
curl --request GET \
  --url 'https://api.adspostx.com/native/activity.json?api_key=YOUR_API_KEY&from=2024-03-20&aggregated_by=hour' \
  --header 'Content-Type: application/json'
```

#### Sample Responses

### HTTP 200

```json
{
  "data": {
    "activity": [
       {
        "clicks": 1,
        "revenue": 0.02,
        "date": "2024-03-20T00:00:00+05:30",
        "impressions": 56,
        "rpm": 0.36,
        "ctr": 1.79
      }
    ]
  },
  "status": "success"
}
```

# Fetching Performance Reports

**HTTP Method:**  GET
**Base URL:** https\://api.adspostx.com/native/activity.json

## Header Parameters

| **Parameter**                                                 | **Description**              | **Type** | **Example**        |
| ------------------------------------------------------------- | ---------------------------- | -------- | ------------------ |
| **Content-Type**<br />*required* | Should be `application/json` | *string* | `application/json` |

## Query Parameters

| **Parameter**                                             | **Description**                                                                                                                                                                                                                                                                                      | **Type** | **Example**                            |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------- |
| **api\_key**<br />*required* | Your API Key. [Obtain your API Key.](https://docs.momentscience.com/get-started/api-key)﻿<br />**Required Permission: **&#x52;eports                                                                                                                                                           | String   | `4bbdefc2-b130-424d-8170-54bdcb98e64e` |
| **from**<br />*Optional*                                  | Specify the date (YYYY-MM-DD format) for which you want to retrieve reports. <br />- It will retrieve data for only 24 hours starting from the specified date's beginning.<br />**Default: **&#x59;esterday's Date (beginning of the day)                                                       | String   | 2024-03-20                             |
| **aggregated\_by**<br />*Optional*                        | Choose between '**day**' or '**hour**' to segment activity on a daily or hourly basis.<br />**Default:** '**day**'.                                                                                                                                                                                  | String   | hour                                   |
| **&lt;string&gt;**<br />*Optional*                             | Filters data based on specific properties passed in the payload during a MomentScience experience. For example, filtering by "companyId" with a value of "123" and "state" with a value of "approved" retrieves activities for sessions with companyId equal to "123" and state equal to "approved". | String   | state=approved                         |

> **Note**
>
> The `from` parameter in the query parameters is based on the publisher's timezone. It's important to ensure that these dates align with your local timezone settings to ensure accurate reporting data.

## Request Example

```javascript
curl --request GET \
  --url 'https://api.adspostx.com/native/activity.json?api_key=YOUR_API_KEY&from=2024-03-20&aggregated_by=hour' \
  --header 'Content-Type: application/json'
```

## Response Body

> **Caution**
>
> When the "from" parameter is not specified, the API automatically retrieves data starting from the beginning of yesterday (in the publisher's timezone) until the current time today (also in the publisher's timezone). This timeframe is limited to 24 hours

### Response Parameters

Upon making an API call, the following attributes are returned.

***data **&#x6F;bject of *&#x61;ctivity data

Contains the activity array and response status

\*\*\*activity   \*\*\*An array of objects representing the activity data for each session. It has the following attributes:

---

\*\*clicks \*\**integer*

This simply counts how many times customers interact with an Offer. This could be by clicking on a button, image, or even directly accessing an Offer link in their browser.

---

\*\*revenue  \*\**double*

The revenue generated through customer engagement with MomentScience Offers.

---

\*\*impressions \*\**integer*

Counts the number of times the MomentScience Offer Unit was loaded. This corresponds to Views in the Partner Dashboard.

---

\*\*rpm \*\**double*

Revenue earned per 1,000 unit loads. Formula: (revenue / impressions) x 1000, where impressions is the field above that matches Views in the Partner Dashboard.

---

**ctr** *double*

Click-through rate as a percentage: clicks divided by offer level impressions (shown as Impressions in the Partner Dashboard), times 100. It is not based on the impressions field above.

---

\*\*date  \*\**date*

This field indicates the date and time when the Offer session started, presented in the format: "YYYY-MM-DDTHH:MM:SS+HH:MM".

- **For daily granularity:** the date would represent the start of a day, such as "2024-03-20T00:00:00+05:30". In this case, it shows the date with no specific time, indicating the entire day's offer session.
- **For hourly granularity:** the date would include the specific hour and minute when the offer session began, such as "2024-03-20T15:30:00+05:30". Here, the date includes both the date and the exact time when the offer session started.

### Sample Response

### Daily Granularity

```javascript
{
  "data": {
    "activity": [
       {
        "clicks": 1,
        "revenue": 0.02,
        "date": "2024-03-20T00:00:00+05:30",
        "impressions": 56,
        "rpm": 0.36,
        "ctr": 1.79
      }
    ]
  },
  "status": "success"
}
```

### Hourly Granularity

```javascript
{
  "data": {
    "activity": [
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T00:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T01:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T02:00:00+05:30",
        "impressions": 2,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T03:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T04:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T05:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T06:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T07:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T08:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T09:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T10:00:00+05:30",
        "impressions": 5,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T11:00:00+05:30",
        "impressions": 23,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T12:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T13:00:00+05:30",
        "impressions": 1,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T14:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T15:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T16:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T17:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T18:00:00+05:30",
        "impressions": 4,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T19:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T20:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T21:00:00+05:30",
        "impressions": 0,
        "rpm": 0,
        "ctr": 0
      },
      {
        "clicks": 1,
        "revenue": 0.02,
        "date": "2024-03-20T22:00:00+05:30",
        "impressions": 19,
        "rpm": 1.05,
        "ctr": 5.26
      },
      {
        "clicks": 0,
        "revenue": 0,
        "date": "2024-03-20T23:00:00+05:30",
        "impressions": 2,
        "rpm": 0,
        "ctr": 0
      }
    ]
  },
  "status": "success"
}
```

***

📢 If you're running into any issues while going through the integration process, feel free to contact us at [help@momentscience.com](mailto:help@momentscience.com)

Source: https://docs.momentscience.com/api-resources/reporting-api/index.mdx
