Marketing API
Access marketing performance metrics including MER, CAC, and ROAS.
Get Marketing Metrics
Returns marketing efficiency metrics for the specified period.
GET /api/v1/marketing/metricsParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
period | string | No | Time period (default: last_30_days) |
Example Request
bash
curl -H "Authorization: Bearer ned_live_YOUR_KEY" \
"https://api.meetned.com/api/v1/marketing/metrics?period=last_30_days"Example Response
json
{
"data": {
"metrics": {
"mer": 4.2,
"cac": 28.50,
"roas": 3.8,
"total_ad_spend": 8500.00,
"total_revenue": 35700.00,
"attributed_revenue": 32300.00,
"new_customers_acquired": 298
},
"by_channel": [
{
"channel": "meta",
"spend": 5200.00,
"revenue": 19800.00,
"roas": 3.81,
"conversions": 165
},
{
"channel": "google",
"spend": 3300.00,
"revenue": 12500.00,
"roas": 3.79,
"conversions": 133
}
],
"comparison": {
"mer_change": 0.3,
"cac_change": -2.10,
"roas_change": 0.15
}
},
"meta": {
"period": "last_30_days",
"generated_at": "2025-02-04T12:00:00Z"
}
}Get Ad Performance
Returns detailed ad-level performance data.
GET /api/v1/marketing/adsParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
period | string | No | Time period (default: last_30_days) |
channel | string | No | Filter by channel: meta, google, all (default: all) |
limit | number | No | Results per page (default: 50, max: 100) |
offset | number | No | Results to skip (default: 0) |
sort | string | No | Sort by: spend, roas, revenue (default: spend) |
Example Request
bash
curl -H "Authorization: Bearer ned_live_YOUR_KEY" \
"https://api.meetned.com/api/v1/marketing/ads?period=last_7_days&channel=meta&limit=10"Example Response
json
{
"data": {
"ads": [
{
"ad_id": "ad_123456",
"campaign_name": "Summer Sale 2025",
"ad_set_name": "Lookalike - Purchasers",
"ad_name": "Product Showcase - Video",
"channel": "meta",
"spend": 450.00,
"impressions": 28500,
"clicks": 420,
"ctr": 1.47,
"conversions": 18,
"revenue": 1890.00,
"roas": 4.2,
"cpa": 25.00
},
{
"ad_id": "ad_123457",
"campaign_name": "Summer Sale 2025",
"ad_set_name": "Interest - Home Decor",
"ad_name": "Carousel - Best Sellers",
"channel": "meta",
"spend": 380.00,
"impressions": 32100,
"clicks": 385,
"ctr": 1.20,
"conversions": 12,
"revenue": 1340.00,
"roas": 3.53,
"cpa": 31.67
}
],
"pagination": {
"total": 45,
"limit": 10,
"offset": 0,
"has_more": true
}
},
"meta": {
"period": "last_7_days",
"channel": "meta",
"generated_at": "2025-02-04T12:00:00Z"
}
}Metric Definitions
| Metric | Definition |
|---|---|
| MER | Marketing Efficiency Ratio = Total Revenue / Total Ad Spend |
| CAC | Customer Acquisition Cost = Total Ad Spend / New Customers |
| ROAS | Return on Ad Spend = Attributed Revenue / Ad Spend |
| CTR | Click-Through Rate = (Clicks / Impressions) × 100 |
| CPA | Cost Per Acquisition = Ad Spend / Conversions |
Channel Support
Marketing data is aggregated from connected platforms:
| Channel | Platform | Requirements |
|---|---|---|
meta | Facebook/Instagram Ads | Meta Ads account connected |
google | Google Ads | Google Ads account connected |
Connect ad platforms in Settings → Integrations in your Ned dashboard.