Getting Started
Set up and make your first API request in minutes
Prerequisites
- A SnapTrack account (sign up at https://snaptrack.dev)
- A subscription plan with API access (Starter or higher)
- API token (generated from Settings → API Keys)
Step 1: Generate API Token
- Log in to your SnapTrack account
- Go to Dashboard → Settings → API Keys
- Click "Generate API Token"
- Copy the token (it will only be shown once)
- Save it in a secure location
Important: Never share your API token publicly or commit it to version control. Treat it like a password.
Step 2: Base URL
All API requests should be made to:
https://api.snaptrack.dev
Note: Always use HTTPS in production. HTTP requests will be rejected.
Step 3: Make Your First Request
Using cURL
curl -X GET https://api.snaptrack.dev/test \
-H "Authorization: Bearer YOUR_API_TOKEN"Using JavaScript
const token = 'YOUR_API_TOKEN';
fetch('https://api.snaptrack.dev/test', {
headers: {
'Authorization': `Bearer ${token}`
}
})
.then(r => r.json())
.then(data => console.log(data));Using Python
import requests
token = 'YOUR_API_TOKEN'
headers = {'Authorization': f'Bearer {token}'}
response = requests.get(
'https://api.snaptrack.dev/test',
headers=headers
)
print(response.json())Step 4: Verify Your Setup
If successful, you'll see a response like:
{
"success": true,
"message": "API is working correctly",
"user": {
"id": 1,
"name": "Your Name",
"email": "[email protected]",
"subscription_tier": "pro"
},
"api": {
"can_access": true,
"rate_limit_per_minute": 20,
"requests_remaining": 19
}
}Common Issues
401 Unauthorized
Your API token is invalid or missing. Check:
- Token is correct (copy from settings page)
- Authorization header format: Bearer YOUR_TOKEN
- No extra spaces in the header
403 Forbidden
Your plan doesn't have API access. You need:
- Starter plan or higher
- Active subscription
- Non-expired subscription
429 Too Many Requests
You've hit your rate limit. Wait for the reset time shown in the error response.
SnapTrack API