Getting Started
This guide covers authentication, API key scopes, rate limiting, and error handling for the AltIndex API V2.
Base URL
All API V2 requests use the following base URL:
https://v2.api.altindex.comAuthentication
All API requests (except the root endpoint) require authentication via an API key passed in the X-API-Key header.
Request Header
Include your API key in every request:
X-API-Key: your_api_key_hereAPI Key Format
API keys use a v2_ prefix to distinguish them from legacy V1 keys.
Obtaining an API Key
API keys are issued on a per-client basis. Contact info@altindex.com to discuss your requirements and receive access.
API Key Scopes
API keys can be scoped to limit access to specific endpoints. This enables you to create keys with minimal permissions for different use cases (e.g., a key that only accesses social data).
Scope Format
Scopes follow the pattern category:action:
| Scope | Endpoint | Description |
|---|---|---|
entities:list | GET /api/entities | List and search entities |
entities:detail | GET /api/entities/{ticker} | Get entity details |
social:x | GET /api/social/x/{ticker} | X (Twitter) metrics |
social:instagram | GET /api/social/instagram/{ticker} | Instagram metrics |
social:facebook | GET /api/social/facebook/{ticker} | Facebook metrics |
social:threads | GET /api/social/threads/{ticker} | Threads metrics |
social:tiktok | GET /api/social/tiktok/{ticker} | TikTok metrics |
social:pinterest | GET /api/social/pinterest/{ticker} | Pinterest metrics |
social:youtube | GET /api/social/youtube/{ticker} | YouTube metrics |
social:reddit | GET /api/social/reddit/{ticker} | Reddit metrics |
Wildcard Scopes
Use wildcards for broader access:
| Scope | Description |
|---|---|
* | Full access to all endpoints (default for new keys) |
entities:* | Access to all entity endpoints |
social:* | Access to all social platform endpoints |
Example Scope Configurations
Social-only key (for social media dashboards):
["social:*"]X and Instagram only:
["social:x", "social:instagram"]Entity discovery + specific platforms:
["entities:*", "social:x", "social:reddit"]Insufficient Scope Error
If your API key doesn't have the required scope, you'll receive a 403 Forbidden response:
{
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "API key does not have access to this endpoint. Required scope: social:x",
"request_id": "req_abc123..."
}
}Rate Limiting
Rate limits are enforced on a 24-hour rolling window (not a calendar day reset).
Rate Limit Tiers
Rate limits are tailored to each client's needs. Contact info@altindex.com to discuss your usage requirements.
Rate Limit Exceeded
When you exceed your limit, the API returns a 429 Too Many Requests response:
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Daily request limit exceeded.",
"request_id": "req_abc123..."
}
}Best Practices
- Cache responses when possible
- Use date range filters to reduce data transfer
- Monitor your usage to avoid hitting limits
Error Handling
All errors follow a consistent JSON format with a unique request_id for troubleshooting. Each API Reference page also lists the specific error codes that endpoint can return.
Error Response Format
{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error description",
"request_id": "req_<uuid>"
}
}Error Codes
| HTTP Status | Code | Description |
|---|---|---|
| 401 Unauthorized | MISSING_API_KEY | No API key provided in the X-API-Key header |
| 403 Forbidden | INVALID_API_KEY | API key is invalid or has been revoked |
| 403 Forbidden | INSUFFICIENT_SCOPE | API key does not have permission for this endpoint |
| 404 Not Found | ENTITY_NOT_FOUND | The requested ticker does not exist |
| 429 Too Many Requests | RATE_LIMIT_EXCEEDED | Daily request limit exceeded |
OpenAPI Specification
Download the machine-readable spec: /openapi/v2.json
Next Steps
- Browse the Reference for endpoint details