Skip to main content

API

REST API for querying analytics data and managing your Sealmetrics account programmatically.

SpecificationValue
Base URLhttps://my.sealmetrics.com/api/v1
ProtocolHTTPS only
FormatJSON
AuthenticationAPI Key or JWT Bearer token
Rate LimitsPer-plan (see Rate Limits)
Documentation/docs (Swagger UI)

Quick Start

curl -X GET "https://my.sealmetrics.com/api/v1/stats/overview?site_id=YOUR_SITE_ID&period=7d" \
-H "X-API-Key: sm_your_api_key_here"

Response:

{
"data": {
"entrances": 12543,
"page_views": 28976,
"engaged_entrances": 7234,
"bounce_rate": 42.3,
"conversions": 156,
"revenue": 12450.00,
"microconversions": 892
}
}

API Sections

Analytics Data

EndpointMethodDescription
/stats/overviewGETDashboard overview with all key metrics
/stats/pagesGETPage metrics with pagination
/stats/mediumsGETTraffic by UTM medium
/stats/sourcesGETTraffic by UTM source
/stats/campaignsGETTraffic by UTM campaign
/stats/termsGETTraffic by UTM term
/stats/contentsGETTraffic by UTM content
/stats/referrersGETReferrer domain traffic
/stats/geo/countriesGETGeographic breakdown
/stats/devicesGETDevice, browser, OS breakdown

Site Management

EndpointMethodDescription
/sitesGET, POSTList and create sites
/sites/{id}GET, PATCH, DELETEManage specific site
/sites/{id}/domainsGET, POST, DELETEAuthorized domains
/sites/{id}/utm-mappingsGET, POST, PATCH, DELETEUTM parameter mappings
/sites/{id}/pixelGETGet tracking pixel code
/sites/{id}/pixel/statusGETCheck pixel installation

Organizations

EndpointMethodDescription
/organizationsGET, POSTList and create organizations
/organizations/{slug}GET, PATCH, DELETEManage specific organization
/organizations/{slug}/membersGET, POST, PATCH, DELETETeam member management
/organizations/{slug}/sitesGETList organization sites
/organizations/{slug}/invitationsGET, POST, DELETEManage invitations

Authentication

EndpointMethodDescription
/auth/tokenPOSTLogin with email/password
/auth/refreshPOSTRefresh access token
/auth/logoutPOSTLogout current session
/auth/meGETGet current user info
/auth/sessionsGET, DELETEManage active sessions
/auth/forgot-passwordPOSTRequest password reset
/auth/reset-passwordPOSTReset password with token

API Tokens

EndpointMethodDescription
/api-tokensGET, POSTList and create API tokens
/api-tokens/{id}GET, DELETEGet or revoke token
/api-tokens/scopesGETList available scopes

Segments

EndpointMethodDescription
/segmentsGET, POSTList and create saved segments
/segments/{id}GET, PUT, DELETEManage specific segment
/segments/{id}/duplicatePOSTDuplicate a segment

Webhooks

EndpointMethodDescription
/webhooksGET, POSTList and create webhook endpoints
/webhooks/{id}GET, PATCH, DELETEManage specific webhook
/webhooks/{id}/testPOSTSend test webhook
/webhooks/{id}/rotate-secretPOSTRotate webhook secret
/webhooks/{id}/deliveriesGETList delivery history
/webhooks/event-typesGETList available event types

Alerts

EndpointMethodDescription
/alerts/rulesGET, POSTList and create alert rules
/alerts/rules/{id}GET, PATCH, DELETEManage alert rule
/alerts/rules/{id}/testPOSTTest alert rule
/alerts/historyGETGet alert history
/alerts/statsGETGet alert statistics

Bulk Exports

EndpointMethodDescription
/exportsGET, POSTList and create export jobs
/exports/{id}GET, DELETEGet or cancel export
/exports/estimatePOSTEstimate export size
/exports/streamPOSTStream small export directly
/exports/download/{token}GETDownload export file

BigQuery Integration

EndpointMethodDescription
/integrations/bigqueryGET, POST, PATCH, DELETEConfigure BigQuery integration
/integrations/bigquery/setupPOSTCreate BigQuery tables
/integrations/bigquery/syncPOSTTrigger manual sync
/integrations/bigquery/backfillPOSTBackfill historical data
/integrations/bigquery/logsGETList sync logs
/integrations/bigquery/schemaGETGet table schema

IP Allowlist

EndpointMethodDescription
/ip-allowlist/settingsGET, PUTManage allowlist settings
/ip-allowlist/patternsGET, POSTList and add IP patterns
/ip-allowlist/patterns/{id}PATCH, DELETEManage specific pattern
/ip-allowlist/patterns/bulkPOSTAdd multiple patterns
/ip-allowlist/checkPOSTValidate an IP address
/ip-allowlist/exportGETExport patterns
/ip-allowlist/importPOSTImport patterns
/ip-allowlist/auditGETAccess audit log

Common Query Parameters

These parameters are available on most analytics endpoints:

ParameterTypeDescriptionExample
site_idstringRequired. Site identifiermy-site
periodstringTime period shortcuttoday, 7d, 30d, 90d
start_datedateStart date (YYYY-MM-DD)2025-01-01
end_datedateEnd date (YYYY-MM-DD)2025-01-31
segmentstringApply saved segment filterspaid-traffic
countrystringFilter by country (ISO 2)ES, US
utm_sourcestringFilter by UTM sourcegoogle
utm_mediumstringFilter by UTM mediumcpc
utm_campaignstringFilter by UTM campaignbrand-2025
comparestringComparison modeprevious, yoy
pageintPage number (default: 1)1
page_sizeintResults per page (default: 50)100
sort_bystringSort fieldentrances, revenue
sort_orderstringSort directionasc, desc

Period Shortcuts

ValueDescription
todayCurrent day
yesterdayPrevious day
7dLast 7 days
30dLast 30 days
90dLast 90 days
12mLast 12 months
this_weekCurrent week
last_weekPrevious week
this_monthCurrent month
last_monthPrevious month
this_quarterCurrent quarter
last_quarterPrevious quarter
this_yearCurrent year
last_yearPrevious year
wtdWeek to date
mtdMonth to date
qtdQuarter to date
ytdYear to date

Response Format

All successful responses wrap data in a data field:

{
"data": {
// Response payload
}
}

Paginated responses include pagination metadata:

{
"data": [...],
"total": 156,
"page": 1,
"page_size": 50,
"has_next": true,
"has_prev": false
}

Error Responses

All errors return JSON with this structure:

{
"error": {
"code": "error_code",
"message": "Human-readable description"
}
}
HTTP CodeError CodeDescription
400bad_requestInvalid parameters
401unauthorizedMissing or invalid authentication
403forbiddenValid auth but insufficient permissions
404not_foundResource does not exist
409conflictResource already exists
429rate_limit_exceededToo many requests
500internal_errorServer error

Documentation