{"openapi":"3.1.0","info":{"title":"Marketing Metrics API","version":"1.0.0","description":"Digital-marketing metrics maths as an API, computed locally and deterministically. The ads endpoint computes campaign KPIs from any two of the spend, impressions, clicks and conversions: the CPM (cost per thousand impressions), the CPC (cost per click), the CTR (click-through rate), the conversion rate and the CPA (cost per acquisition). The roas endpoint computes the return on ad spend, ROAS = revenue ÷ spend, the ROI percentage and the gross profit, and — given a gross margin — the break-even ROAS of 1 ÷ margin. The ltv endpoint computes the customer lifetime value, average order value × purchase frequency × lifespan × gross margin, and, with the marketing spend and number of new customers, the customer acquisition cost, the all-important LTV:CAC ratio and the CAC payback period in months. Everything is computed locally and deterministically, so it is instant and private. Ideal for marketing, advertising, e-commerce and growth app developers, campaign dashboards and reporting tools, and agency calculators. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is marketing-metrics maths; for percentage maths use a percentage API and for currency conversion use a currency API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/marketing-api","description":"oanor gateway"}],"tags":[{"name":"Marketing"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/ads":{"get":{"operationId":"get_v1_ads","tags":["Marketing"],"summary":"Campaign metrics","description":"","parameters":[{"name":"spend","in":"query","required":false,"description":"Ad spend","schema":{"type":"string"},"example":"1000"},{"name":"impressions","in":"query","required":false,"description":"Impressions","schema":{"type":"string"},"example":"100000"},{"name":"clicks","in":"query","required":false,"description":"Clicks","schema":{"type":"string"},"example":"2000"},{"name":"conversions","in":"query","required":false,"description":"Conversions","schema":{"type":"string"},"example":"100"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"cpa":10,"cpc":0.5,"cpm":10,"note":"CPM = spend/impressions·1000, CPC = spend/clicks, CTR = clicks/impressions, conversion = conversions/clicks, CPA = spend/conversions.","inputs":{"spend":1000,"clicks":2000,"conversions":100,"impressions":100000},"ctr_percent":2,"conversion_rate_percent":5},"meta":{"timestamp":"2026-06-04T18:38:15.311Z","request_id":"5e858240-e06d-4d86-9880-16ff632451b7"},"status":"ok","message":"Campaign metrics","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/ltv":{"get":{"operationId":"get_v1_ltv","tags":["Marketing"],"summary":"LTV & CAC","description":"","parameters":[{"name":"average_order_value","in":"query","required":true,"description":"Average order value","schema":{"type":"string"},"example":"50"},{"name":"purchase_frequency","in":"query","required":true,"description":"Purchases per year","schema":{"type":"string"},"example":"4"},{"name":"lifespan_years","in":"query","required":true,"description":"Customer lifespan (years)","schema":{"type":"string"},"example":"3"},{"name":"gross_margin","in":"query","required":false,"description":"Gross margin fraction (default 1)","schema":{"type":"string"},"example":"0.6"},{"name":"marketing_spend","in":"query","required":false,"description":"Marketing spend for CAC","schema":{"type":"string"},"example":"5000"},{"name":"new_customers","in":"query","required":false,"description":"New customers acquired","schema":{"type":"string"},"example":"100"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"cac":50,"note":"LTV = AOV × frequency × lifespan × margin. A healthy LTV:CAC ratio is around 3 or higher.","inputs":{"gross_margin":0.6,"lifespan_years":3,"purchase_frequency":4,"average_order_value":50},"annual_value":120,"ltv_cac_ratio":7.2,"cac_payback_months":5,"customer_lifetime_value":360},"meta":{"timestamp":"2026-06-04T18:38:15.404Z","request_id":"15b84371-f9ae-4f1d-a475-beeeab3ceee7"},"status":"ok","message":"LTV & CAC","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/roas":{"get":{"operationId":"get_v1_roas","tags":["Marketing"],"summary":"ROAS / ROI","description":"","parameters":[{"name":"revenue","in":"query","required":true,"description":"Revenue from ads","schema":{"type":"string"},"example":"5000"},{"name":"spend","in":"query","required":true,"description":"Ad spend","schema":{"type":"string"},"example":"1000"},{"name":"gross_margin","in":"query","required":false,"description":"Gross margin fraction (0–1, default 1)","schema":{"type":"string"},"example":"0.5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"ROAS = revenue/spend. ROI% = (revenue − spend)/spend. With a gross margin, the campaign breaks even at ROAS = 1/margin.","roas":5,"inputs":{"spend":1000,"revenue":5000,"gross_margin":0.5},"roi_percent":400,"gross_profit":1500,"break_even_roas":2},"meta":{"timestamp":"2026-06-04T18:38:15.489Z","request_id":"6927e309-d02c-448a-b925-eb8c9f3653d0"},"status":"ok","message":"ROAS / ROI","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notes":"Money in any currency, rates as percentages. Frequency is purchases per year; gross margin is a fraction (0–1). Marketing estimates, not guarantees.","service":"marketing-api","formulae":{"cpm":"spend/impressions × 1000","ctr":"clicks/impressions × 100","ltv":"AOV × frequency × lifespan × margin","roas":"revenue/spend"},"endpoints":{"GET /v1/ads":"Campaign metrics from any two of spend, impressions, clicks and conversions.","GET /v1/ltv":"Customer lifetime value, CAC and the LTV:CAC ratio with payback period.","GET /v1/meta":"This document.","GET /v1/roas":"Return on ad spend, ROI and break-even ROAS."},"description":"Digital-marketing metrics calculator: ad-campaign KPIs (CPM, CPC, CTR, conversion, CPA), ROAS/ROI, and customer LTV with the LTV:CAC ratio."},"meta":{"timestamp":"2026-06-04T18:38:15.569Z","request_id":"7b65bc12-3aa2-4b29-acce-618a78932102"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":2000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1400,"monthly_call_quota":30000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3900,"monthly_call_quota":200000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":11900,"monthly_call_quota":1524000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/marketing-api"}