Skip to content

Commit 0b42a3d

Browse files
committed
feat: API key section
1 parent 2891064 commit 0b42a3d

File tree

4 files changed

+161
-120
lines changed

4 files changed

+161
-120
lines changed

apps/docs/content/docs/api.mdx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,30 @@ description: Complete API reference for Databuddy analytics endpoints
77

88
Access your analytics data programmatically with Databuddy's REST API. All endpoints require authentication and are rate-limited for security.
99

10-
## 🔐 Authentication
10+
import { Callout } from "fumadocs-ui/components/callout";
1111

12-
All API requests require authentication using your API key. You can use either header:
12+
<Callout type="info">
13+
**🚀 Try it live!** Test all these endpoints interactively in our [API
14+
Playground](/api) with real data and see instant responses. Perfect for
15+
exploring query types and understanding the API structure.
16+
</Callout>
1317

14-
```bash
15-
curl -H "Authorization: Bearer YOUR_API_KEY" \
16-
https://api.databuddy.cc/v1/analytics
17-
```
18+
## 🔐 Authentication
1819

19-
Or:
20+
All API requests require authentication using your API key in the `X-Api-Key` header:
2021

2122
```bash
22-
curl -H "x-api-key: YOUR_API_KEY" \
23-
https://api.databuddy.cc/v1/analytics
23+
curl -H "X-Api-Key: YOUR_API_KEY" \
24+
https://api.databuddy.cc/v1/query
2425
```
2526

2627
Get your API key from your [dashboard settings](https://app.databuddy.cc/settings/api). Learn more about scopes and resource access on the [API Keys](../api-keys) page.
2728

29+
<Callout type="tip">
30+
**Test your API key** instantly in the [API Playground](/api) - no need to
31+
write code first!
32+
</Callout>
33+
2834
## 📊 Analytics Endpoints
2935

3036
### Get Website Analytics
@@ -46,7 +52,7 @@ GET /v1/websites/{website_id}/analytics
4652
**Example:**
4753

4854
```bash
49-
curl -H "Authorization: Bearer YOUR_API_KEY" \
55+
curl -H "X-Api-Key: YOUR_API_KEY" \
5056
"https://api.databuddy.cc/v1/websites/web_123/analytics?start_date=2024-01-01&end_date=2024-01-31&granularity=day"
5157
```
5258

0 commit comments

Comments
 (0)