Skip to main content

Developers API

Home / Developers API / API Overview

Developers API

API Overview

The Developer API is a suite of REST and WebSocket endpoints that lets you:

  • Integrate trading workflows (placing, modifying, and cancelling orders).
  • Fetch market data (real-time quotes, historical candlesticks, etc.).
  • Access and manage account details (positions, balances, etc.).

Key Features

  • Security & Authentication: Token-based auth ensures secure data exchanges.
  • Real-Time Events: WebSocket channels provide immediate updates on market moves and order statuses.
  • Developer-Centric: Standardised JSON responses, consistent error structures, and detailed reference docs.

This API forms the backbone for building custom trading applications, algorithmic strategies, or specialised dashboards—empowering developers to craft unique user experiences around robust brokerage infrastructure.


Request & Response

Firstock APIs generally communicate via JSON-encoded messages over HTTPS (for REST) or WSS (for WebSockets). Understanding how requests and responses are structured is crucial for smooth integrations.

Request Structure

  • HTTP Method: Typically POST for data-altering operations (order placement, modifications) and GET or POST for data retrieval (varies by endpoint).
  • Headers:
    • Content-Type: application/json
    • Additional headers if required (e.g., authentication tokens).
  • Body: Usually a JSON object containing fields like userId, jKey, plus endpoint-specific parameters (tradingSymbol, exchange, etc.).

Response Format

  • status: success or failed.
  • message: A short, human-readable note about the outcome (e.g., "Order placed successfully").
  • data (on success): Includes payload relevant to the call, such as quotes, order details, or expiry lists.
  • error (on failure): If status = "failed", an error object details which field or parameter caused the issue.

Reference: For a deeper look at real examples, see the official Request & Response documentation.


Rate Limit

To ensure service stability and fair usage, there is a rate limit of 10 requests per second per user/account. If your client application exceeds this threshold, you may receive a code = "429" (Too Many Requests) error response.

Best Practices for Rate Limit

  1. Throttling: Implement client-side logic to queue or delay requests if you’re nearing the 10-per-second threshold.
  2. Batching: Use multi-quote or multi-scrip endpoints where available, reducing separate calls.
  3. Backoff Strategy: On a 429 response, wait briefly before retrying to avoid subsequent throttling.

Keeping within 10 requests per second ensures you don’t trigger rate-limit errors and helps maintain a reliable experience for all users.


Versioning

Firstock employs a versioning strategy that delivers new features, performance upgrades, and security enhancements with minimal disruption to existing integrations. Each iteration is typically labeled (e.g., V3, V4, or the new Developer v1 approach).

Key Versioning Principles

  • Backward Compatibility: Most older endpoints remain functional, reducing major refactor needs when upgrading.
  • Incremental Changes: Performance improvements and new endpoints appear in the latest version (e.g., Developer v1).
  • Minimal Breaking Changes: Breaking changes are clearly documented, with recommended migration paths.

Why Upgrade

  • Faster Data Throughput: New releases often bring improved architecture for lower latency.
  • Enhanced Security: Updated encryption, token flows, or session handling.
  • Modern Features: WebSocket expansions, new order types, or advanced analytics endpoints.

For a detailed timeline of changes and upgrading guidelines, see the Versioning doc.


Conclusion

The Developer API is a powerful gateway for integrating advanced trading functionalities into your applications. By adhering to request/response standards, respecting the 10 requests/second rate limit, and staying aware of versioning best practices, you can create stable, high-performance trading solutions. For more information on error handling or advanced features, see the official Exception & Error Handling doc or explore specialised endpoints in the reference documentation.

Footer

Take control of your wealth with Firstock. Track your investments, trade wisely—all in one easy-to-use platform.

Download the App now

Invest in Stocks, Mutual Funds, IPOs, Bonds, ETFs & Futures, Options,

© 2025 Firstock. All rights reserved.

Firstock Broking Pvt Ltd

  • No 350,1st Floor, 36th A Cross 7th Main Rd 5th Block Jayanagar, Bengaluru, KA 560041.
  • NSE​ &​ BSE – SEBI Registration No.: INZ000260334
  • CDSL: Depository services – SEBI Registration No.: IN-DP-67-2015 Mutual Fund ARN: 132812
  • For any complaints pertaining to securities broking please write to complaints@firstock.in for DP related to depository@firstock.in Please ensure you carefully read the Risk Disclosure Document as prescribed by SEBI.

    Attention Investors:

    Investments in the securities market are subject to market risks. Please read all related documents carefully before investing.

    Prevent Unauthorized Transactions in Your Trading/Demat Account:
    Update your mobile number and email ID with your stock broker or depository participant. Receive alerts and information about your transactions on your registered mobile number/email for all debit and other important transactions in your trading/demat account directly from the Exchange/CDSL on the same day.

    KYC is a one-time exercise while dealing in the securities market.
    Once KYC is completed through a SEBI-registered intermediary (broker, DP, mutual fund, etc.), you do not need to undergo the same process again when approaching another intermediary.

    No need to issue cheques when subscribing to an IPO.
    Simply write your bank account number and sign the application form to authorize your bank to make the payment in case of allotment. There is no worry about refunds, as the money remains in the investor's account.

    Procedure to file a complaint on SCORES (Easy & Quick): Register on the SCORES portal and keep the following mandatory details ready: Name, PAN, Address, Mobile Number, and Email ID.

    Benefits: Effective communication and speedy redressal of grievances.{" "}

    Dear Investor,

    If you are subscribing to an IPO, there is no need to issue a cheque. Please write your bank account number and sign the IPO application form to authorize your bank to make the payment in case of allotment. In case of non-allotment, the funds will remain in your bank account. As a business, we do not provide stock tips and have not authorized anyone to trade on behalf of others.

    Important:

    Stock brokers can accept securities as margin from clients only by way of a pledge in the depository system w.e.f. September 1, 2020.

    Update your email ID and mobile number with your stock broker or depository participant and receive OTPs directly from the depository on your registered email ID and/or mobile number to create pledges.

    Check your securities, mutual funds, and bonds in the consolidated account statement issued by NSDL/CDSL every month.

    Disclaimer:

    The Stock Exchange, Mumbai, is not in any manner answerable, responsible, or liable to any person for any acts of omission or commission, errors, mistakes, and/or violations—actual or perceived—by us or our partners, agents, associates, etc., of any rules, regulations, by-laws of the Stock Exchange, SEBI Act, or any other laws in force from time to time.

    The Stock Exchange, Mumbai, is not responsible or liable for any information on this website or for any services rendered by our employees or representatives. Please refer to BSE compliance for more details.

    Investor Alert:

    Investors are requested to note that stock broker Firstock Broking Private Limited (Firstock) is permitted to receive/pay money from/to investors only through designated bank accounts, named as "client bank accounts."

    Firstock is also required to disclose these client bank accounts to the Stock Exchange.

    Hence, you are requested to use only the following client bank accounts for any transactions in your trading account with us. The details of these accounts are also displayed by the Stock Exchanges on their website under “Know / Locate Your Stock Broker.”