Sites
The Sites endpoint returns a list of all websites you've added to AttractOS. Each site includes its unique ID (for other API calls), domain, tracking key, and current month's event count.
GET
/api/v1/sites List all sites associated with your account
Request
No query parameters required.
List Sites
curl -X GET "https://attractos.com/api/v1/sites" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('https://attractos.com/api/v1/sites', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
},
});
const data = await response.json();
console.log(data.sites);import requests
response = requests.get(
'https://attractos.com/api/v1/sites',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
for site in data['sites']:
print(f"{site['domain']}: {site['events_this_month']} events") Response
Response
200{
"sites": [
{
"id": "site_abc123",
"domain": "example.com",
"key": "ak_xyz789",
"events_this_month": 4523,
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": "site_def456",
"domain": "blog.example.com",
"key": "ak_uvw012",
"events_this_month": 1287,
"created_at": "2024-02-01T14:22:00.000Z"
}
]
} Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique site identifier. Use this in other API endpoints. |
domain | string | The website domain (e.g., "example.com") |
key | string | Site tracking key for the client-side script |
events_this_month | integer | Total events tracked in the current billing month |
created_at | string | ISO 8601 timestamp when the site was added |
Errors
401 MISSING_KEY No Authorization header provided 401 INVALID_KEY API key is invalid or revoked 429 RATE_LIMITED Too many requests Frequently Asked Questions
How many sites can I track?
Free accounts can track up to 3 sites. Pro accounts have unlimited sites.
What is the site key used for?
The site key (
ak_...) is used in the client-side tracking script to identify which site events belong to. It's safe to expose publicly.How do I add a new site?
Sites are added through the dashboard at attractos.com/dashboard/add-site. There is no API endpoint for creating sites.