Documentation
API Keys
API keys are used to authenticate requests to the CS2Cap API. You can manage your API keys in your account dashboard.
Key Types
| Type | Prefix | Usage |
|---|---|---|
| Live | cs2cap_live_ | Production environment |
| Test | cs2cap_test_ | Development/testing |
Using Your API Key
Include your API key in the Authorization header of every request:
Authorization: Bearer YOUR_API_KEY
Example Request
cURL
curl -X GET "https://api.cs2cap.com/v1/items/ak47-redline-ft" \ -H "Authorization: Bearer cs2cap_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json"
Security Best Practices
- Never expose your API keys in client-side code or public repositories
- Use environment variables to store your keys securely
- Rotate your keys periodically and immediately if compromised
- Use test keys during development and live keys only in production
Authentication Errors
If authentication fails, the API returns one of these error codes:
| Status | Code | Description |
|---|---|---|
| 401 | unauthorized | Missing or invalid API key |
| 403 | forbidden | Key lacks required permissions |
| 429 | rate_limited | Rate limit exceeded |