Skip to main content

Market Connect

Time Price Series Regular Interval

The Get Time Price Series API enable you to get chart data for analysis.For "interval" you can pass the following values 1,3,5,10,15,30,60,120 and 240 to get the data in minutes.

Method: POST

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

Request details

API Parameters
Parameter Description Example
userId
string
Identifier for the user upon login, unique to each user in the system. AA1999
exchange
string
Exchange on which the order is placed (e.g., NSE, BSE, NFO, BFO) NSE
token
string
The unique token associated with the specified trading symbol. 22 or RELIANCE-EQ
startTime
string
Start time (use 24hr Date time)
dd/mm/yyyy HH:mm:ss
17/02/2023 15:29:00
endTime
string
End Time (use 24hr Date time)
dd/mm/yyyy HH:mm:ss
20/02/2023 09:20:00
jKey
String
Authentication token obtained from the login API d4180da989ea708
interval
string
Time interval 1, 3, 5, 10, 15, 30, 60, 120, 240

Libraries and SDKs

Tabbed Interface
from thefirstock import thefirstock

timePriceSeries = thefirstock.firstock_TimePriceSeries(
    userId="{{userId}}",
    exchange="NSE",
    tradingSymbol="Nifty 50",
    startTime="13/02/2023 09:45:45",
    endTime="13/12/2023 13:56:34",
    interval="30"
)
curl --location --request POST 'https://connect.thefirstock.com/api/V4/timePriceSeries' \
--header 'Content-Type: application/json' \
--data-raw '{
    "userId": "{{userID}}",
    "exchange": "NSE",
    "tradingSymbol": "Nifty 50",
    "startTime": "13/02/2023 09:45:45",
    "endTime": "13/12/2023 13:56:34",
    "interval": "30",
    "jKey": "{{jKey}}"
}'
const Firstock = require("thefirstock");

const firstock = new Firstock();

firstock.timePriceSeries(
  {
    userId: {{userId}},
    exchange: "NSE",
    token: "22",
    endTime: "22/02/2023 09:20:00",
    startTime: "21/02/2023 15:29:00",
    interval: "3",
  },
  (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.timePriceSeries(
          userId: {{userId}},
            exchange: "NSE",
            token: "22",
            endTime: "02/08/2022 15:30:08",
            startTime: "05/07/2022 10:30:08",
            interval: "3"
          );
    }
}

Success response details

API Parameters
Parameter Description Example
Status
String
TP Data success indication ok
data.time
String
DD/MM/CCYY hh:mm:ss 25-08-2022 10:58:00
data.ssboe
String
seconds since begin of epoch 1661405340
data.into
String
Interval open 2298.05
data.inth
String
Interval high 2299.20
data.intl
String
Interval low 2298.00
data.intc
String
Interval close 2299.20
data.intvwrap
String
Interval vwap 2299.02
data.intv
String
Interval volume 478
data.v
String
Volume 92262
data.intoi
String
Interval io change 0
data.oi
String
Open Interest 0
{
  "status": "success",
  "data": [
    {
      "stat": "Ok",
      "time": "25-08-2022 10:59:00",
      "ssboe": "1661405340",
      "into": "2298.05",
      "inth": "2299.20",
      "intl": "2298.00",
      "intc": "2299.20",
      "intvwap": "2299.02",
      "intv": "478",
      "intoi": "0",
      "v": "92740",
      "oi": "0"
    },
    {
      "stat": "Ok",
      "time": "25-08-2022 10:58:00",
      "ssboe": "1661405280",
      "into": "2298.60",
      "inth": "2299.00",
      "intl": "2298.30",
      "intc": "2298.70",
      "intvwap": "2299.02",
      "intv": "326",
      "intoi": "0",
      "v": "92262",
      "oi": "0"
    },
  ]
}

Failure response details

API Error Parameters
Parameter Description Example
status
String
Indicates the result status of the
API operation
failed
code
String
HTTP status code associated with the
error
401
name
String
Specifies the type or category of the
error encountered
INVALID_USERID
error.field
String
Field in the request that triggered the
error
userid
error.message
String
Detailed message describing the error userid parameter is invalid
{
  "status": "failed",
  "code": "401",
  "name": "INVALID_USERID",
  "error": {
      "field": "userid",
      "message": "userid parameter is invalid"
  }
}