curl --request GET \
--url https://panel.metricanic.com/api/v1/reports \
--header 'Authorization: Bearer <token>'import requests
url = "https://panel.metricanic.com/api/v1/reports"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://panel.metricanic.com/api/v1/reports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://panel.metricanic.com/api/v1/reports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://panel.metricanic.com/api/v1/reports"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://panel.metricanic.com/api/v1/reports")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.metricanic.com/api/v1/reports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"meta": {
"limit": 100,
"offset": 0,
"totalRows": 1,
"timezone": "UTC",
"totals": {
"visits": 1520,
"conversions": 12,
"cost": 18.24,
"revenue": 54
}
},
"rows": [
{
"campaign": {
"id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"name": "Lead Search",
"displayName": "Lead Search",
"inputName": "Lead Search",
"country": "US",
"trafficSourceId": "6f9d2b4e-8a1c-4d3e-9f5a-7b2c4d6e8f0a",
"status": "active"
},
"visits": 1520,
"conversions": 12,
"cost": 18.24,
"revenue": 54
}
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}Query reports
Returns performance grouped by the requested dimensions and attributed to the original visit time. Defaults to day and campaign groups with visits, sorted by visits descending. Supports up to 12 dimensions and 40 metrics. Rows include requested metrics and metrics used in filters. Percentage metrics use ratios, so roi=0.2 means 20%. Undefined ratios are null.
Tag columns, filters and sorting require a single campaign equality filter and a base primaryDimension. The rotator dimension includes shared rotators and the unassigned group. Use offset for subsequent pages and keep the query unchanged. Use /api/v1/events for individual records.
curl --request GET \
--url https://panel.metricanic.com/api/v1/reports \
--header 'Authorization: Bearer <token>'import requests
url = "https://panel.metricanic.com/api/v1/reports"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://panel.metricanic.com/api/v1/reports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://panel.metricanic.com/api/v1/reports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://panel.metricanic.com/api/v1/reports"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://panel.metricanic.com/api/v1/reports")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.metricanic.com/api/v1/reports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"meta": {
"limit": 100,
"offset": 0,
"totalRows": 1,
"timezone": "UTC",
"totals": {
"visits": 1520,
"conversions": 12,
"cost": 18.24,
"revenue": 54
}
},
"rows": [
{
"campaign": {
"id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"name": "Lead Search",
"displayName": "Lead Search",
"inputName": "Lead Search",
"country": "US",
"trafficSourceId": "6f9d2b4e-8a1c-4d3e-9f5a-7b2c4d6e8f0a",
"status": "active"
},
"visits": 1520,
"conversions": 12,
"cost": 18.24,
"revenue": 54
}
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"requestId": "<string>"
}Authorizations
Workspace-scoped token sent in the Authorization header as Bearer . Access depends on the credential's allowed operations, read or write scope, and workspace subscription. Use an API key issued in the tracker for Public API v1. MCP uses separate OAuth credentials.
Query Parameters
IANA timezone with whole-hour UTC offsets, such as UTC or a timezone offered in the report interface. Defaults to the workspace timezone.
Encode each complete fieldvalue[|value2...] expression separately with encodeURIComponent, then join expressions with literal commas. Operators are =, !=, > and <. Up to 6 expressions and 1000 values per expression. Example: country%3DUS%7CCA,visits%3E100. Do not encode the separator commas. Percentage metric thresholds use ratios. Tag filters support only = and !=, with a tag state or none. Traffic filters use traffic::, where dimension is campaign or token1 through token15. Properties enabled, status and bidMode support = and !=. enabled accepts on, off, unknown, unlinked or mixed. Off includes rows with a paused parent (PAUSED or a status ending in _PAUSED). Budget limits alone do not make a row off. status accepts uppercase status codes, including ACTIVE, PAUSED, PARENT_PAUSED, PARENT_UNKNOWN, UNKNOWN, UNLINKED and MIXED, or PARENT:. bidMode accepts default, value, unknown, unlinked or mixed. The bid property accepts one nonnegative number with any supported operator and treats inherited bids as zero. Unknown bids are excluded from numeric comparisons. Numeric bids require a common currency and unit. Token groups require a single campaign filter or campaign in dimensions.
Comma-separated supported grouping IDs. Default day,campaign. At least one non-tag dimension is required.
1 - 12 elementsReport grouping dimension. isp identifies the estimated primary use of the visitor's network. isBot groups visits by detected bot or non-browser status as 0 or 1. verifiedBotCategory is the bot category and tlsVersion is the visit's TLS version. Unavailable values are null.
day, hour, month, dayOfWeek, tenant, campaign, traffic, rotator, rotatorPath, landing, offer, country, continent, region, city, timezone, language, ipType, asn, asnOrg, isp, connType, isBot, verifiedBotCategory, tlsVersion, deviceType, osFamily, browserName, affiliateNetwork, deviceBrand, deviceModel, osVersion, browserVersion, token1, token2, token3, token4, token5, token6, token7, token8, token9, token10, token11, token12, token13, token14, token15, tag Comma-separated metric IDs. Defaults to visits. Custom formulas are available in the tracker interface and are not accepted here.
40Built-in report metric. prefetchVisits counts visits identified as prefetch, including blocked visits and excluding browser prerender. suspicious counts visits flagged as suspicious. suspiciousPct is their share of all visits, returned as a ratio. A flagged visit does not confirm fraud.
visits, prefetchVisits, uniqueVisits, lpclicks, uniqueClicks, ctr, uctr, revenue, cost, profit, roi, profitMargin, epc, epv, epa, epuc, cpc, cpv, conversions, cv, cr, ucr, ucv, cpa, cpuc, ppuc, suspicious, suspiciousPct, event1, event2, event3, event4, event5, event6, event7, event8, event9, event10, revenue1, revenue2, revenue3, revenue4, revenue5, revenue6, revenue7, revenue8, revenue9, revenue10, cost1, cost2, cost3, cost4, cost5, cost6, cost7, cost8, cost9, cost10, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10 Active or archived status applies to the first status-capable grouping dimension: campaign, traffic, landing, offer, affiliateNetwork or rotator. Such a dimension is required for these modes. All or an omitted value includes both statuses.
all, active, archived Inclusive start as YYYY-MM-DD or local date-time, interpreted in timezone.
Inclusive end as YYYY-MM-DD or local date-time, interpreted in timezone. Date-only values include the complete final day.
Page size. Values outside 1 through 1000 fall back to 100.
1 <= x <= 1000Number of rows to skip. Negative or nonnumeric values fall back to zero.
x >= 0Set to 1 to include totals in data.meta.totals. Other values omit totals.
Set to 1 to include suspicious visit counts by category in each row and requested totals. A visit can appear in more than one category. Other values omit the details.
A report metric, tag, dimension key, or traffic::enabled, status or bid. Traffic sorting requires its dimension in the grouping. Token traffic sorting also requires a single campaign filter or campaign in the grouping. Numeric bids require a common currency and unit. Inherited bids sort as zero. Unknown values sort last in either direction. An ordinary dimension outside the grouping falls back to visits.
Only asc selects ascending order. All other values select descending order.
asc, desc Base dimension used for tags and totals labels. Defaults to the first grouping dimension. If supplied outside dimensions, it is also added to the grouping. Cannot be tag.
day, hour, month, dayOfWeek, tenant, campaign, traffic, rotator, rotatorPath, landing, offer, country, continent, region, city, timezone, language, ipType, asn, asnOrg, isp, connType, isBot, verifiedBotCategory, tlsVersion, deviceType, osFamily, browserName, affiliateNetwork, deviceBrand, deviceModel, osVersion, browserVersion, token1, token2, token3, token4, token5, token6, token7, token8, token9, token10, token11, token12, token13, token14, token15 Use 1, true or yes to include zero rows for a single hour, dayOfWeek, campaign, traffic, landing, offer, affiliateNetwork, rotator or rotatorPath dimension. Zero rows require no other dimension filters, no tag context and metric filters that admit zero values. With today grouped by hour, future hours are omitted.