Skip to main content

Market Connect

Get Index List

The Get Index List APIs provide you with the ability to discover all index names and retrieve the corresponding scrip code necessary for obtaining the index value.

Method: POST

https://connect.thefirstock.com/api/V4/indexList

Request details

API Parameters
Parameter Description Example
userId
string
Identifier for the user upon login, unique to each user in the system. AA0013
exchange
string
Exchange on which the order is placed (e.g., NSE, BSE, NFO, BFO) BSE
jKey
string
Authentication token obtained from the login API d4180daa72ea70885ab0d

Libraries and SDKs

Tabbed Interface
from thefirstock import thefirstock

getIndexList = thefirstock.firstock_getIndexList(
    userId="{{userId}}",
    exchange="NSE"
)
curl --location --request POST 'https://connect.thefirstock.com/api/V4/indexList' \
--header 'Content-Type: application/json' \
--data-raw '{
    "userId": "{{userID}}",
    "exchange": "BSE",
    "jKey": "{{jKey}}"
}'
const Firstock = require("thefirstock");

const firstock = new Firstock();

firstock.getIndexList(userId: {{userId}},{ exchange: "NSE" }, (err, result) => {
  console.log("Error, ", err);
  console.log("Result: ", result);
});
using thefirstock;

class Program
{
    public static void Main()
    {
        Firstock firstock = new Firstock();
        var result = firstock.getIndexList(userId: {{userId}},exchange: "NSE");
    }
}

Success response details

API Parameters
Parameter Description Example
status
String
Status of the API request, indicating
success or failure
success
values
String
Array of Basket, Criteria pair ["idxname":"HangSeng BeES-NAV",
"token": "26016", "token": "26000"]
data.requestTime
String
Time of the successful API response 16:38:31 17-01-2023

Basket, Criteria pair Object

