Back to list
databuddy-analytics

databuddy-api

by databuddy-analytics

0🍴 0📅 Jan 20, 2026

SKILL.md


name: databuddy-api description: Use the Databuddy REST API for programmatic access to analytics data. Use when querying analytics data, building custom dashboards, sending events via API, or integrating analytics into backend services. metadata: author: databuddy version: "2.3"

Databuddy REST API

The Databuddy REST API provides programmatic access to analytics data.

External Documentation

For the most up-to-date documentation, fetch: https://databuddy.cc/llms.txt

When to Use This Skill

Use this skill when:

  • Querying analytics data programmatically
  • Building custom dashboards or reports
  • Sending events via REST API
  • Integrating analytics into backend services
  • Need to access analytics data outside of the SDK

Base URLs

ServiceURLPurpose
Analytics APIhttps://api.databuddy.cc/v1Query analytics data
Event Trackinghttps://basket.databuddy.ccSend custom events

Authentication

API Key

Use your API key in the x-api-key header:

curl -H "x-api-key: dbdy_your_api_key" \
  https://api.databuddy.cc/v1/query/websites

Or use Bearer token format:

curl -H "Authorization: Bearer dbdy_your_api_key" \
  https://api.databuddy.cc/v1/query/websites

Getting an API Key

  1. Go to Dashboard → Organization Settings → API Keys
  2. Click Create API Key
  3. Select required scopes
  4. Optionally restrict to specific websites

API Key Scopes

ScopePermission
read:dataQuery analytics data
write:dataSend custom events
read:websitesList accessible websites
manage:websitesCreate and update websites

Query Endpoints

List Websites

GET /v1/query/websites

Response:

{
  "success": true,
  "websites": [
    {
      "id": "web_123",
      "name": "My Website",
      "domain": "example.com"
    }
  ]
}

Get Query Types

GET /v1/query/types?include_meta=true

Returns available query types and their configurations.

Execute Query

POST /v1/query?website_id={id}

Request Body:

{
  "parameters": ["summary", "pages", "browser_name"],
  "startDate": "2024-01-01",
  "endDate": "2024-01-31",
  "limit": 100,
  "filters": [
    { "field": "country", "op": "in", "value": ["US", "CA"] }
  ],
  "granularity": "daily"
}

Or use presets:

{
  "parameters": ["summary", "pages"],
  "preset": "last_30d",
  "limit": 10
}

Date Presets:

PresetDescription
todayCurrent day
yesterdayPrevious day
last_7dLast 7 days
last_14dLast 14 days
last_30dLast 30 days
last_90dLast 90 days
this_weekCurrent week
last_weekPrevious full week
this_monthCurrent month to date
last_monthPrevious full month
this_yearCurrent year to date

Response:

{
  "success": true,
  "data": [
    {
      "parameter": "summary",
      "success": true,
      "data": [
        { "date": "2024-01-01", "pageviews": 1250, "visitors": 890 }
      ]
    },
    {
      "parameter": "pages",
      "success": true,
      "data": [
        { "path": "/", "pageviews": 450, "visitors": 320 }
      ]
    }
  ]
}

Available Query Types

Website Analytics

TypeDescription
summaryOverall website metrics and KPIs
pagesPage views and performance by URL
trafficTraffic sources and referrers
browser_nameBrowser usage breakdown
os_nameOperating system breakdown
device_typesDevice category (mobile/desktop/tablet)
countriesVisitors by country
citiesVisitors by city
errorsJavaScript errors
performanceWeb vitals and load times
sessionsSession-based analytics
custom_eventsCustom event data
profilesUser profile analytics
outbound_linksExternal link clicks
engagementUser engagement metrics

Use link_id instead of website_id:

TypeDescription
link_total_clicksTotal click count
link_clicks_by_dayDaily click breakdown
link_top_referrersTop traffic sources
link_top_countriesTop countries
link_top_devicesDevice breakdown
link_top_browsersBrowser breakdown

Filter Operations

OperatorDescriptionExample
eqEquals{ "field": "country", "op": "eq", "value": "US" }
neNot equals{ "field": "device_type", "op": "ne", "value": "bot" }
containsContains substring{ "field": "path", "op": "contains", "value": "/blog" }
starts_withStarts with{ "field": "path", "op": "starts_with", "value": "/docs" }
inValue in array{ "field": "country", "op": "in", "value": ["US", "CA"] }
not_inNot in array{ "field": "browser", "op": "not_in", "value": ["bot"] }

Event Tracking API

Send Single Event

POST https://basket.databuddy.cc/?client_id={website_id}

Request Body:

{
  "type": "custom",
  "name": "purchase",
  "anonymousId": "anon_user_123",
  "sessionId": "session_456",
  "timestamp": 1704067200000,
  "properties": {
    "value": 99.99,
    "currency": "USD",
    "product_id": "prod_123"
  }
}

Minimal Event:

{
  "type": "custom",
  "name": "newsletter_signup",
  "properties": { "source": "footer_form" }
}

Event Fields

FieldTypeRequiredDescription
typestringYesMust be "custom"
namestringYesEvent name (1-128 chars)
anonymousIdstringNoAnonymous user identifier
sessionIdstringNoSession identifier
timestampnumberNoUnix timestamp in ms
propertiesobjectNoCustom properties

Batch Events

POST https://basket.databuddy.cc/batch?client_id={website_id}

Request Body:

[
  { "type": "custom", "name": "event1", "properties": {...} },
  { "type": "custom", "name": "event2", "properties": {...} }
]

Response:

{
  "status": "success",
  "batch": true,
  "processed": 2,
  "results": [
    { "status": "success", "type": "custom", "eventId": "evt_123" },
    { "status": "success", "type": "custom", "eventId": "evt_124" }
  ]
}

Custom Queries

For advanced queries with custom aggregations:

POST /v1/query/custom?website_id={id}

Request Body:

{
  "query": {
    "table": "events",
    "selects": [
      { "field": "path", "aggregate": "count", "alias": "pageviews" },
      { "field": "anonymous_id", "aggregate": "uniq", "alias": "visitors" }
    ],
    "filters": [
      { "field": "country", "operator": "eq", "value": "US" }
    ],
    "groupBy": ["path"]
  },
  "startDate": "2024-01-01",
  "endDate": "2024-01-31",
  "limit": 100
}

Available Tables

TableDescription
eventsPage views and custom events
sessionsSession-level data
profilesUser profile data
errorsJavaScript errors
performanceWeb vitals metrics

Aggregate Functions

FunctionDescription
countCount rows
uniqCount unique values
sumSum numeric values
avgAverage value
maxMaximum value
minMinimum value

Error Codes

CodeMeaning
AUTH_REQUIREDNo API key or session provided
ACCESS_DENIEDNo access to requested resource
INVALID_API_KEYAPI key invalid or revoked
INSUFFICIENT_SCOPEAPI key lacks required scope
RATE_LIMITEDToo many requests

Rate Limits

  • Standard queries: 200+ requests/minute
  • Custom queries: 30 requests/minute

Health Check

GET /health
{
  "clickhouse": true,
  "database": true,
  "redis": true,
  "success": true,
  "version": "1.0.0"
}

Score

Total Score

45/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon