How to find option-chain particular expiry date data?

What if I want only one day’s expiry data?
( expiry=21-09-2023 ) I get full data which increases the response time.
What if I want data only ( expiry=NIFTY-Sep2023-20150-CE )?

?? Any Update

Hi @valabhavik you can filter using the expiry_date

1 Like

Ok, I’ll filter it out but I still have the query. when I API call :

https://developer.paytmmoney.com/fno/v1/option-chain?type=PUT&symbol=NIFTY&expiry=21-09-2023

I get a response in a fraction of 30 seconds.

What should I do if I want the price and difference of nifty in seconds?

Hii, Can you please give me any suggestions?

Hi @valabhavik ,

For information regarding pricing, you can utilize the Live Price APIs as detailed in the following documentation: https://developer.paytmmoney.com/docs/api/live-market-data-api/

I’m providing you with a sample cURL command for your reference:

curl --location 'https://developer.paytmmoney.com/data/v1/price/live?mode=FULL&pref=NSE:54668:OPTION' \
--header 'x-jwt-token: jwt-token'

Here’s an example of the response you can expect:

{
    "data": [
        {
            "tradable": true,
            "mode": "FULL",
            "security_id": 54668,
            "last_price": 0.05,
            "last_traded_quantity": 400,
            "average_traded_price": 0.94,
            "volume_traded": 83210350,
            "total_buy_quantity": 0,
            "total_sell_quantity": 456400,
            "ohlc": {
                "open": 1.5,
                "high": 1.8,
                "low": 0.05,
                "close": 3.05
            },
            "change_percent": -98.36,
            "change_absolute": -3.0,
            "52_week_high": 0.0,
            "52_week_low": 0.0,
            "last_trade_time": 1379757597,
            "oi": 3326850,
            "change_oi": -4721250,
            "depth": {
                "buy": [
                    {
                        "quantity": 0,
                        "price": 0.0,
                        "orders": 0
                    },
                    {
                        "quantity": 0,
                        "price": 0.0,
                        "orders": 0
                    },
                    {
                        "quantity": 0,
                        "price": 0.0,
                        "orders": 0
                    },
                    {
                        "quantity": 0,
                        "price": 0.0,
                        "orders": 0
                    },
                    {
                        "quantity": 0,
                        "price": 0.0,
                        "orders": 0
                    }
                ],
                "sell": [
                    {
                        "quantity": 96500,
                        "price": 0.05,
                        "orders": 199
                    },
                    {
                        "quantity": 71350,
                        "price": 0.1,
                        "orders": 71
                    },
                    {
                        "quantity": 6350,
                        "price": 0.15,
                        "orders": 9
                    },
                    {
                        "quantity": 1500,
                        "price": 0.2,
                        "orders": 2
                    },
                    {
                        "quantity": 14100,
                        "price": 0.25,
                        "orders": 17
                    }
                ]
            },
            "found": true
        }
    ]
}

Feel free to use this information as needed.

Hi @PaytmMoney @ravibeck

Help me I search the price every second using this Live Price API. What should I do if I get the new price after 7-10 seconds. It was working fine for few days but since 2 days it is giving me late response.

Array
(
[data] => Array
(
[0] => Array
(
[tradable] => 1
[mode] => FULL
[security_id] => 85871
[last_price] => 43.5
[last_traded_quantity] => 500
[average_traded_price] => 27.23
[volume_traded] => 244497750
[total_buy_quantity] => 1567850
[total_sell_quantity] => 1595250
[ohlc] => Array
(
[open] => 44.2
[high] => 48.2
[low] => 13.25
[close] => 49.15
)

                [change_percent] => -11.5
                [change_absolute] => -5.6500015
                [52_week_high] => 0
                [52_week_low] => 0
                [last_trade_time] => 1380267650
                [oi] => 15406800
                [change_oi] => 4853300
                [depth] => Array
                    (
                        [buy] => Array
                            (
                                [0] => Array
                                    (
                                        [quantity] => 900
                                        [price] => 43.4
                                        [orders] => 4
                                    )

                                [1] => Array
                                    (
                                        [quantity] => 3600
                                        [price] => 43.35
                                        [orders] => 10
                                    )

                                [2] => Array
                                    (
                                        [quantity] => 5050
                                        [price] => 43.3
                                        [orders] => 20
                                    )

                                [3] => Array
                                    (
                                        [quantity] => 5750
                                        [price] => 43.25
                                        [orders] => 11
                                    )

                                [4] => Array
                                    (
                                        [quantity] => 8100
                                        [price] => 43.2
                                        [orders] => 25
                                    )

                            )

                        [sell] => Array
                            (
                                [0] => Array
                                    (
                                        [quantity] => 2300
                                        [price] => 43.5
                                        [orders] => 9
                                    )

                                [1] => Array
                                    (
                                        [quantity] => 7400
                                        [price] => 43.55
                                        [orders] => 18
                                    )

                                [2] => Array
                                    (
                                        [quantity] => 7750
                                        [price] => 43.6
                                        [orders] => 21
                                    )

                                [3] => Array
                                    (
                                        [quantity] => 2800
                                        [price] => 43.65
                                        [orders] => 10
                                    )

                                [4] => Array
                                    (
                                        [quantity] => 4050
                                        [price] => 43.7
                                        [orders] => 15
                                    )

                            )

                    )

                [found] => 1
            )

    )

)

https://www.awesomescreenshot.com/video/21114043?key=150962b413619803beb12899ff878d73

You can see in this video. It has been more than 10 seconds for the new price update. So what should I do so that I can get the new price quickly.

Hi @valabhavik,
You can explore the Market Data WebSocket Streaming feature explained in this documentation: https://developer.paytmmoney.com/docs/api/live-market-data-webSocket-streaming . It’s the most efficient way to receive real-time market quotes for instruments during market hours. WebSocket Streaming offers benefits like high speed, low latency, minimal resource usage, and low bandwidth consumption. You’ll receive market data with essential fields such as open, high, low, close, last traded price, and 5 levels of bid/offer market depth data, among others.

1 Like

Hi, @ravibeck @PaytmMoney

Yes but for 2 days I was getting a good response from live-market-data-api, it fit perfectly in my ALGO. So the reason for this happening suddenly? And you are the one who found this API for me.

And secondly, I work in PHP CI. So I don’t know how to use live-market-data-webSocket-streaming. So please help me. To get a live price of option chain by setting up WebSocket. I will be grateful to you

Hi @valabhavik,

The latency in APIs is to be expected.

If you require real-time market data, I recommend using the WebSocket Streaming API. This provides low latency data streaming, making it ideal for applications that require real-time data.

You can find more information about the Live Market Data WebSocket Streaming API in our documentation: Live Market Data WebSocket Streaming