Nifty 50

logo

Build a Portfolio Dashboard with HDFC SKY API + Python/Sheets

By HDFC SKY | Published at: Nov 6, 2026 12:22 PM IST

Build a Portfolio Dashboard with HDFC SKY API + Python/Sheets

Open Free Demat Account

By signing up I certify terms, conditions & privacy policy

Tracking your investments across multiple platforms can become difficult as your portfolio grows. A custom dashboard can help you view holdings, prices, and performance in one place. By connecting supported HDFC SKY APIs with Python and Google Sheets, investors and developers can create a personalised portfolio dashboard that organises available investment data in one place. This guide explains the setup process, data flow, dashboard creation, and security practices in simple steps.

What Is a Portfolio Dashboard Using HDFC SKY API?

A portfolio dashboard is a customised view that brings your investment information together in one place. Instead of checking different platforms for holdings, prices, and performance, you can organise your portfolio data through a personalised dashboard.

By connecting supported HDFC SKY APIs with Python and Google Sheets, developers can create a system that collects available portfolio and market information, processes the data, and displays it in a simple format.

The workflow follows three basic steps:

  • HDFC SKY API: Provides access to supported trading, portfolio, or market-related data.
  • Python Script: Collects and formats the received information.
  • Google Sheets: Displays the data through tables, formulas, and charts.

This setup helps investors create a customised portfolio tracking solution based on their preferred data points and analysis requirements.

Requirements Before Building the Dashboard

Before creating the dashboard, you need a few accounts, tools, and basic setup requirements.

  1. HDFC SKY Developer Account
    You need access to the HDFC SKY Open API Developer Portal to create an application and generate API credentials. These credentials allow your application to securely connect with supported HDFC SKY APIs.
  2. Google Account and Google Sheets
    You need a Google account to create the spreadsheet that will display your portfolio information. You also need to enable the Google Sheets API through Google Cloud.
  3. Python Installation
    Install Python on your computer before running the data sync script. Python will help connect HDFC SKY API data with Google Sheets.
  4. Required Python Libraries
    Install the required libraries using the terminal or command prompt.
    The commonly used packages include:
  • requests to send API requests;
  • gspread to connect Python with Google Sheets; and
  • oauth2client to manage Google Sheet authentication.
    You can install them using:
    pip install requests gspread oauth2client

Setting Up HDFC SKY API Access

The first step is to create API access through the HDFC SKY Open API Developer Portal. Follow these steps:

  1. Register on the Developer Portal
    Create your developer account and access the HDFC SKY API documentation. The portal provides details about available APIs, authentication methods, and integration requirements.
  2. Create an API Application
    Create a new application and generate the required credentials. Store these credentials securely because your Python application will use them for authentication.
  3. Check Available APIs
    Review the official documentation before building your dashboard. Select the APIs that provide the information you want to display, such as supported holding, position, trading, or market-related data.

Also Read: How to Connect HDFC SKY with Claude Desktop (Step-by-Step MCP Setup)

Preparing Google Sheets for Portfolio Data

After setting up API access, prepare Google Sheets to receive the portfolio information.

Follow these steps:

  1. Create a Google Cloud Project
    Create a project in Google Cloud and enable the Google Sheets API. Generate a service account and download the JSON credentials file.
    This file allows your Python script to securely connect with Google Sheets.
  2. Create Your Portfolio Sheet
    Create a new Google Sheet and add column headings based on the information you want to track. For example:
Instrument Quantity Average Price LTP Current Value P&L

These columns help organise your holdings data in a structured format.

Connecting HDFC SKY API With Python

Python acts as a bridge between HDFC SKY APIs and Google Sheets. It helps collect the available data from HDFC SKY, organise the information into a structured format, and send it to your dashboard.

Before creating the connection, make sure you use the API endpoints, authentication methods, and data fields mentioned in the official HDFC SKY API documentation. Avoid using sample or placeholder URLs in a live application.

The basic workflow includes the following steps:

  1. Authenticate API Access
    The Python script uses your HDFC SKY API credentials to establish a secure connection. These credentials allow the application to communicate with supported HDFC SKY APIs.
  2. Request Portfolio Data
    After authentication, the script sends requests to the required HDFC SKY API endpoints. Depending on the APIs enabled for your application, you can retrieve supported information such as holdings, positions, orders, or market-related data.
  3. Process the Received Data
    The API returns data in a structured format, usually as JSON. Python processes this information and arranges it into rows and columns that match your Google Sheets format.
    For example, you can organise information such as:
    I. instrument name;
    II. quantity;
    III. average price;
    IV. latest price;
    V. current value;
    VI. profit or loss details.
    The exact data fields depend on the APIs available through the HDFC SKY Developer Portal.
  4. Update Google Sheets
    After processing the data, Python uses libraries such as gspread to connect with Google Sheets and update your portfolio dashboard automatically.

This creates a simple data flow:

HDFC SKY API → Python Script → Google Sheets → Portfolio Dashboard

With this setup, investors and developers can build a personalised dashboard that displays their preferred portfolio information in an organised format.

Creating a Portfolio Dashboard in Google Sheets

Once your data reaches Google Sheets, you can convert the spreadsheet into a simple portfolio dashboard. You can add useful calculations and visual elements.

  1. Calculate Total Portfolio Value
    Use Google Sheets formulas to calculate the total value of your holdings.
    For example:
    =SUM(E2:E100)
    (the specific cell numbers are only for example purposes)
    This formula adds the current value of all holdings listed in the sheet.
  2. Track Profit and Loss
    Use the P&L column to monitor how individual investments are performing. You can sort the data to identify the best and worst-performing holdings.
  3. Add Charts
    Google Sheets allows you to create charts for easier analysis.
    You can add:
  • pie charts to visualise allocation after grouping investments by sector, category, or asset type;
  • bar charts to compare profit and loss across investments; and
  • summary charts to monitor overall portfolio performance.

These visuals make it easier to understand your investment data quickly.

Automating Portfolio Updates

A major benefit of combining HDFC SKY APIs with Python is that you can reduce manual data entry.

After creating the script, you can schedule it to run at selected intervals using automation tools available on your computer or server.

For example, you can configure the workflow to:

  • refresh available portfolio data periodically;
  • update your Google Sheet automatically; and
  • maintain an organised record of your investment information.

The frequency of updates depends on API availability, authentication requirements, and your chosen automation settings.

Security Practices While Using APIs

When connecting external tools with your investment account, security should remain a priority. Follow these practices to protect your data:

  • Keep your API credentials private and never share them publicly.
  • Store authentication files securely.
  • Use only official HDFC SKY API documentation and endpoints.
  • Avoid uploading API keys or credentials to public platforms.
  • Review API access settings and connected applications regularly.

API access should always follow secure authentication practices and the permissions provided by HDFC SKY.

Conclusion

A portfolio dashboard built with HDFC SKY API, Python, and Google Sheets helps investors organise their investment information in one place. By connecting approved data sources with simple automation tools, investors can track holdings, performance, and portfolio insights more efficiently. A secure setup and regular monitoring help create a reliable personal investment dashboard.

Summarize with AI
Google GeminiChatGPTPerplexity AIAnthropic AIGrok AI

Open Free Demat Account

By signing up I certify terms, conditions & privacy policy

Desktop BannerMobile Banner

Invest Anytime, Anywhere

Get it on Google PlayGet it on App Store

Open Free Demat Account Online

By signing up I certify terms, conditions & privacy policy