API Conventions¶
This document outlines the general conventions and standards used across the INDstocks API.
Requests & Responses¶
- Base URL: The root for all API requests is
https://api.indstocks.com. - Data Format: All request bodies and responses are in
JSONformat. - Timestamps: All timestamps in requests and responses are in IST and represented in Unix epoch milliseconds, unless specified otherwise.
- HTTP Verbs: We use standard HTTP verbs to indicate actions:
GET: To retrieve resources.POST: To create new resources.
Authentication¶
All protected API endpoints require an access_token to be included in the Authorization header of your request.
- Header Format:
Authorization: <your_access_token>
Refer to the Users section for details on how to obtain an access token.
Error Handling¶
We use standard HTTP status codes to indicate the success or failure of an API request. - 2xx codes indicate success. - 4xx codes indicate a client-side error (e.g., invalid parameters, authentication failure). - 5xx codes indicate a server-side error.
In addition to the HTTP status code, error responses include a JSON body with specific details:
{
"status": "error",
"message": "A human-readable error message.",
"error_code": "INVALID_INPUT"
}
Rate Limiting¶
The API enforces rate limits to ensure high availability for all users. Limits are applied based on the category of the API endpoint.
Exceeding these limits will result in a 429 Too Many Requests error.
| Category | Rate Limit per Second | Rate Limit per Minute | Rate Limit per Hour | Rate Limit per Day | Notes |
|---|---|---|---|---|---|
| Order APIs | 10 | - | - | - | Max 25 modifications per order. |
| Data APIs | 5 | - | - | 100,000 | |
| Quote APIs | 5 | - | - | 100,000 | |
| Non-Trading APIs | 15 | - | - | 100,000 | Includes Profile, Funds, Order History, etc. |
| WebSocket Connections | - | - | - | - | Up to 3 active connections per user. |
| WebSocket Subscriptions | - | - | - | - | Up to 3000 instruments per connection. |