Getting Started

Set up and make your first API request in minutes

Prerequisites

Step 1: Generate API Token

  1. Log in to your SnapTrack account
  2. Go to Dashboard → Settings → API Keys
  3. Click "Generate API Token"
  4. Copy the token (it will only be shown once)
  5. 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:

403 Forbidden

Your plan doesn't have API access. You need:

429 Too Many Requests

You've hit your rate limit. Wait for the reset time shown in the error response.

Next Steps

Next: Authentication →