← API reference

Developer · API reference

Traffic, bots & conversions

AI-bot crawls of your pages, the visitors AI sends you, and AI-attributed conversions.

These endpoints return your AI-traffic data: which AI bots crawl your pages, the human visitors that AI referrals send you, and the conversions you can attribute to AI search. They require the tracking snippet installed on your site (see the "See which AI bots crawl your site" guide) and onboarding completed — until then they return zeroes.

`website-traffic-kpis` returns the rolling 1/7/30-day headline numbers; `website-traffic-timeseries` returns the daily series to chart; `webpage-analytics` breaks it down per page alongside each page’s AEO health.

GET /analytics/website-traffic-kpis/{company_id}

Direct AI-bot crawls and indirect AI-referred visits

Website-level traffic KPIs over rolling 1/7/30-day windows. `bot_traffic` counts DIRECT AI-bot crawls of your pages (broken down by `llm`/`search`/`social`/`seo`). `ai_referred_traffic` counts INDIRECT human visits that AI answers sent you, with conversions and conversion rate; the `day7` block additionally carries a 7-point rolling `daily[]` (referred views) and `conversions_daily[]` series for sparklines. `conversions` summarises total vs AI-attributed conversions per window, and `provider_breakdown_7d` lists AI providers by view count over the last 7 days. Pass a `companyId` from `POST /user/user-checkin`; the company must have completed onboarding.

