Overview
The SG Cars Trends API uses Bearer Token authentication for secure access to protected endpoints. Most API endpoints require authentication, with the exception of health checks and some workflow endpoints.API Key Requirements
Protected Endpoints
- All
/v1/*
endpoints (cars, coe, months data) /workflows/trigger
endpoint
Public Endpoints
/health
endpoint- Individual workflow endpoints (
/workflows/cars
,/workflows/coe
) - Social media webhook endpoints
Getting Your API Key
API keys are currently issued on a case-by-case basis. To request an API key:
- Create an issue in our GitHub repository
- Describe your use case and expected usage volume
- Provide your contact information
- Wait for approval and key issuance
Using Your API Key
Bearer Token Format
Include your API key in theAuthorization
header using the Bearer token format:
Request Examples
Authentication Errors
Common Error Responses
Rate Limiting
The API implements rate limiting based on your authentication status:Authentication Status | Rate Limit | Window |
---|---|---|
Authenticated | 100 requests | 1 minute |
Unauthenticated | 10 requests | 1 minute |
Rate Limit Headers
Rate limit information is included in response headers:Rate Limit Exceeded
When you exceed the rate limit, you’ll receive a429 Too Many Requests
response:
Best Practices
1. Secure Storage
Never expose your API key in client-side code, public repositories, or logs.
- Store API keys in environment variables
- Use secure key management systems
- Rotate keys regularly
- Hardcode keys in your application
- Commit keys to version control
- Share keys in plain text