Groww LogoGroww API

Introduction

Welcome to the Groww Trading API! Our APIs enable you to build and automate trading strategies with seamless access to real-time market data, order placement, portfolio management, and more. Whether you're an experienced algo trader or just starting with automation, Groww's API is designed to be simple, powerful, and developer-friendly.

This SDK wraps our REST-like APIs into easy-to-use Python methods, allowing you to focus on building your trading applications without worrying about the underlying API implementation details.

With the Groww SDK, you can easily execute and modify orders in real time, manage your portfolio, access live market data, and more — all through a clean and intuitive Python interface.

Key Features

  • Trade with Ease: Place, modify, and cancel orders across Equity & F&O.
  • Real-time Market Data: Fetch live market prices, historical data, and order book depth.
  • Secure Authentication: Use industry-standard OAuth 2.0 for seamless and secure access.
  • Comprehensive SDK: Get started quickly with our Python SDK.
  • WebSockets for Streaming: Subscribe to real-time market feeds and order updates.

Getting started:

Step 1: Prerequisites

Trading on Groww using Groww APIs requires:

  • A Groww account.
  • Basic knowledge of Python and REST APIs.
  • A development environment with Python 3.9+ installed.
  • Having an active Trading API Subscription. You can purchase a subscription from this page.

Step 2: Install the Python SDK

You can install the Python SDK by running this command on your terminal/command prompt.

pip install growwapi

Step 3: Authentication

There are two ways you can interact with GrowwAPI:

1st Approach: API Key and Secret Flow

(Uses API Key and Secret — Requires daily approval on Groww Execute Api Keys Page)

Make sure you have the latest SDK version for this. You can upgrade your Python SDK by running this command on your terminal/command prompt.

pip install --upgrade growwapi
  • Go to the Groww Execute API Keys Page.
  • Log in to your Groww account.
  • Click on ‘Generate API key’.
  • Enter the name for the key and click Continue.
  • Copy API Key and Secret. You can manage all your keys from the same page

You can use the generated ‘API key & secret’ to log in via the Python SDK in the following way:

from growwapi import GrowwAPI
import pyotp
 
api_key = "YOUR_API_KEY"
secret = "YOUR_API_SECRET"
 
access_token = GrowwAPI.get_access_token(api_key=api_key, secret=secret)
# Use access_token to initiate GrowwAPi
growwapi = GrowwAPI(access_token)

Logins will expire at 6AM every day, please visit the API keys page and click 'approve' before running login everyday.

2nd Approach: TOTP Flow

(Uses API Key and TOTP — No Expiry)

Make sure you have the latest SDK version for this. You can upgrade your Python SDK by running this command on your terminal/command prompt.

pip install --upgrade growwapi
  • Go to the Groww Execute API Keys Page.
  • Log in to your Groww account.
  • Click on ‘Generate TOTP token’ which is under the dropdown to Generate API Key button.
  • Enter the name for the key and click Continue.
  • Copy the API Key and Secret or scan the QR via a third party authenticator app.
  • You can manage all your keys from the same page.

To use the TOTP flow, you have to install the pyotp library. You can do that by running this command on your terminal/command prompt.

pip install pyotp

You can use the generated ‘API key & secret’ to log in via the Python SDK in the following way:

from growwapi import GrowwAPI
import pyotp
 
api_key = "YOUR_API_KEY"
totp_gen = pyotp.TOTP('YOUR_API_SECRET')
totp = totp_gen.now()
 
access_token = GrowwAPI.get_access_token(api_key=api_key, totp=totp)
# Use access_token to initiate GrowwAPi
growwapi = GrowwAPI(access_token)

Step 4: Place your First Order

Use this sample code to place an order.

from growwapi import GrowwAPI
 
# Groww API Credentials (Replace with your actual credentials)
API_AUTH_TOKEN = "your_token"  # Access token generated using step 3.,
 
# Initialize Groww API
groww = GrowwAPI(API_AUTH_TOKEN)
 
place_order_response = groww.place_order(
    trading_symbol="WIPRO",
    quantity=1, 
    validity=groww.VALIDITY_DAY,
    exchange=groww.EXCHANGE_NSE,
    segment=groww.SEGMENT_CASH,
    product=groww.PRODUCT_CNC,
    order_type=groww.ORDER_TYPE_LIMIT,
    transaction_type=groww.TRANSACTION_TYPE_BUY,
    price=250,               # Optional: Price of the stock (for Limit orders)
    trigger_price=245,       # Optional: Trigger price (if applicable)
    order_reference_id="Ab-654321234-1628190"  # Optional: User provided 8 to 20 length alphanumeric reference ID to track the order
)
print(place_order_response)

Rate Limits

The rate limits are applied at the type level, not on individual APIs. This means that all APIs grouped under a type (e.g., Orders, Live Data, Non Trading) share the same limit. If the limit for one API within a type is exhausted, all other APIs in that type will also be rate-limited until the limit window resets.

TypeRequestsLimit (Per second)Limit (Per minute)
OrdersCreate, Modify and Cancel Order15250
Live DataMarket Quote, LTP, OHLC10300
Non TradingOrder Status, Order list, Trade list, Positions, Holdings, Margin20500

For Live feed, upto 1000 subscriptions are allowed at a time.

On this page