Marfatia Marfatia

What Should You Know About API-Based Algo Trading?

What Should You Know About API-Based Algo Trading?

API-based algo trading allows trading software to communicate with a stockbroker's trading system through an Application Programming Interface (API). This connection can help transmit order instructions generated by predefined trading rules, subject to the broker's systems and applicable exchange requirements.

For retail investors in India, understanding API-based trading involves more than knowing how software connects to a broker. Users should also understand authentication, access permissions, order tracking, security safeguards and the responsibilities of the stockbroker.

This article explains the key concepts and practical considerations of API-based algo trading in India.

1. What Is an API in Algo Trading?

An Application Programming Interface (API) is a set of rules and protocols that allows different software applications to communicate and exchange information.

In trading, a broker may provide API access that allows an authorised application to communicate with its trading system.

For example, an automated strategy may identify a predefined market condition and generate an order instruction. The instruction can then be transmitted through the authorised broker API, subject to the applicable checks and controls.

An API does not independently decide whether a trade is suitable. It provides a communication channel between authorised software and the broker's systems.

2. How Does API-Based Algo Trading Work?

The process generally involves several connected components:

Step 1: Strategy configuration

The user or authorised technology provider configures trading rules, such as entry conditions, exit conditions and order parameters.

Step 2: Market information

The strategy uses available market information to evaluate whether its predefined conditions have been met.

Step 3: Strategy instruction

When the configured conditions are met, the software generates an order instruction.

Step 4: API communication

The authorised application communicates the instruction through the broker's API using the permitted authentication and access arrangement.

Step 5: Broker-side checks

The broker's systems apply relevant validations, risk controls and regulatory checks before an order is transmitted to the exchange.

Step 6: Order status and monitoring

The order status can be reviewed through the broker or platform interface. Depending on the system, users may see pending, executed, partially executed or rejected orders.

The exact workflow depends on the broker, technology provider, strategy arrangement and applicable exchange requirements.

3. What Is the Role of a Stockbroker?

Under SEBI's retail algo trading framework, the stockbroker is the principal for API-based algo trading, while an algo provider or technology vendor acts as its agent when using the broker's API.

The broker has important responsibilities, including:

  • Providing the authorised API access arrangement.

  • Working with empanelled algo providers where applicable.

  • Applying required authentication and access safeguards.

  • Ensuring applicable exchange permissions and algo identification.

  • Monitoring APIs for prohibited activities.

  • Maintaining relevant records and audit trails.

  • Handling investor grievances related to algo trading.

Users should understand which stockbroker provides the trading facility and where to raise order-related or account-related concerns.

4. What API Security Safeguards Should Users Understand?

API access involves communication between software applications and trading systems. Therefore, access control and authentication are important.

SEBI's retail algo trading framework specifies safeguards for broker-provided API access, including:

  • Unique vendor-client-specific API keys.

  • Static IP whitelisting by the broker.

  • OAuth-based authentication.

  • Two-factor authentication.

  • Restrictions on open API access.

These measures are intended to support identification, traceability and controlled access.

Users should follow their broker's authorised API onboarding process. Do not share passwords, OTPs or sensitive credentials with unauthorised persons or services.

5. What Is Static IP Whitelisting?

A static IP address is an internet protocol address that remains fixed rather than changing regularly.

IP whitelisting allows a broker to restrict API access to specified approved IP addresses.

Under the retail algo framework, static IP whitelisting is part of the broker's API access safeguards. However, the precise requirements and permitted arrangements depend on the category of API access and the applicable exchange standards.

In particular, NSE's November 2026 clarification explains that the static IP facility for tech-savvy retail investors is intended for investors who develop their own algorithms using programming knowledge. It should not be treated as a general facility for an algo provider to supply static IP access to ordinary retail clients.

Users should confirm the applicable process with their stockbroker rather than arranging API access through an unverified third party.

6. What Is OAuth Authentication?

OAuth is an authorisation framework that allows an application to access permitted resources without requiring the user to share their account password directly with that application.

In broker API arrangements, OAuth-based authentication is part of the safeguards specified under SEBI's retail algo framework.

Users should understand:

  • Which application is requesting access.

  • What permissions are being requested.

  • How authorisation is granted.

  • How access can be revoked.

  • How additional authentication is completed.

Only authorise applications through the broker's official process.

7. How Are API-Based Algo Orders Identified?

Under SEBI's framework, algo orders originating through broker-provided APIs are required to carry a unique identifier provided by the stock exchange.

This supports the identification and traceability of algorithmic orders.

The framework also requires brokers to identify and categorise orders that meet the applicable criteria for algo orders.

Order tagging and audit trails help exchanges and brokers monitor activity in accordance with the applicable framework.

8. What Risks Are Associated With API-Based Algo Trading?

API connectivity can support automated order communication, but it does not remove trading or technology risks.

Users should understand the following:

Connectivity interruptions: Internet, API or broker-system interruptions can affect communication and order status updates.