🔒 Requires Authorization: Bearer ll_… (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYes—

Example request

curl -X GET "https://api.lunalift.ai/analytics/website-traffic-kpis/COMPANY_ID" \
  -H "Authorization: Bearer ll_your_api_key"

Response · 200 OK

FieldTypeNotes
successboolean—
dataobject—
data.bot_trafficobjectsame shape as: ai_referred_traffic, conversions
data.bot_traffic.day1objectsame shape as: day7, day30
data.bot_traffic.day1.llmintegersame shape as: search, social, seo, total, change
data.provider_breakdown_7dobject[]—
data.provider_breakdown_7d[].providerstring—
data.provider_breakdown_7d[].viewsinteger—

Example response

{
  "success": true,
  "data": {
    "bot_traffic": {
      "day1": {
        "llm": 12,
        "search": 8,
        "social": 1,
        "seo": 4,
        "total": 25,
        "change": 13.6
      },
      "day7": {
        "llm": 84,
        "search": 55,
        "social": 6,
        "seo": 30,
        "total": 175,
        "change": 9.2
      },
      "day30": {
        "llm": 360,
        "search": 240,
        "social": 22,
        "seo": 130,
        "total": 752,
        "change": -3.1
      }
    },
    "ai_referred_traffic": {
      "day1": {
        "total": 6,
        "conversions": 1,
        "conversionRate": 16.67,
        "change": 0
      },
      "day7": {
        "total": 41,
        "conversions": 5,
        "conversionRate": 12.2,
        "change": 8,
        "daily": [
          3,
          4,
          5,
          6,
          7,
          8,
          8
        ],
        "conversions_daily": [
          0,
          1,
          1,
          1,
          2,
          2,
          3
        ]
      },
      "day30": {
        "total": 180,
        "conversions": 22,
        "conversionRate": 12.22,
        "change": -2.4
      }
    },
    "conversions": {
      "day1": {
        "total": 3,
        "ai": 1,
        "aiPercent": 33.33,
        "change": 0
      },
      "day7": {
        "total": 18,
        "ai": 5,
        "aiPercent": 27.78,
        "change": 5.9
      },
      "day30": {
        "total": 74,
        "ai": 22,
        "aiPercent": 29.73,
        "change": -1.2
      }
    },
    "provider_breakdown_7d": [
      {
        "provider": "openai",
        "views": 60
      },
      {
        "provider": "perplexity",
        "views": 25
      },
      {
        "provider": "google",
        "views": 15
      }
    ]
  }
}
GET /analytics/website-traffic-timeseries/{company_id}

Daily traffic and conversion time series

Per-day time series for charting a website's traffic and conversions. Returns four parallel series: `traffic[]` (daily bot views split into `llm_bot`/`search_bot`/`social_bot`/`seo_bot` plus `ai_referred`), `conversions[]` (daily total and AI-attributed conversions), `providers[]` (daily views per AI provider), and `conversion_events[]` (daily conversions per event type). Pass a `companyId` from `POST /user/user-checkin`; the company must have completed onboarding.

🔒 Requires Authorization: Bearer ll_… (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYes—

Query parameters

NameTypeRequiredDefaultDescription
daysintegerNo30Number of trailing days to include. Clamped server-side to the range 7–90 (values below 7 are raised to 7, above 90 lowered to 90). Defaults to 30.

Example request

curl -X GET "https://api.lunalift.ai/analytics/website-traffic-timeseries/COMPANY_ID" \
  -H "Authorization: Bearer ll_your_api_key"

Response · 200 OK

FieldTypeNotes
successboolean—
dataobject—
data.trafficobject[]—
data.traffic[].daystring—
data.traffic[].llm_botintegersame shape as: search_bot, social_bot, seo_bot, ai_referred
data.conversionsobject[]—
data.conversions[].daystring—
data.conversions[].totalintegersame shape as: ai
data.providersobject[]—
data.providers[].daystringsame shape as: provider
data.providers[].viewsinteger—
data.conversion_eventsobject[]—
data.conversion_events[].daystringsame shape as: event
data.conversion_events[].totalintegersame shape as: ai

Example response

{
  "success": true,
  "data": {
    "traffic": [
      {
        "day": "2026-09-27",
        "llm_bot": 12,
        "search_bot": 8,
        "social_bot": 1,
        "seo_bot": 4,
        "ai_referred": 6
      }
    ],
    "conversions": [
      {
        "day": "2026-09-27",
        "total": 3,
        "ai": 1
      }
    ],
    "providers": [
      {
        "day": "2026-09-27",
        "provider": "openai",
        "views": 9
      }
    ],
    "conversion_events": [
      {
        "day": "2026-09-27",
        "event": "signup",
        "total": 2,
        "ai": 1
      }
    ]
  }
}
POST /analytics/webpage-analytics

Get Webpage Analytics

Get paginated webpage analytics with bot/user traffic, citations, conversions

🔒 Requires Authorization: Bearer ll_… (or X-API-Key).

Request body· WebpageAnalyticsQuery

FieldTypeRequiredDescription
website_idstringYes—
pageintegerNo—
page_sizeintegerNo—
group_tagstring | nullNo—
search_querystring | nullNo—
sort_byWebpageAnalyticsSortByNoSort options for webpage analytics.
comparison_periodComparisonPeriodNoComparison period for trend calculations.
time_frame_daysintegerNo—
exclude_system_pagesbooleanNo—

Example request

curl -X POST "https://api.lunalift.ai/analytics/webpage-analytics" \
  -H "Authorization: Bearer ll_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "website_id": "string"
}'

Response · 200 OK

Returns a JSON object on success.

GET /analytics/website-analytics/{company_id}

Resolve a company's website and schema analytics

Return the website record and schema/page analytics for a company. Use this to confirm a company's website has been added (a prerequisite for traffic data) and to resolve the underlying website the traffic endpoints report on. The company must have completed onboarding (a website added, plus at least one confirmed topic and one executed prompt) before analytics return data. Pass a `companyId` from `POST /user/user-checkin`.

🔒 Requires Authorization: Bearer ll_… (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYes—

Example request

curl -X GET "https://api.lunalift.ai/analytics/website-analytics/COMPANY_ID" \
  -H "Authorization: Bearer ll_your_api_key"

Response · 200 OK

FieldTypeNotes
successboolean—
dataobject—
data.website_idstringsame shape as: company_id
data.pagesany[]—
data.schema_summaryobject—

Example response

{
  "success": true,
  "data": {
    "website_id": "018f8c1a-0000-7000-8000-000000000def",
    "company_id": "018f8c1a-0000-7000-8000-000000000abc",
    "pages": [],
    "schema_summary": {}
  }
}
GET /analytics/website-health/{company_id}

Get Website Health

Returns the website health score overview for a company: - Health score history (last 90 days, daily average) - Best 3 and worst 3 pages by current health score - Top 3 features to improve (benchmarked against global citation-page distributions) with 3 worst example pages per feature

🔒 Requires Authorization: Bearer ll_… (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYes—

Example request

curl -X GET "https://api.lunalift.ai/analytics/website-health/COMPANY_ID" \
  -H "Authorization: Bearer ll_your_api_key"

Response · 200 OK

Returns a JSON object on success.

GET /analytics/score-distributions/{company_id}

Get Score Distributions

Returns the latest precomputed score distributions for the given company and optional source_type, in two layers: - global: distribution across all top-cited pages (no company filter) - company: distribution across pages cited for this company's tracked prompts Falls back to source_type=None (all types combined) when fewer than 10 pages exist for the requested source_type.

🔒 Requires Authorization: Bearer ll_… (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYes—

Query parameters

NameTypeRequiredDefaultDescription
source_typeSourceType | nullNo——

Example request

curl -X GET "https://api.lunalift.ai/analytics/score-distributions/COMPANY_ID" \
  -H "Authorization: Bearer ll_your_api_key"

Response · 200 OK

Returns a JSON object on success.