Skip to content

Docs Analytics

Analytics API

Read your Analytics numbers from your own code, and send goals, payments and chart notes from your server. Every request is limited to the one site its key was made for.

Start here

Base URL

https://data.blazehive.io/api/v1
Your first request
curl "https://data.blazehive.io/api/v1/overview?period=7d" \
  -H "Authorization: Bearer YOUR_API_KEY"

Jump to: read endpoints, send goals, payments and notes, bot report.

Authentication

Make a key in BlazeHive: Analytics settings, Developers, Make a key. Only editors of the project can make keys. The key is shown once. Each key reads and writes one site: the site it was made for. You can have 25 live keys per site. A revoked key stops working at once.

Every request
Authorization: Bearer YOUR_API_KEY
Keep the key on your server. Anyone with it can read your analytics and record payments for your site. Never put it in a web page.

Responses and errors

Every answer
{ "status": "success", "data": { ... }, "meta": { ... } }
  • data: the result. pagination: on lists, { limit, offset, hasMore } (and total when it is known). meta: the range the numbers cover and other context.
  • Money is in minor units (cents) of your site's currency. Percentages are 0 to 100. Durations are seconds. Times are ISO 8601 in UTC. Chart buckets (t) are labelled in the range's time zone, without an offset.

Errors

An error
{ "status": "error", "error": { "code": "invalid_request", "message": "unknown timezone \"Mars/Base\"" } }
StatuscodeWhen
400invalid_requestA parameter or the body is wrong; message says which.
401unauthorizedNo API key, or a key that is not valid.
404not_foundUnknown endpoint, dimension, funnel, visitor or payment.
413payload_too_largeBody over 256 KB.
429rate_limitedToo many requests for this key.
500internal_errorA problem on our side. Safe to retry.
503timeoutThe query took longer than 20 seconds. Retry later, or ask for a shorter range or a larger interval. Retry-After: 5.

Limits

  • 600 requests a minute per API key. Every answer has X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets). Over the limit: 429 with Retry-After.
  • Request bodies up to 256 KB. POST /pages takes up to 500 paths.
  • Breakdowns: limit up to 500. Time series: at most 5,000 points. Payments list: limit up to 200.

Common parameters

Read endpoints take these query parameters.

ParameterMeaning
startAt, endAtThe range. A date (2026-11-01: whole days in timezone, endAt included) or an ISO timestamp (2026-11-01T08:00:00Z). startAt alone runs until now.
periodInstead of startAt/endAt: today, yesterday, 7d, 30d (default), 60d, 90d, 12mo, month, year, all, now (last 30 minutes).
timezoneIANA name for day boundaries and bucket labels. Default: your site's timezone.
intervalBucket size for charts: minute, hour, day, week, month. Default from the length of the range.
fieldsComma-separated list to return only some metrics (overview and timeseries).
filter_<dimension>Keep only matching visits: filter_country=FR, several values filter_country=FR,DE, exclude with !: filter_channel=!Direct.
filtersThe same as JSON, for contains and more: [{"dim":"page","op":"contains","value":"/blog"}]. Ops: is, is_not, contains, in (with values), not_in. At most 12 filters in total.
limit, offsetPaging on lists.

Filter dimensions: channel, referrer, campaign, keyword, utm_source, utm_medium, utm_content, hostname, page, entry_page, exit_link, country, region, city, browser, os, device, goal, visitor, session. region and city values are written <country>/<name> (FR/Paris). goal keeps every event of visitors who completed that goal.

Read endpoints

All are GET requests, except POST /pages, which takes many paths in its body.

GET /site

Your site: its id, name, domain, time zone and currency.

Request
curl https://data.blazehive.io/api/v1/site -H 'Authorization: Bearer bhk_...'
Response
{ "status": "success", "data": { "id": "bh_7Hk2mQ9xLp4RtW1nZc8vYb3d", "name": "Example", "domain": "example.com", "timezone": "Europe/Paris", "currency": "EUR" } }

GET /overview

The headline numbers for the range.

  • compare=true adds previous: the same numbers for the range of the same length just before.
  • fields returns only the numbers you list.
  • An endAt in the future is cut at now.
