---
title: Reporting API
slug: reporting-api
icon: {"apiMethod":"GET"}
docTags: 
createdAt: 2024-05-31T20:40:59.128Z
---

:::hint{type="info"}
**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.](docId:1p8gELWd4VQzaQy9cFKn6)
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&#x20;

Try our Reporting API live now and experience the response in real time! Test it below to see how it works and explore the data it returns.

:::Iframe{iframeHeight="0" code="<iframe src=&#x22;https://hopp.sh/e/5aoQyPSfbj6e&#x22; title=&#x22;Hoppscotch Embed&#x22; style=&#x22;width: 100%; height: 480px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.1);&#x22;></iframe><!-- <p>paste iframe code here</p> -->"}

:::

# Fetching Performance Reports

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

## Header Parameters

| **Parameter**                                                 | **Description**              | **Type** | **Example**        |
| ------------------------------------------------------------- | ---------------------------- | -------- | ------------------ |
| **Content-Type**<br /><font color="#eb144c">*required*</font> | Should be `application/json` | *string* | `application/json` |

## Query Parameters

| **Parameter**                                             | **Description**                                                                                                                                                                                                                                                                                      | **Type** | **Example**                            |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------- |
| **api\_key**<br /><font color="#eb144c">*required*</font> | Your API Key. [Obtain your API Key.](docId:1p8gELWd4VQzaQy9cFKn6)﻿<br />**Required Permission:&#x20;**&#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:&#x20;**&#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                                   |
| **\<string>**<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                         |

:::hint{type="info"}
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

:::hint{type="warning"}
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&#x20;**&#x6F;bject of&#x20;*&#x61;ctivity data

Contains the activity array and response status

:::ExpandableHeading
***activity  &#x20;***&#x41;n array of objects representing the activity data for each session. It has the following attributes:

***

**clicks&#x20;***integer*&#x20;

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 &#x20;***double*

The revenue generated through customer engagement with MomentScience Offers.&#x20;

***

**impressions&#x20;***integer*

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

***

**rpm&#x20;***double*

RPM measures the revenue earned for every 1000 impressions generated by MomentScience. The formula to calculate RPM is: (Revenue / Impressions) x 1000.

***

&#x20;**ctr** *double*

CTR is a measure of how often people click on an Offer after seeing it. It's calculated as a percentage by dividing the number of clicks by the number of impressions.

***

**date &#x20;***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

:::CodeblockTabs
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](#)&#x20;
