# Reporting API

Insight reporting API offers a set of RESTful endpoints to allow users to see how their site is performing in terms of revenues and analytics. The API is built upon the Insight reporting backend in order to get the same data as you can see on the reporting dashboards in Insight.

This guide offers you a description of the API operations, related request and response structures, and error codes.

Endpoint security

The reporting API requires authenticated access through Insight. Read more about Insight APIs security.

# Operations

# Get tenant reports

Returns the list of reports for the requested tenant.

GET /hub/insight/api/reporting/uris/{uri}/

Response:

{
    dateRange: DateRange,
    total: int,
    reports : [
        {
            uri: string (optional),
            platform: string (optional),
            globalMetrics: {
                arpu: float,
                pageViewsPerVisits: float,
                adRequestsPerPageViews: float,
                adRequestsPerVisits: float
            },
            engagementMetrics: {
                visits: long,
                pageViews: long,
                avgSessionTime: float
            },
            advertisementMetrics: {
                revenue: float,
                cpm: float,
                ctr: float,
                cpc: float,
                ecpm: float,
                fillRate: float,
                requests: long
            }
        }
    ]
}

# Get all reports

Returns the list of reports for all the tenants you have access to.

GET /hub/insight/api/reporting/uris

Response:

{
    dateRange: DateRange,
    total: int,
    reports : [
        {
            uri: string (optional),
            platform: string (optional),
            globalMetrics: {
                arpu: float,
                pageViewsPerVisits: float,
                adRequestsPerPageViews: float,
                adRequestsPerVisits: float
            },
            engagementMetrics: {
                visits: long,
                pageViews: long,
                avgSessionTime: float
            },
            advertisementMetrics: {
                revenue: float,
                cpm: float,
                ctr: float,
                cpc: float,
                ecpm: float,
                fillRate: float,
                requests: long
            }
        }
    ]
}

# URI Request Parameters

fromDate

Sets the start of the date range you want to query reports from. It requires setting the toDate parameter.

fromDate=2020-12-30

toDate

Sets the end of the date range you want to query reports from. It requires setting the fromDate parameter.

toDate=2020-12-30

date

An alternative to the fromDate/toDate pair. You can set relative periods (1d, 2m, 3y)

date=1d (yesterday)

primary

Sets the primary dimension. This parameter sets how data is grouped. By default, this parameter is set to uri.

Values: uri, date, platform

primary=date

secondary

Sets the secondary dimension. This parameter sets how data is grouped. By default, this parameter is not set.

Values: uri, date, platform

secondary=date

# Response Codes

  • 200: OK
  • 404: No reports were found or tenant does not exist
  • 406: User does not have access to the API

# Examples

Get all reports between 2020-06-01 and 2020-06-10 for andro4all.com

https://insight.marfeel.com/hub/insight/api/reporting/uris/andro4all.com/?fromDate=2020-06-01&toDate=2020-06-10

Get all reports for the last two days for andro4all.com, grouped by date and platform

https://insight.marfeel.com/hub/insight/api/reporting/uris/andro4all.com/?date=2d&primary=date&secondary=platform

Get all reports between 2020-06-01 and 2020-06-10 grouped by URI

https://insight.marfeel.com/hub/insight/api/reporting/uris?fromDate=2020-06-01&toDate=2020-06-10