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>"
}Query advertising metrics
Returns normalized advertising and attribution rows for the selected store and date range.
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
A server-side Bily API key created under Settings > MCP > Access key fallback. Select the intended store before creating it.
Headers
An organization ID returned by GET /context or GET /organizations. Required for GET /stores and optional for store-scoped paths.
"org_01J8W7T9G3E6ZQ4M2K5N8P1R0S"
Path Parameters
The exact store URL returned by GET /context or GET /stores.
"store.example.com"
Query Parameters
First date to include, in YYYY-MM-DD format.
Last date to include, in YYYY-MM-DD format.
Normalized channel or cross-channel.
Attribution model.
Attribution window.
Time grain.
day, hour Comma-separated country codes.
Comma-separated device types.
Comma-separated operating systems.
Comma-separated browser names.
Comma-separated product IDs.
Dimension attribution context.
conversion, first_touch Response
Request completed successfully.