Skip to main content
GET
/
ad-metrics
/
{storeUrl}
Query advertising metrics
curl --request GET \
  --url https://app.bily.ai/api/customer/v1/ad-metrics/{storeUrl} \
  --header 'x-api-key: <api-key>'
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://app.bily.ai/api/customer/v1/ad-metrics/{storeUrl}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://app.bily.ai/api/customer/v1/ad-metrics/{storeUrl}"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
[
  {
    "shop": "<string>",
    "date": "2023-12-25",
    "time": "<string>",
    "channel": "<string>",
    "ad_id": "<string>",
    "p_spend": 123,
    "conversions": 123,
    "conv_value": 123,
    "id": "<string>",
    "model": "<string>",
    "window": "<string>",
    "adset_id": "<string>",
    "campaign_id": "<string>",
    "ad_name": "<string>",
    "adset_name": "<string>",
    "campaign_name": "<string>",
    "ad_status": "<string>",
    "adset_status": "<string>",
    "campaign_status": "<string>",
    "p_clicks": 123,
    "p_impressions": 123,
    "p_reach": 123,
    "customers": 123,
    "sessions": 123,
    "pageviews": 123,
    "p_currency": "<string>",
    "fp_currency": "<string>",
    "asset_found": true
  }
]
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}

Authorizations

x-api-key
string
header
required

A server-side Bily API key created under Settings > MCP > Access key fallback. Select the intended store before creating it.

Headers

x-bily-organization-id
string

An organization ID returned by GET /context or GET /organizations. Required for GET /stores and optional for store-scoped paths.

Example:

"org_01J8W7T9G3E6ZQ4M2K5N8P1R0S"

Path Parameters

storeUrl
string
required

The exact store URL returned by GET /context or GET /stores.

Example:

"store.example.com"

Query Parameters

startDate
string<date>
required

First date to include, in YYYY-MM-DD format.

endDate
string<date>
required

Last date to include, in YYYY-MM-DD format.

channel
string
default:cross-channel

Normalized channel or cross-channel.

model
string
default:last_click

Attribution model.

window
string
default:lifetime

Attribution window.

granularity
enum<string>
default:day

Time grain.

Available options:
day,
hour
filterCountry
string

Comma-separated country codes.

filterDeviceType
string

Comma-separated device types.

filterOS
string

Comma-separated operating systems.

filterBrowser
string

Comma-separated browser names.

filterProductId
string

Comma-separated product IDs.

dimension_source
enum<string>

Dimension attribution context.

Available options:
conversion,
first_touch

Response

Request completed successfully.

shop
string
required
date
string<date>
required
time
string
required
channel
string
required
ad_id
string
required
p_spend
number
required
conversions
number
required
conv_value
number
required
id
string
model
string
window
string
adset_id
string
campaign_id
string
ad_name
string
adset_name
string
campaign_name
string
ad_status
string
adset_status
string
campaign_status
string
p_clicks
number
p_impressions
number
p_reach
number
customers
number
sessions
number
pageviews
number
p_currency
string | null
fp_currency
string | null
asset_found
boolean