API
Reports API
The same numbers as the dashboard's Reports screen, its CSV and its PDF: verified views, valid results and the money really charged. Never per-viewer data.
| Report | Request | Key |
|---|---|---|
| Advertiser campaigns | GET /reports/campaigns | Advertiser |
| Publisher earnings | GET /reports/earnings | Publisher |
| Placements | GET /reports/placements | Publisher |
| Agency clients | GET /reports/agency/clients | Advertising agency |
| Agency partners | GET /reports/agency/partners | Coming soon |
All need the read scope; base https://api.halaladz.com/api/v1.
Common parameters
| Parameter | Meaning |
|---|---|
from, to | YYYY-MM-DD; default the last 7 days; at most 92 days per request (more → 400 range_too_long) |
format | json (default) or csv — the same rows, one header line |
limit, cursor | Pages: pass the answer's nextCursor as cursor in the next request, until it is null |
# the next page: pass nextCursor back as cursor, until nextCursor is null
curl "https://api.halaladz.com/api/v1/reports/campaigns?from=2026-12-01&to=2026-12-05&limit=20&cursor=123" \
-H "Authorization: Bearer $HALALADZ_KEY"curl "https://api.halaladz.com/api/v1/reports/campaigns?from=2026-12-01&to=2026-12-05&format=csv" \
-H "Authorization: Bearer $HALALADZ_KEY" -o campaigns.csv
# day,campaign_id,campaign_name,goal,impressions,views,clicks,conversions,results,spend_bdt_microsAdvertisers: campaigns
GET /reports/campaigns
Each campaign's numbers per day: impressions, verified views, clicks, conversions (click-attributed), results by goal and spend (micros, BDT). A page holds every day of up to limit (1–50, default 20) campaigns, newest campaign first; campaignId gives just one. Days follow the account's time zone (timezone).
curl "https://api.halaladz.com/api/v1/reports/campaigns?from=2026-12-01&to=2026-12-05" \
-H "Authorization: Bearer $HALALADZ_KEY"// Node.js 18+ (fetch is built in). Keep the key on your server, never in a web page or app.
const res = await fetch("https://api.halaladz.com/api/v1/reports/campaigns?from=2026-12-01&to=2026-12-05", {
headers: { Authorization: `Bearer ${process.env.HALALADZ_KEY}` },
});
const report = await res.json();
if (!res.ok) throw new Error(`${res.status} ${report.error}: ${report.message}`);
console.log(report.totals);<?php
$query = http_build_query(['from' => '2026-12-01', 'to' => '2026-12-05']);
$ch = curl_init('https://api.halaladz.com/api/v1/reports/campaigns?' . $query);
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('HALALADZ_KEY')],
CURLOPT_RETURNTRANSFER => true,
]);
$report = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status !== 200) { throw new Exception($report['error'] . ': ' . $report['message']); }
print_r($report['totals']);import os
import requests
r = requests.get(
"https://api.halaladz.com/api/v1/reports/campaigns",
params={"from": "2026-12-01", "to": "2026-12-05"},
headers={"Authorization": f"Bearer {os.environ['HALALADZ_KEY']}"},
timeout=30,
)
r.raise_for_status()
print(r.json()["totals"]){
"from": "2026-12-01", "to": "2026-12-05", "timezone": "Asia/Dhaka", "currency": "BDT",
"rows": [
{ "day": "2026-12-01", "campaignId": 123, "campaignName": "Eid dates offer", "goal": "orders",
"impressions": "1520", "views": "1240", "clicks": "38", "conversions": "4", "results": "4",
"spendMicros": "228000000" }
],
"totals": { "impressions": "1520", "views": "1240", "clicks": "38", "conversions": "4", "results": "4", "spendMicros": "228000000" },
"nextCursor": null
}Publishers: earnings
GET /reports/earnings
Earnings per day and ad place: property, placement, format, impressions, views, clicks and earnings per currency; status = pending (still held) or available (can be withdrawn). Filters: propertyId, placementId. Money is listed per currency, never summed across currencies.
curl "https://api.halaladz.com/api/v1/reports/earnings?from=2026-12-01&to=2026-12-05" \
-H "Authorization: Bearer $HALALADZ_KEY"const res = await fetch("https://api.halaladz.com/api/v1/reports/earnings?from=2026-12-01&to=2026-12-05", {
headers: { Authorization: `Bearer ${process.env.HALALADZ_KEY}` },
});
const earnings = await res.json();
for (const row of earnings.rows) console.log(row);<?php
$ch = curl_init('https://api.halaladz.com/api/v1/reports/earnings?from=2026-12-01&to=2026-12-05');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('HALALADZ_KEY')],
CURLOPT_RETURNTRANSFER => true,
]);
$earnings = json_decode(curl_exec($ch), true);
curl_close($ch);
foreach ($earnings['rows'] as $row) { print_r($row); }import os
import requests
r = requests.get(
"https://api.halaladz.com/api/v1/reports/earnings",
params={"from": "2026-12-01", "to": "2026-12-05"},
headers={"Authorization": f"Bearer {os.environ['HALALADZ_KEY']}"},
timeout=30,
)
r.raise_for_status()
for row in r.json()["rows"]:
print(row){
"from": "2026-12-01", "to": "2026-12-05", "timezone": "Asia/Dhaka",
"rows": [
{ "day": "2026-12-01", "propertyId": 77, "propertyName": "Dhaka Tech Blog", "propertyKind": "website",
"placementId": 310, "placementName": "Under the article", "format": "banner_300x250",
"impressions": "4100", "views": "3320", "clicks": "21",
"earnings": [{ "currency": "BDT", "micros": "96500000" }], "status": "available" }
],
"totals": { "impressions": "4100", "views": "3320", "clicks": "21",
"earnings": [{ "currency": "BDT", "pendingMicros": "0", "availableMicros": "96500000" }] },
"nextCursor": null
}Publishers: placements
GET /reports/placements
Your ad places, newest first (limit 1–200, default 100): id, name, format, status, created, and its property. Properties and placements.
Agencies: clients
GET /reports/agency/clients
An advertising agency's client accounts with their totals for the range. Agencies page.
More read requests
The first-version requests still work: GET /campaigns, GET /campaigns/{id}, GET /reports (by day, platform or country), GET /earnings and GET /payouts (payout requests).
curl "https://api.halaladz.com/api/v1/campaigns?status=active&limit=20" \
-H "Authorization: Bearer $HALALADZ_KEY"const res = await fetch("https://api.halaladz.com/api/v1/campaigns?status=active&limit=20", {
headers: { Authorization: `Bearer ${process.env.HALALADZ_KEY}` },
});
const { items, nextCursor } = await res.json();<?php
$ch = curl_init('https://api.halaladz.com/api/v1/campaigns?status=active&limit=20');
curl_setopt_array($ch, [CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('HALALADZ_KEY')], CURLOPT_RETURNTRANSFER => true]);
$page = json_decode(curl_exec($ch), true);
// $page['items'], $page['nextCursor']import os
import requests
r = requests.get(
"https://api.halaladz.com/api/v1/campaigns",
params={"status": "active", "limit": 20},
headers={"Authorization": f"Bearer {os.environ['HALALADZ_KEY']}"},
timeout=30,
)
page = r.json() # page["items"], page["nextCursor"]Every request in full: API reference.