Order rejection: An order may be rejected due to validation rules, insufficient funds or margin, price restrictions, quantity limits or other applicable checks.

Partial execution: An order may be executed only partially, depending on available liquidity and market conditions.

Slippage: The actual execution price may differ from the price expected when the strategy generated an instruction.

Strategy errors: Incorrect configuration or faulty logic can generate unintended instructions.

Security risks: Unauthorised access, compromised credentials or misuse of permissions can create operational concerns.

Market risks: Sudden price movements, volatility and liquidity conditions can affect trading outcomes.

Risk controls, monitoring and authentication safeguards can help address certain operational concerns, but they cannot eliminate all risks.

9. What Should You Check Before Enabling API Access?

Before using API-based algo trading, review the following:

  • Confirm the stockbroker providing the API facility.

  • Understand the authorised onboarding procedure.

  • Verify the technology provider's exchange empanelment where applicable.

  • Review the API permissions being requested.

  • Understand authentication and access restrictions.

  • Check how orders are validated and monitored.

  • Understand how rejected and partially executed orders are displayed.

  • Review the process for revoking API access.

  • Understand the complete pricing and brokerage structure.

  • Read the provider's service terms, privacy policy and grievance process.

Avoid using unofficial applications or sharing credentials through informal channels.

10. What Is the Regulatory Framework for API-Based Algo Trading in India?

SEBI issued its circular on safer participation of retail investors in algorithmic trading on 4 February 2025.

The framework sets out the roles and responsibilities of stockbrokers, exchanges and algo providers, along with API safeguards, order identification, provider empanelment and operational requirements.

The framework became applicable to all stockbrokers from 1 April 2026, following the revised implementation timeline.

NSE has also issued implementation standards and subsequent clarifications. Its circular dated 20 November 2026 addresses the permitted use of static IP facilities by tech-savvy retail investors and concerns around misuse of those facilities.

Regulatory requirements may be updated. Users and providers should refer to the latest SEBI and relevant exchange circulars rather than relying only on older API documentation.

11. Exploring API-Based Features Through Marfatia Algo Edge

Marfatia Stock Broking offers Marfatia Algo Edge for retail algorithmic trading.

The official Marfatia website lists features including:

  • No-Code Strategy Builder.

  • Automated Entry, Exit and Stop-Loss.

  • Built-in Risk Controls.

  • Strategy Backtesting.

  • Real-Time Monitoring.

  • Equity, Futures and Options.

The website advertises a ₹0 Algo Platform Charge*.

Users should review the current product terms, broker connectivity arrangements, brokerage tariff, applicable statutory charges and trading risks before using the facility.

Explore Marfatia Algo Edge: https://www.marfatia.net/algo-trading

₹0 refers to the applicable Algo platform charge only. Brokerage, statutory and other applicable charges may apply.

Conclusion

API-based algo trading connects authorised trading software with a stockbroker's systems through defined communication protocols.

Understanding the API workflow, broker responsibilities, authentication safeguards, order identification and technology risks is important before using an automated trading arrangement.

Users should verify the broker's authorised process, understand the provider's role and review the latest SEBI and exchange requirements before enabling API access.

#AlgoTrading #APITrading #APIBasedAlgoTrading #AlgoTradingIndia #TradingAPI #RetailAlgoTrading #TradingTechnology #BrokerConnectivity #SEBIFramework #InvestorEducation #MarfatiaStockBroking

Frequently Asked Questions

What is API-based algo trading?

API-based algo trading uses an Application Programming Interface to allow authorized trading software to communicate with a stockbroker's trading system and transmit order instructions.

Is API trading the same as algo trading?

No. API trading describes the communication method between applications and broker systems. Algo trading involves generating or automating order instructions based on predefined rules. An API can be used to facilitate algorithmic orders.

Is API access available to every retail investor?

Availability depends on the stockbroker's facilities, onboarding process and applicable regulatory requirements. Users should confirm eligibility and access conditions directly with their broker.

What is the purpose of static IP whitelisting?

Static IP whitelisting restricts API access to specified IP addresses. Under the retail algo framework, it supports access control and traceability. NSE's November 2026 clarification also specifies that the static IP facility for tech-savvy retail investors is intended for those who develop their own algorithms using programming knowledge.

Is OAuth authentication required for API-based retail algo trading?

SEBI's retail algo framework specifies OAuth-based authentication and two-factor authentication for broker-provided API access. Users should follow the broker's current authorized authentication process.

Can API-based algo orders be rejected?

Yes. Orders may be rejected because of broker validations, insufficient funds or margin, price or quantity restrictions, connectivity issues or other applicable checks. Automated order instructions do not guarantee execution.

Who is responsible for handling complaints related to API-based algo trading?

Under SEBI's framework, the stockbroker is responsible for handling investor grievances related to algo trading and monitoring APIs for prohibited activities. Users should use the broker's official grievance channels.

Does API-based algo trading remove market risk?

No. API connectivity does not remove market, liquidity, slippage, execution, operational or technology risks. Users should understand the limitations of automated trading before using it.