For the complete documentation index, see llms.txt. This page is also available as Markdown.

HDFC Sky

HDFC Sky (hdfcsky.com (https://www.hdfcsky.com/)) is the discount broking and investment platform from HDFC Securities, offering equity, F&O, currency and commodity trading with a flat-fee brokerage model. Its Open API (developer.hdfcsky.com (https://developer.hdfcsky.com/)) exposes REST and WebSocket endpoints for order placement, portfolio and funds management, and market data. Regulated by NSE, BSE and MCX, this API, used in the context of OpenAlgo integration, enables automated trading strategies, real-time market data access, order management, and more.

The integration process involves logging in to the HDFC Sky Open API developer portal, creating a Trading API app, capturing the generated API Key and API Secret, and configuring them in OpenAlgo's environmental variables.

Prerequisites

Before proceeding with authentication, please make sure you have:

1) A valid HDFC Sky trading account (Client ID / registered Email / Mobile number)

2) Your registered mobile and email available to receive the login OTP

3) Registered your redirect URL in the developer portal (created inside the My Apps section of developer.hdfcsky.com)

4) A static IP address ready (mandatory as per the latest SEBI Circular; the app form provides Primary and Secondary Static IP fields)

5) Your application credentials, API Key and API Secret, handy (generated after you click Create in the New App form)

App Registration

Goto the HDFC Sky Open API developer portal at developer.hdfcsky.com and log in with your HDFC Sky credentials.

Step 1: On the home page, click the Login button in the top-right corner.

Step 2: On the Login screen, enter your Client ID / Email ID / Mobile No. and click Proceed to HDFC SKY. (New users can click Sign Up.)

Step 3: Enter the 4 digit OTP sent to your registered mobile number and email ID to complete authentication.

Step 4: After login, a My Apps menu item appears in the top navigation bar. Click on My Apps.

Step 5: In the My Apps section, click the + Create button to open the New App form.

Step 6: Fill in the form with the required details.

  • App Name: a name to identify your app, for example openalgo

  • Redirect URL: https://openalgo.local/hdfcsky/callback

  • Postback URL: an optional URL for order postback notifications (a dummy URL such as https://google.com can be used)

  • Primary Static IP: your static IP, now mandatory as per the SEBI circular

  • Secondary Static IP: an optional backup static IP address

  • Description: a short description of your app, for example openalgo

  • APIs in this app: keep Trading API selected (it enables placing orders and managing Stocks, Futures and Options)

Step 7: Click Create.

Note: Your created app will be deactivated by default. Go to the My Apps section and activate it before using the credentials.

Step 8: In the My Apps list, confirm the app status shows Active. Reveal (eye icon) and Copy the API Key and API Secret.

Here is a sample of how the details would appear in a .env file for reference:

Integrating OpenAlgo with HDFC Sky's Open API opens up possibilities for automated trading strategies, providing a powerful tool for traders and developers to act on market opportunities efficiently. It's essential to follow best practices for API integration, including handling rate limits, managing credentials securely, and ensuring robust error handling and logging mechanisms are in place.

Last updated