Learn how to authenticate with the Trakkr API using API keys
Authorization
Authorization: Bearer YOUR_API_KEY
curl -X POST https://api.trakkr.ai/get-scores \ -H "Authorization: Bearer sk_live_1234567890abcdef" \ -H "Content-Type: application/json" \ -d '{ "brand": "0000000000000x000000000000000000", "breakdown": ["model"] }'
sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
{ "error": "Missing API key", "errors": ["API key must be provided in the Authorization header as 'Bearer <api_key>'"] }
401 Unauthorized
{ "error": "Invalid API key", "errors": ["No accounts found for this API key"] }
403 Forbidden
{ "error": "Authentication error", "errors": ["Could not validate API key against database"] }
500 Internal Server Error
# .env file TRAKKR_API_KEY=sk_live_1234567890abcdef
// JavaScript const apiKey = process.env.TRAKKR_API_KEY;
# Python import os api_key = os.environ.get('TRAKKR_API_KEY')
Was this page helpful?