FieldMeaning
visitorsDistinct visitors with a pageview.
pageviews, sessionsCounts.
bounceRateShare of sessions with one pageview.
sessionTimeAverage session length, seconds.
revenueNet revenue (after refunds), minor units.
revenuePerVisitorRevenue / visitors, minor units.
conversionRateShare of visitors who paid.
onlineVisitors active in the last 5 minutes (ignores the range).
Request
curl 'https://data.blazehive.io/api/v1/overview?period=7d&compare=true' -H 'Authorization: Bearer bhk_...'
Response
{
  "status": "success",
  "data": {
    "visitors": 1, "pageviews": 1, "sessions": 1, "revenue": 0, "conversionRate": 0, "revenuePerVisitor": 0, "bounceRate": 100, "sessionTime": 0.071, "online": 1,
    "currency": "EUR",
    "previous": { "visitors": 0, "pageviews": 0, "sessions": 0, "revenue": 0, "conversionRate": 0, "revenuePerVisitor": 0, "bounceRate": 0, "sessionTime": 0 }
  },
  "meta": {
    "range": { "startAt": "2026-11-18T23:00:00.000Z", "endAt": "2026-11-25T09:37:09.206Z", "timezone": "Europe/Paris", "interval": "day" },
    "previousRange": { "startAt": "2026-11-12T12:22:50.794Z", "endAt": "2026-11-18T23:00:00.000Z" }
  }
}
Request
curl 'https://data.blazehive.io/api/v1/overview?startAt=2026-11-01&endAt=2026-11-30&timezone=Europe/Paris&fields=visitors,pageviews,revenue&filter_country=FR' \
  -H 'Authorization: Bearer bhk_...'
Response
{ "status": "success", "data": { "visitors": 1, "pageviews": 1, "revenue": 0, "currency": "EUR" }, "meta": { "range": { "startAt": "2026-10-31T23:00:00.000Z", "endAt": "2026-11-25T09:37:09.546Z", "timezone": "Europe/Paris", "interval": "day" } } }

GET /timeseries

One point per bucket, with zeros where nothing happened.

  • Fields: visitors, pageviews, sessions, goals, payments, revenue.
  • interval sets the bucket. meta.incompleteBucket is the bucket still filling up, or null.
  • At most 5,000 points per request.
Request
curl 'https://data.blazehive.io/api/v1/timeseries?period=7d&interval=day&fields=visitors,pageviews' -H 'Authorization: Bearer bhk_...'
Response
{
  "status": "success",
  "data": [
    { "t": "2026-11-19T00:00:00", "visitors": 0, "pageviews": 0 },
    ...
    { "t": "2026-11-25T00:00:00", "visitors": 1, "pageviews": 1 }
  ],
  "meta": { "range": { "startAt": "2026-11-18T23:00:00.000Z", "endAt": "2026-11-25T09:37:09.621Z", "timezone": "Europe/Paris", "interval": "day" }, "currency": "EUR", "incompleteBucket": "2026-11-25T00:00:00" }
}

GET /breakdown/{dimension}

The top values of one dimension.

  • Dimensions: channel, referrer, campaign, keyword, utm_source, utm_medium, utm_content, hostname, page, entry_page, exit_link, country, region, city, browser, os, device.
  • limit (default 10, at most 500), offset, sort: visitors (default), revenue, pageviews or conversion.
  • Each row has name, visitors, pageviews (clicks for exit_link), revenue, payers, conversionRate and extra (the referrer's domain, or the country code for country, region and city). Visit dimensions add sessions, bounceRate, sessionTime. page adds entries, exits and timeOnPage.
  • meta.totalVisitors counts each visitor once across all rows. Lists have hasMore, not a total.
Request
curl 'https://data.blazehive.io/api/v1/breakdown/channel?period=7d' -H 'Authorization: Bearer bhk_...'
Response
{
  "status": "success",
  "data": [ { "name": "Email", "visitors": 1, "pageviews": 1, "extra": null, "revenue": 0, "payers": 0, "conversionRate": 0, "sessions": 1, "bounceRate": 100, "sessionTime": 0.071 } ],
  "pagination": { "limit": 10, "offset": 0, "hasMore": false },
  "meta": { "range": { "startAt": "2026-11-18T23:00:00.000Z", "endAt": "2026-11-25T09:37:09.783Z", "timezone": "Europe/Paris", "interval": "day" }, "dimension": "channel", "totalVisitors": 1, "currency": "EUR" }
}
Response
{ "status": "success", "data": [ { "name": "/pricing", "visitors": 1, "pageviews": 1, "extra": null, "revenue": 0, "payers": 0, "conversionRate": 0, "entries": 1, "exits": 1 } ], "pagination": { "limit": 5, "offset": 0, "hasMore": false }, "meta": { ... "dimension": "page" ... } }

GET /goals

Goals in the range: name, count (times completed), visitors and conversionRate (share of all visitors).

  • Payments count as the goal payment. Stripe subscriptions add trial_started, subscription_started and subscription_ended.
Response
{ "status": "success", "data": [ { "name": "signup", "count": 1, "visitors": 1, "conversionRate": 100 } ], "meta": { "range": { ... } } }

GET /funnels and /funnels/{id}

Your saved funnels with their results in the range. GET /funnels answers a list of the same objects.

  • Each step has visitors, conversionFromFirst, conversionFromPrev, dropoff and medianSecondsFromPrev.
  • Steps must happen in order. Any time may pass between them.
Response
{
  "status": "success",
  "data": {
    "id": 1, "name": "Pricing to signup",
    "steps": [
      { "type": "page", "value": "/pricing", "visitors": 1, "conversionFromFirst": 100, "conversionFromPrev": 100, "dropoff": 0, "medianSecondsFromPrev": null },
      { "type": "goal", "value": "signup", "visitors": 1, "conversionFromFirst": 100, "conversionFromPrev": 100, "dropoff": 0, "medianSecondsFromPrev": 0.037 }
    ]
  },
  "meta": { "range": { ... } }
}

GET /realtime

Visitors active in the last 5 minutes, at most 100.

Response
{ "status": "success", "data": { "online": 1, "visitors": [ { "visitorId": "3f1c2a9e-6b1d-4c7e-9a52-0d8e4b7f1a21", "lastSeen": "2026-11-25T09:37:08.177Z", "path": "/pricing", "country": "FR", "city": "Paris", "device": "desktop", "referrer": "Email" } ] } }

GET /ai-crawlers

Bot reads by bot, with a chart.

  • mode: answers (default: an AI assistant opened the page for a person), indexing or training.
  • groupBy=page groups by page, groupBy=source by what reported the visit.
  • Optional crawlers, pages and sources (comma lists; unknown is hits sent without a source) and search.
Response
{
  "status": "success",
  "data": {
    "totals": { "answers": 1, "indexing": 0, "training": 1 },
    "groups": [ { "name": "ChatGPT", "count": 1, "company": "OpenAI", "pct": 100, "lastSeen": "2026-11-25T09:37:08.289Z", "topPages": [ { "name": "/pricing", "count": 1 } ] } ],
    "keys": ["ChatGPT"],
    "series": [ { "t": "2026-11-19T00:00:00", "total": 0, "ChatGPT": 0 }, ..., { "t": "2026-11-25T00:00:00", "total": 1, "ChatGPT": 1 } ],
    "groupBy": "crawler"
  },
  "meta": { "range": { ... } }
}

GET /ai-crawlers/urls

Every exact URL the bots asked for.

  • mode may also be all. sort: count (default) or recent. limit (default 50, at most 500), offset. sources filters this view too.
  • verified: hits from an address the bot's company publishes (yes), from another address (no, hidden by default), or that cannot be checked (unknown).
Response
{
  "status": "success",
  "data": [
    { "url": "/pricing?ref=chat", "path": "/pricing", "count": 1, "firstSeen": "2026-11-25T09:37:08.289Z", "lastSeen": "2026-11-25T09:37:08.289Z", "crawlers": [ { "name": "ChatGPT", "count": 1 } ], "modes": { "answers": 1 }, "statuses": { "200": 1 }, "verified": { "yes": 0, "no": 0, "unknown": 1 } }
  ],
  "pagination": { "limit": 50, "offset": 0, "total": 2, "hasMore": false },
  "meta": { "range": { ... } }
}

POST /pages

Numbers per page for up to 500 paths, for example the pages you publish.

  • Body: paths (each a path starting with / or a full URL; /guide and /guide/ are one page) and the range as period, or startAt and endAt (and timezone).
  • entries: visits that started on the page. aiVisitors: visitors who came from an AI assistant and viewed the page. crawls: bot reads per kind. lastCrawlAt: the last bot read in the range.
Request
curl -X POST https://data.blazehive.io/api/v1/pages -H 'Authorization: Bearer bhk_...' -H 'Content-Type: application/json' \
  -d '{"period":"30d","paths":["/guide"]}'
Response
{
  "status": "success",
  "data": [
    { "path": "/guide", "visitors": 2, "pageviews": 2, "entries": 2, "aiVisitors": 1, "crawls": { "answers": 1, "indexing": 0, "training": 1 }, "lastCrawlAt": "2026-11-25T11:09:46.335Z" }
  ],
  "meta": { "range": { "startAt": "2026-10-26T23:00:00.000Z", "endAt": "2026-11-25T11:09:46.457Z", "timezone": "Europe/Berlin", "interval": "day" } }
}

GET /rankings

Google positions of your tracked keywords, from Search Console.

  • Each keyword: id, query, position (latest), change (above 0 means it moved up), average, clicks, impressions, volume. Each series point has the position per keyword id.
  • meta.searchConsole says whether Search Console is connected and when it last synced.
Response
{
  "status": "success",
  "data": { "keywords": [], "series": [ { "t": "2026-11-19T00:00:00" }, ..., { "t": "2026-11-25T00:00:00" } ], "interval": "day" },
  "meta": { "range": { ... }, "searchConsole": { "connected": false, "property": null, "status": "off", "error": null, "lastSyncAt": null, "lastDate": null } }
}

GET /payments

Payments in the range, newest first.

  • limit (default 50, at most 200), offset.
  • meta.totals has n, gross, refunded, net and pending. Pending payments are in another currency and wait for an exchange rate: they show with gross 0 and fxPending: true until converted.
  • Each payment says whether it was credited to a visitor (attributed) and how (attributionMethod):
attributionMethodThe visitor came from
metadatabh_visitor_id in the Stripe Checkout Session, Subscription or invoice metadata.
client_reference_idThe tracker's bhv_ value on a Stripe Payment Link, Buy Button or Pricing Table.
customerAn earlier payment of the same customer (Stripe customer, or customerId sent to POST /payments).
apiThe visitorId you sent to POST /payments.
noneNothing. attributed is false and the payment counts as Direct.
Response
{
  "status": "success",
  "data": [
    { "id": 6, "ts": "2026-11-25T09:37:10.187Z", "gross": 4900, "refunded": 900, "net": 4000, "currency": "EUR", "originalAmount": null, "originalCurrency": null, "externalId": "api:order_1001", "fxPending": false, "attributionMethod": "api", "attributed": true, "visitorId": "3f1c2a9e-6b1d-4c7e-9a52-0d8e4b7f1a21", "sessionId": "s8a7b6c5d-4e3f-4a1b-9c8d-7e6f5a4b3c2d", "referrer": "Email", "referrerDomain": "mail.google.com", "channel": "Email", "country": "FR", "city": "Paris", "entryPath": "/pricing", "utmCampaign": "launch", "email": "[email protected]", "name": "Ana Example", "userId": "user_42" }
  ],
  "pagination": { "limit": 50, "offset": 0, "total": 1, "hasMore": false },
  "meta": { "range": { ... }, "totals": { "n": 1, "gross": 4900, "refunded": 900, "net": 4000, "pending": 0 }, "currency": "EUR" }
}

GET /visitors/{visitorId}

One visitor: who they are (from identify), their totals, their first visit and their last 100 events.

  • The visitor id is the value of the bh_visitor_id cookie. An unknown id is 404 not_found.
Response
{
  "status": "success",
  "data": {
    "visitorId": "3f1c2a9e-6b1d-4c7e-9a52-0d8e4b7f1a21",
    "firstSeenAt": "2026-11-25T08:49:16.000Z", "lastSeenAt": "2026-11-25T09:37:10.187Z",
    "userId": "user_42", "name": "Ana Example", "email": "[email protected]", "image": null,
    "properties": { "name": "Ana Example", "email": "[email protected]", "user_id": "user_42" },
    "stats": { "sessions": 1, "pageviews": 1, "goals": 2, "payments": 1, "revenue": 4000 },
    "firstVisit": { "startedAt": "2026-11-25T09:37:08.140Z", "entryPath": "/pricing", "hostname": "www.example.com", "referrer": "Email", "referrerDomain": "mail.google.com", "channel": "Email", "utmSource": "newsletter", "utmMedium": "email", "utmCampaign": "launch", "utmTerm": null, "utmContent": null, "country": "FR", "region": null, "city": "Paris", "browser": "Chrome", "os": "Mac OS", "device": "desktop" },
    "events": [
      { "ts": "2026-11-25T09:37:10.187Z", "type": "payment", "path": "/pricing", "eventName": "payment", "props": { "source": "api", "provider": "paddle" }, "revenue": 4000, "currency": "EUR", "sessionId": "s8a7b6c5d-4e3f-4a1b-9c8d-7e6f5a4b3c2d" },
      { "ts": "2026-11-25T09:37:10.087Z", "type": "custom", "path": "/pricing", "eventName": "upgraded", "props": { "plan": "pro" }, "revenue": 0, "currency": null, "sessionId": "s8a7b6c5d-4e3f-4a1b-9c8d-7e6f5a4b3c2d" },
      ...
    ]
  }
}

Send goals, payments and notes

Requests with a body take JSON: send Content-Type: application/json.

POST /goals

Record a goal from your server for a visitor the visitor code has seen, for example "upgraded" when a background job finishes. It is credited to the visitor's first visit, like goals from the page.

  • 201 when recorded, 200 with recorded: false for a repeat. An unknown visitor is 404.
FieldTypeMeaning
visitorIdstringRequired. The bh_visitor_id cookie of the visitor.
namestringRequired. Lower-case letters, digits, _ and -, at most 64 (upper case is lowered).
metadataobjectUp to 10 keys (same rule as name) with string, number or boolean values (stored as text, 255 characters).
timestampISO timestampWhen it happened. Default: now. Not in the future.
idempotencyKeystringOptional. A second request with the same key records nothing.
Request
curl -X POST https://data.blazehive.io/api/v1/goals \
  -H 'Authorization: Bearer bhk_...' -H 'Content-Type: application/json' \
  -d '{"visitorId":"3f1c2a9e-6b1d-4c7e-9a52-0d8e4b7f1a21","name":"upgraded","metadata":{"plan":"pro"},"idempotencyKey":"upgrade-user_42-1"}'
Response
{ "status": "success", "data": { "recorded": true, "visitorId": "3f1c2a9e-6b1d-4c7e-9a52-0d8e4b7f1a21", "name": "upgraded" } }
Response
{ "status": "error", "error": { "code": "not_found", "message": "visitor not found: send a visitorId the tracker recorded on this site (the bh_visitor_id cookie)" } }

POST /payments

Record a payment from any provider: Paddle, Lemon Squeezy or your own billing. Stripe payments arrive on their own when Stripe is connected. Do not send them here too.

  • 201 when recorded, 200 with recorded: false for a repeat.
  • To credit the visit, put the visitor code's value in your checkout's free-text field and send it back as visitorId (the third example). Send renewals with the same customerId and no visitorId. The first visitorId sent with a customerId wins.
  • amount, refunded and net are in your site's currency. For a payment in another currency, originalAmount and originalCurrency keep what you sent. pendingExchangeRate: true means it counts in no revenue until it is converted, which happens on its own.
FieldTypeMeaning
transactionIdstring, max 200Required. Your id of the payment. A repeat with the same id records nothing.
amountintegerRequired. The amount collected, in minor units of currency (4900 = 49.00).
currency3 lettersRequired. Converted to your site's currency at the rate of the payment day.
visitorIdstringThe bh_visitor_id cookie of the buyer, for attribution. A bhv_<visitor>__bhs_<session> value (see below) is also accepted and split into both ids. Without it the payment counts as Direct, unless customerId is known.
sessionIdstringThe bh_session_id cookie, used when the visitor has no stored visit.
customerIdstringYour customer id. With a visitorId, it remembers which visitor this customer is; later payments with the same customerId and no visitorId (renewals) are credited to that visitor. Without either, it groups the buyer's payments.
email, namestringThe buyer, shown with the payment.
providerstringpaddle, lemonsqueezy, ... Kept with the payment.
renewalbooleanKept with the payment.
timestampISO timestampWhen it was paid. Default: now. Not in the future.
Request
curl -X POST https://data.blazehive.io/api/v1/payments \
  -H 'Authorization: Bearer bhk_...' -H 'Content-Type: application/json' \
  -d '{"transactionId":"order_1001","amount":4900,"currency":"EUR","visitorId":"3f1c2a9e-6b1d-4c7e-9a52-0d8e4b7f1a21","email":"[email protected]","provider":"paddle"}'
Response
{ "status": "success", "data": { "recorded": true, "payment": { "transactionId": "order_1001", "visitorId": "3f1c2a9e-6b1d-4c7e-9a52-0d8e4b7f1a21", "timestamp": "2026-11-25T09:37:10.187Z", "amount": 4900, "refunded": 0, "net": 4900, "currency": "EUR", "originalAmount": null, "originalCurrency": null, "pendingExchangeRate": false, "provider": "paddle", "attributed": true, "attributionMethod": "api" } } }
JavaScript
const v = document.cookie.match(/(?:^|; )bh_visitor_id=([^;]+)/)?.[1];
const s = document.cookie.match(/(?:^|; )bh_session_id=([^;]+)/)?.[1];
const reference = v ? `bhv_${v}` + (s ? `__bhs_${s}` : "") : null; // letters, digits, dashes and underscores
Request
curl -X POST https://data.blazehive.io/api/v1/payments \
  -H 'Authorization: Bearer bhk_...' -H 'Content-Type: application/json' \
  -d '{"transactionId":"ls_5001","amount":1900,"currency":"EUR","visitorId":"bhv_2c4e6a8b-1d3f-4b5c-9e7a-8f6d4b2a0c1e__bhs_s5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b","customerId":"ctm_77","provider":"lemonsqueezy"}'
Response
{ "status": "success", "data": { "recorded": true, "payment": { "transactionId": "ls_5001", "visitorId": "2c4e6a8b-1d3f-4b5c-9e7a-8f6d4b2a0c1e", "timestamp": "2026-11-25T13:01:49.030Z", "amount": 1900, "refunded": 0, "net": 1900, "currency": "EUR", "originalAmount": null, "originalCurrency": null, "pendingExchangeRate": false, "provider": "lemonsqueezy", "attributed": true, "attributionMethod": "api" } } }
Request
curl -X POST https://data.blazehive.io/api/v1/payments \
  -H 'Authorization: Bearer bhk_...' -H 'Content-Type: application/json' \
  -d '{"transactionId":"ls_5002","amount":1900,"currency":"EUR","customerId":"ctm_77","provider":"lemonsqueezy","renewal":true}'
Response
{ "status": "success", "data": { "recorded": true, "payment": { "transactionId": "ls_5002", "visitorId": "2c4e6a8b-1d3f-4b5c-9e7a-8f6d4b2a0c1e", "timestamp": "2026-11-25T13:01:49.033Z", "amount": 1900, "refunded": 0, "net": 1900, "currency": "EUR", "originalAmount": null, "originalCurrency": null, "pendingExchangeRate": false, "provider": "lemonsqueezy", "attributed": true, "attributionMethod": "customer" } } }

POST /payments/{transactionId}/refund

Set how much of a payment was refunded.

  • amount is the total refunded so far, in minor units of the currency you sent the payment in. Sending the same amount again changes nothing. Without amount: a full refund.
  • A fully refunded payment no longer counts in revenue, conversion or the payment goal.
Request
curl -X POST https://data.blazehive.io/api/v1/payments/order_1001/refund \
  -H 'Authorization: Bearer bhk_...' -H 'Content-Type: application/json' -d '{"amount":900}'
Response
{ "status": "success", "data": { "payment": { "transactionId": "order_1001", "visitorId": "3f1c2a9e-6b1d-4c7e-9a52-0d8e4b7f1a21", "timestamp": "2026-11-25T09:37:10.187Z", "amount": 4900, "refunded": 900, "net": 4000, "currency": "EUR", "originalAmount": null, "originalCurrency": null, "pendingExchangeRate": false, "provider": "paddle", "attributed": true, "attributionMethod": "api" } } }

DELETE /payments/{transactionId}

Remove a payment recorded through this API, for example one sent by mistake. Stripe payments cannot be removed here.

Response
{ "status": "success", "data": { "deleted": true, "transactionId": "order_1002" } }

GET /annotations

Your chart notes: the dated flags on the visitors and Google rankings charts, oldest day first.

  • Notes added in the dashboard are here too. Notes with scope: "all" come from BlazeHive and can't be changed.
Request
curl https://data.blazehive.io/api/v1/annotations -H 'Authorization: Bearer bhk_...'
Response
{ "status": "success", "data": [ { "id": 1, "date": "2026-11-20", "kind": "note", "title": "Published 12 new pages", "note": "The pricing guides", "url": "https://example.com/blog/pricing-guides", "keyword": null, "scope": "site", "createdAt": "2026-11-26T10:04:51.070Z", "updatedAt": "2026-11-26T10:04:51.070Z" }, { "id": 2, "date": "2026-11-24", "kind": "note", "title": "New homepage", "note": null, "url": null, "keyword": null, "scope": "site", "createdAt": "2026-11-26T10:04:51.092Z", "updatedAt": "2026-11-26T10:04:51.092Z" } ] }

POST /annotations

Add a chart note, for example from your deploy script: "Released version 2.4". It shows as a flag on that day.

  • 201 when added. At most 500 notes per site.
FieldTypeMeaning
datestringRequired. The day, YYYY-MM-DD, in your site's time zone.
titlestringRequired. 1 to 120 characters.
notestringOptional. More detail, up to 1,000 characters.
urlstringOptional. A link starting with http:// or https://, up to 500 characters.
keywordstringOptional. One Google keyword the note is about, such as best crm for startups (up to 200 characters, saved in lower case). The note then shows on that keyword's rankings charts instead of every chart.
Request
curl -X POST https://data.blazehive.io/api/v1/annotations \
  -H 'Authorization: Bearer bhk_...' -H 'Content-Type: application/json' \
  -d '{"date":"2026-11-20","title":"Published 12 new pages","note":"The pricing guides","url":"https://example.com/blog/pricing-guides"}'
Response
{ "status": "success", "data": { "id": 1, "date": "2026-11-20", "kind": "note", "title": "Published 12 new pages", "note": "The pricing guides", "url": "https://example.com/blog/pricing-guides", "keyword": null, "scope": "site", "createdAt": "2026-11-26T10:04:51.070Z", "updatedAt": "2026-11-26T10:04:51.070Z" } }
Response
{ "status": "error", "error": { "code": "invalid_request", "message": "date: must be a real day" } }

PATCH /annotations/{id}

Change a note. Send only the fields to change; null clears note or url.

Request
curl -X PATCH https://data.blazehive.io/api/v1/annotations/2 \
  -H 'Authorization: Bearer bhk_...' -H 'Content-Type: application/json' \
  -d '{"title":"New homepage and pricing page"}'
Response
{ "status": "success", "data": { "id": 2, "date": "2026-11-24", "kind": "note", "title": "New homepage and pricing page", "note": null, "url": null, "keyword": null, "scope": "site", "createdAt": "2026-11-26T10:04:51.092Z", "updatedAt": "2026-11-26T10:04:51.125Z" } }

DELETE /annotations/{id}

Delete a note.

Response
{ "status": "success", "data": { "deleted": true, "id": 2 } }

Bot report

For servers that report bot visits with their own code. It uses the bot token from Analytics settings, Install, For developers, not an API key. Send it as Authorization: Bearer <bot token> or as the header x-blazehive-token.

POST to

https://data.blazehive.io/api/ai-crawls/ingest

Send one hit, or up to 500 in events. Requests from people and unknown bots are ignored, so it is safe to send everything that looks like a bot. Ready-made code for each stack is in Install, Bot code by stack.

FieldTypeMeaning
url or pathstring, max 2000The requested URL (full URL or path, with query string). One of the two is required. Stored as path plus query string, with the values of parameters whose names look secret (token, key, secret, password, auth, session, sig, signature, code and similar) replaced by ***, at most 20 parameters and 100 characters per value.
userAgentstring, max 1000Required. The request's User-Agent.
ipstringThe client IP. When the crawler's vendor publishes its IP ranges, the hit is checked against them.
statusintegerYour response status code. Outside 100 to 599 it is stored as unknown.
timestampISO string or epoch millisecondsWhen the request happened. Default: now. A time more than 5 minutes in the future is stored as now; a hit more than 3,700 days old is ignored.
sourcestring, [a-z0-9_.-], max 40Optional. What reports the hits (wordpress, cloudflare, middleware, ...). On a batch it applies to every hit; a hit's own source wins. Shown on the site's status. A WordPress reporter is recognised from its user agent when it sends none. unknown is reserved and stored as no source.
Request
curl -X POST https://data.blazehive.io/api/ai-crawls/ingest \
  -H 'Authorization: Bearer bhpt_9yMOni5VqXUedbZNxTx0jk4NL58KWZ7k' \
  -H 'Content-Type: application/json' \
  -d '{"source":"cloudflare","events":[
        {"url":"https://example.com/pricing?ref=chat","userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ChatGPT-User/1.0; +https://openai.com/bot)","status":200},
        {"url":"/blog/guide","userAgent":"Mozilla/5.0 (compatible; ClaudeBot/1.0; [email protected])","status":200},
        {"url":"/","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"}]}'