API Parameters
Parameter Description Example
value.idxname
String
Index Name HangSeng BeES-NAV
value.token
String
Index token used to subscribe 26016
{
  "status": "success",
  "data": {
      "requestTime": "12:04:58 16-02-2023",
      "values": [
          {
              "idxname": "HangSeng BeES-NAV",
              "token": "26016"
          },
          {
              "idxname": "India VIX",
              "token": "26017"
          },
          {
              "idxname": "Nifty 50",
              "token": "26000"
          },
          {
              "idxname": "Nifty IT",
              "token": "26008"
          },
          {
              "idxname": "Nifty Next 50",
              "token": "26013"
          },
          {
              "idxname": "Nifty Bank",
              "token": "26009"
          },
          {
              "idxname": "Nifty 500",
              "token": "26004"
          },
          {
              "idxname": "Nifty 100",
              "token": "26012"
          },
          {
              "idxname": "Nifty Midcap 50",
              "token": "26014"
          },
          {
              "idxname": "Nifty Realty",
              "token": "26018"
          },
          {
              "idxname": "Nifty Infra",
              "token": "26019"
          },
          {
              "idxname": "Nifty Energy",
              "token": "26020"
          },
          {
              "idxname": "Nifty FMCG",
              "token": "26021"
          },
          {
              "idxname": "Nifty MNC",
              "token": "26022"
          },
          {
              "idxname": "Nifty Pharma",
              "token": "26023"
          },
          {
              "idxname": "Nifty PSE",
              "token": "26024"
          },
          {
              "idxname": "Nifty PSU Bank",
              "token": "26025"
          },
          {
              "idxname": "Nifty Serv Sector",
              "token": "26026"
          },
          {
              "idxname": "Nifty Auto",
              "token": "26029"
          },
          {
              "idxname": "Nifty Metal",
              "token": "26030"
          },
          {
              "idxname": "Nifty Media",
              "token": "26031"
          },
          {
              "idxname": "Nifty 200",
              "token": "26033"
          },
          {
              "idxname": "Nifty Div Opps 50",
              "token": "26034"
          },
          {
              "idxname": "Nifty Commodities",
              "token": "26035"
          },
          {
              "idxname": "Nifty Consumption",
              "token": "26036"
          },
          {
              "idxname": "Nifty Fin Service",
              "token": "26037"
          },
          {
              "idxname": "Nifty50 Div Point",
              "token": "26038"
          },
          {
              "idxname": "Nifty100 Liq 15",
              "token": "26040"
          },
          {
              "idxname": "Nifty CPSE",
              "token": "26041"
          },
          {
              "idxname": "Nifty GrowSect 15",
              "token": "26001"
          },
          {
              "idxname": "Nifty50 PR 2x Lev",
              "token": "26002"
          },
          {
              "idxname": "Nifty50 PR 1x Inv",
              "token": "26042"
          },
          {
              "idxname": "Nifty50 TR 2x Lev",
              "token": "26043"
          },
          {
              "idxname": "Nifty50 TR 1x Inv",
              "token": "26044"
          },
          {
              "idxname": "Nifty50 Value 20",
              "token": "26045"
          },
          {
              "idxname": "Nifty Mid Liq 15",
              "token": "26046"
          },
          {
              "idxname": "Nifty Pvt Bank",
              "token": "26047"
          },
          {
              "idxname": "NIFTY100 Qualty30",
              "token": "26048"
          },
          {
              "idxname": "NIFTY MIDCAP 100",
              "token": "26011"
          },
          {
              "idxname": "NIFTY SMLCAP 100",
              "token": "26032"
          },
          {
              "idxname": "Nifty GS 8 13Yr",
              "token": "26049"
          },
          {
              "idxname": "Nifty GS 10Yr",
              "token": "26050"
          },
          {
              "idxname": "Nifty GS 10Yr Cln",
              "token": "26051"
          },
          {
              "idxname": "Nifty GS 4 8Yr",
              "token": "26052"
          },
          {
              "idxname": "Nifty GS 11 15Yr",
              "token": "26053"
          },
          {
              "idxname": "Nifty GS 15YrPlus",
              "token": "26054"
          },
          {
              "idxname": "Nifty GS Compsite",
              "token": "26055"
          },
          {
              "idxname": "NIFTY50 EQL Wgt",
              "token": "26056"
          },
          {
              "idxname": "NIFTY100 EQL Wgt",
              "token": "26057"
          },
          {
              "idxname": "NIFTY100 LowVol30",
              "token": "26058"
          },
          {
              "idxname": "NIFTY Alpha 50",
              "token": "26059"
          },
          {
              "idxname": "NIFTY MIDCAP 150",
              "token": "26060"
          },
          {
              "idxname": "NIFTY SMLCAP 50",
              "token": "26061"
          },
          {
              "idxname": "NIFTY SMLCAP 250",
              "token": "26062"
          },
          {
              "idxname": "NIFTY MIDSML 400",
              "token": "26063"
          },
          {
              "idxname": "NIFTY200 QUALTY30",
              "token": "26064"
          },
          {
              "idxname": "Nifty FinSrv25 50",
              "token": "26065"
          },
          {
              "idxname": "NIFTY AlphaLowVol",
              "token": "26066"
          },
          {
              "idxname": "Nifty200Momentm30",
              "token": "26067"
          },
          {
              "idxname": "Nifty100ESGSecLdr",
              "token": "26068"
          },
          {
              "idxname": "NIFTY HEALTHCARE",
              "token": "26069"
          },
          {
              "idxname": "NIFTY CONSR DURBL",
              "token": "26070"
          },
          {
              "idxname": "NIFTY OIL AND GAS",
              "token": "26071"
          },
          {
              "idxname": "NIFTY500 MULTICAP",
              "token": "26072"
          },
          {
              "idxname": "NIFTY LARGEMID250",
              "token": "26073"
          },
          {
              "idxname": "NIFTY MID SELECT",
              "token": "26074"
          },
          {
              "idxname": "NIFTY TOTAL MKT",
              "token": "26075"
          },
          {
              "idxname": "NIFTY MICROCAP250",
              "token": "26076"
          },
          {
              "idxname": "NIFTY IND DIGITAL",
              "token": "26077"
          },
          {
              "idxname": "NIFTY100 ESG",
              "token": "26078"
          },
          {
              "idxname": "NIFTY M150 QLTY50",
              "token": "26079"
          },
          {
              "idxname": "NIFTY INDIA MFG",
              "token": "26080"
          }
      ]
  }
}

Failure response details

API Error Parameters
Parameter Description Example
status
String
The status of the response indicating a failure
in the API operation
failed
code
String
The HTTP status code associated
with the error condition
401
name
String
Describes the type or category of the error
encountered
INVALID_USERID
error.field
String
Specifies the field in the request that caused the
error
userid
error.message
String
Provides a detailed message describing the error userid parameter is invalid
{
  "status": "failed",
  "code": "401",
  "name": "INVALID_USERID",
  "error": {
      "field": "userid",
      "message": "userid parameter is invalid"
  }
}