Reporting API

Report Endpoint

GET /v1/report — dimensions, metrics, granularity, pagination and examples.

GET /v1/report is the single endpoint. Pick a date range + metrics, optionally break down by dimensions. Every row is { dimensions, metrics }.

Parameters

ParameterRequiredDescription
fromStart (inclusive), ISO 8601
toEnd (inclusive), ISO 8601. Range max 90 days
metricsComma-separated metric list
dimensionsComma-separated breakdown. Omit for a single total row
granularityhourly · daily · weekly · monthly — only with the date dimension
campaign_idRestrict to a single owned campaign
ad_idRestrict to a single owned ad
pagePage number (1-based)
limitRows per page (capped server-side)

Metrics

MetricDescription
viewsImpressions
spendingSpend
clicksClicks (valid / bot-filtered)
conversionsConversions

Dimensions

DimensionDescription
dateTime bucket — hourly/daily/weekly/monthly via granularity
campaignCampaign breakdown (campaign_id + name)
adAd breakdown (ad_id + name)
keywordKeyword breakdown (name)

Rules:

  • No dimensions → a single grand-total row.
  • One entity dimension (campaign | ad | keyword) may be combined with dateexcept keyword (totals only).
  • keyword supports only views, spending, clicks (no conversions).
  • date is a unix epoch second (UTC, bucket start).

Examples

Campaign × day breakdown

curl -s 'https://reporting.magfiads.com/v1/report?from=2026-06-01T00:00:00Z&to=2026-06-30T23:59:59Z&metrics=views,spending,clicks&dimensions=campaign,date&granularity=daily' \
  -H 'Authorization: Bearer <API_KEY>'
{
  "meta": {
    "granularity": "daily",
    "dimensions": ["campaign", "date"],
    "metrics": ["views", "spending", "clicks"],
    "total": 240,
    "page": 1,
    "limit": 500,
    "has_more": false
  },
  "data": [
    {
      "dimensions": { "date": 1780617600, "campaign_id": 10, "name": "Summer Launch" },
      "metrics": { "views": 52100, "spending": 3421.1, "clicks": 88 }
    }
  ]
}

Keyword totals

curl -s 'https://reporting.magfiads.com/v1/report?from=2026-06-01T00:00:00Z&to=2026-06-30T23:59:59Z&metrics=views,clicks&dimensions=keyword' \
  -H 'Authorization: Bearer <API_KEY>'
{
  "meta": { "granularity": null, "dimensions": ["keyword"], "metrics": ["views", "clicks"], "total": 12, "page": 1, "limit": 500, "has_more": false },
  "data": [
    { "dimensions": { "name": "Spor" }, "metrics": { "views": 88010, "clicks": 1203 } }
  ]
}

Pagination

meta.total is the total row count. If meta.has_more is true, increment page to fetch the next page:

...&page=2&limit=500

Date conversion

date is a unix epoch second (UTC). Example:

new Date(1780617600 * 1000).toISOString(); // "2026-06-01T00:00:00.000Z"

Full schema → API reference.

On this page