This API reads the ads report data (read-only). Base URL: https://calista-ads-report.calista-thai-message.workers.dev
GET /api/report — fetch / download the report (JSON, CSV), no key neededGET /api/health — service and database health checkReturns data for a date range. All dates follow the Google Ads account time zone (Thai time, GMT+7); currency is THB. Responses are not cached and CORS is open for browser use.
| Name | Description |
|---|---|
type | Dataset (see table below). Default: all for JSON, daily for CSV |
format | json (default) or csv |
days | Last 1, 7, 14 or 30 days (default 7) |
from, to | Date range YYYY-MM-DD (Thai time), replaces days. Max 90 days |
download | download=1 returns JSON as a file (CSV is always a file) |
| type | Contents |
|---|---|
all | Every dataset in one response (JSON only) |
summary | Totals for the whole period + CTR/CPC/cost per booking + shop-recorded bookings |
daily | One row per day (Thai-time dates) |
hourly | One row per hour, with hour_th (Thai time) and nz_hour (New Zealand time) |
devices | By device (mobile / desktop / tablet / other), aggregated over the period |
keywords | Per keyword, aggregated over the period, sorted by clicks |
search_terms | Actual search terms, aggregated over the period, sorted by clicks |
bookings | Bookings recorded by the shop, per day |
| Field | Meaning |
|---|---|
impressions | Times the ad was shown |
clicks | Clicks to the website |
cost | Spend (THB) |
conv_click | Book Now clicks (interest) |
conv_booking | Completed Fresha bookings |
ctr | Clicks ÷ impressions (0–1) |
cpc | Spend ÷ clicks (THB) |
cost_per_book_click / cost_per_booking | Cost per Book Now click / per completed booking (0 when not computable) |
# 7-day summary (JSON)
curl "https://calista-ads-report.calista-thai-message.workers.dev/api/report?type=summary&days=7"
# Daily CSV for a date range
curl -o daily.csv "https://calista-ads-report.calista-thai-message.workers.dev/api/report?type=daily&format=csv&from=2026-10-01&to=2026-10-19"
# Everything for 30 days as a JSON file
curl -OJ "https://calista-ads-report.calista-thai-message.workers.dev/api/report?type=all&days=30&download=1"{
"ok": true,
"range": { "start": "2026-10-13", "end": "2026-10-19", "timezone": "Asia/Bangkok (GMT+7)" },
"currency": "THB",
"generated_at": "2026-10-19T04:00:00.000Z",
"data": {
"summary": [{
"start": "2026-10-13", "end": "2026-10-19", "days": 7,
"impressions": 420, "clicks": 31, "cost": 512.4,
"conv_click": 6, "conv_booking": 1,
"ctr": 0.0738, "cpc": 16.53,
"cost_per_book_click": 85.4, "cost_per_booking": 512.4,
"shop_recorded_bookings": 2
}]
}
}Errors return {"ok": false, "error": "..."} with status 400 (bad parameter) or 500
Returns {"ok": true, "daily_rows": 12} when the database is reachable