Skip to main content
All API endpoints require authentication using an API key.

Using Your API Key

Include your API key in the X-API-Key header with every request:
curl -X POST "https://api.yourservice.com/tiktok/posts" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"username": "charlidamelio", "limit": 10}'

Code Examples

import requests

headers = {
    "X-API-Key": "your-api-key",
    "Content-Type": "application/json"
}

response = requests.post(
    "https://api.yourservice.com/tiktok/posts",
    headers=headers,
    json={"username": "charlidamelio", "limit": 10}
)

data = response.json()

Error Responses

Missing API Key

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "API key is required"
  }
}

Invalid API Key

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid API key"
  }
}

Insufficient Credits

{
  "success": false,
  "error": {
    "code": "PAYMENT_REQUIRED",
    "message": "Insufficient credits"
  }
}

Best Practices

Don’t include your API key in client-side code or public repositories
Store your API key in environment variables, not in code
If you suspect unauthorized access, rotate your keys immediately
Check your dashboard regularly to detect anomalies