Quick Start
Get your first API call working in 5 minutes.
Prerequisites
- A Sealmetrics account with at least one site
- An API key (generate in Settings → API Tokens)
- Your account ID (found in Settings → Account)
Step 1: Get Your API Key
- Log in to Sealmetrics Dashboard
- Go to Settings → API Tokens
- Click Create Token
- Copy the token (starts with
sm_)
warning
Store your API key securely. It will only be shown once.
Step 2: Find Your Account ID
- Go to Settings → Account
- Copy the Account ID (e.g.,
acme-corp)
Step 3: Make Your First Request
Using cURL
curl -X GET "https://my.sealmetrics.com/api/v1/stats/overview?site_id=YOUR_ACCOUNT_ID&period=7d" \
-H "X-API-Key: sm_your_api_key_here"
Using Python
import requests
API_KEY = "sm_your_api_key_here"
ACCOUNT_ID = "your-account-id"
response = requests.get(
"https://my.sealmetrics.com/api/v1/stats/overview",
headers={"X-API-Key": API_KEY},
params={
"site_id": ACCOUNT_ID,
"period": "7d"
}
)
print(response.json())
Using JavaScript
const API_KEY = 'sm_your_api_key_here';
const ACCOUNT_ID = 'your-account-id';
const params = new URLSearchParams({
site_id: ACCOUNT_ID,
period: '7d'
});
const response = await fetch(
`https://my.sealmetrics.com/api/v1/stats/overview?${params}`,
{
headers: { 'X-API-Key': API_KEY }
}
);
const data = await response.json();
console.log(data);
Step 4: Check the Response
A successful response looks like:
{
"data": {
"entrances": 12543,
"page_views": 28976,
"engaged_entrances": 7234,
"bounce_rate": 42.3,
"conversions": 156,
"revenue": 12450.00,
"microconversions": 892
}
}
Check the rate limit headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1704067200
Common Use Cases
Get Top Pages
curl "https://my.sealmetrics.com/api/v1/stats/pages?site_id=YOUR_ACCOUNT_ID&period=30d&page_size=10" \
-H "X-API-Key: sm_your_api_key_here"
Get Traffic Sources
curl "https://my.sealmetrics.com/api/v1/stats/sources?site_id=YOUR_ACCOUNT_ID&period=30d" \
-H "X-API-Key: sm_your_api_key_here"
Get Conversions
curl "https://my.sealmetrics.com/api/v1/stats/conversions?site_id=YOUR_ACCOUNT_ID&period=30d" \
-H "X-API-Key: sm_your_api_key_here"
Get Funnel Data
curl "https://my.sealmetrics.com/api/v1/stats/funnel?site_id=YOUR_ACCOUNT_ID&period=30d" \
-H "X-API-Key: sm_your_api_key_here"
Get Geographic Data
curl "https://my.sealmetrics.com/api/v1/stats/geo/countries?site_id=YOUR_ACCOUNT_ID&period=30d" \
-H "X-API-Key: sm_your_api_key_here"
Troubleshooting
401 Unauthorized
{
"error": {
"code": "invalid_api_key",
"message": "The provided API key is invalid or has been revoked"
}
}
Solution: Check that your API key is correct and hasn't been revoked.
403 Forbidden
{
"error": {
"code": "forbidden",
"message": "Access denied to account: acme-corp"
}
}
Solution: Verify your API token has access to the specified account.
404 Not Found
{
"error": {
"code": "not_found",
"message": "Account not found"
}
}
Solution: Verify your account ID is correct.
429 Too Many Requests
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Please retry after 15 seconds."
}
}
Solution: Wait for the Retry-After seconds and reduce request frequency.
Next Steps
- Authentication - Learn about API keys and JWT tokens
- Rate Limits - Understand limits per plan
- Stats Endpoints - Complete analytics endpoint reference
- Sites - Manage sites and settings