Response
{ "accepted": 2, "ignored": 1, "spoofed": 0, "verified": 0 }
Response
{ "pattern": "bot|crawl|spider|slurp|chatgpt|oai-|openai|claude|anthropic|perplexity|google-|googleother|googleagent|gemini|notebooklm|bingpreview|duckassist|mistral|cohere|deepseek|amazon|amzn-|meta-external|facebookexternal|webindexer|diffbot|copilot|grok|hunyuan|-user\\b|fetcher|blazehive-verify", "flags": "i", "version": 2 }
  • accepted: hits stored. ignored: not a known bot, a probe for weak spots (like /.env), a company you switched off, or a URL that cannot be read. spoofed: stored, but from an address the bot's company does not publish, so hidden by default. verified: test visits received.

Test visits

To prove that your server reports, send a request through it whose User-Agent starts with BlazeHive-Verify/ and contains nonce= followed by 16 to 64 letters, digits, _ or -. It is never counted as a bot read.

Request
curl -X POST https://data.blazehive.io/api/ai-crawls/ingest \
  -H 'Authorization: Bearer bhpt_9jmdg1nUf33zDV0zTJ2MDaAIoqH8HsAs' -H 'Content-Type: application/json' \
  -d '{"source":"cloudflare","events":[
        {"url":"https://example.com/guide/","userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ChatGPT-User/1.0; +https://openai.com/bot)","status":200},
        {"url":"https://example.com/guide?ref=x","userAgent":"Mozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)","status":200},
        {"url":"https://example.com/__bh_verify","userAgent":"BlazeHive-Verify/1.0 (+https://example.com) nonce=Qm9vdHN0cmFwX2NoZWNr","status":204}]}'
Response
{ "accepted": 2, "ignored": 0, "spoofed": 0, "verified": 1 }
StatusBodyWhen
200{ accepted, ignored, spoofed, verified }Processed.
400{"error":"invalid payload"} or {"error":"invalid JSON"}Bad body.
401{"error":"invalid token"}Missing or wrong token (the service key and API keys are not crawler tokens).
413{"error":"payload too large"}Body over 512 KB.
429{"error":"rate limited"}More than 1200 requests a minute for this token.
503{"error":"...","code":"timeout"}The database did not answer in time.

Values

Channels

Where a visit came from: Direct, Organic Search, Organic Social, Paid Search, Paid Social, Email, AI, Referral.

Bot read kinds

ModeMeaningExamples
answersAn assistant fetched the page because a person asked it something.ChatGPT-User, Claude-User, Perplexity-User, DuckAssistBot, Meta-ExternalFetcher
indexingSearch and retrieval indexes.OAI-SearchBot, PerplexityBot, Claude-SearchBot, Googlebot, bingbot, meta-webindexer
trainingCrawls for model training.GPTBot, ClaudeBot, Meta-ExternalAgent, Applebot, CCBot, Bytespider
Docs menu · Analytics API