[Feature Request] Nsetools_get_quote is not fetching Delivery data and Delivery %

nsetools_get_quote is not fetching Delivery data and Delivery % . Can you include this as part of feature request

1 Like

nsetools_get_quote does not decide what it wants to fetch. It just fetches what NSE gives. So, NSE API does not give those data you seek in that API.

It may give those data in some other API endpoint.

Tell me where you are seeing Delivery data and Delivery %, I will find it recursively.


https://www.nseindia.com/get-quotes/equity?symbol=INFY
Please check delivery position section , it has delivery related details

Thanks in advance

It is coming from https://www.nseindia.com/api/quote-equity?symbol=INFY&section=trade_info

use nsefetch()

nsefetch("https://www.nseindia.com/api/quote-equity?symbol=INFY&section=trade_info")

The output will look like →

{
    "noBlockDeals": true,
    "bulkBlockDeals": [
        {
            "name": "Session I"
        },
        {
            "name": "Session II"
        }
    ],
    "marketDeptOrderBook": {
        "totalBuyQuantity": 536527,
        "totalSellQuantity": 486427,
        "bid": [
            {
                "price": 1392.5,
                "quantity": 1906
            },
            {
                "price": 1392.4,
                "quantity": 3
            },
            {
                "price": 1392.25,
                "quantity": 27
            },
            {
                "price": 1392.2,
                "quantity": 31
            },
            {
                "price": 1392.15,
                "quantity": 27
            }
        ],
        "ask": [
            {
                "price": 1392.65,
                "quantity": 2
            },
            {
                "price": 1392.7,
                "quantity": 2
            },
            {
                "price": 1392.85,
                "quantity": 1038
            },
            {
                "price": 1392.9,
                "quantity": 3108
            },
            {
                "price": 1392.95,
                "quantity": 156
            }
        ],
        "tradeInfo": {
            "totalTradedVolume": 5301240,
            "totalTradedValue": 74214.71,
            "totalMarketCap": 57774921.45,
            "ffmc": 50958339.4732687,
            "impactCost": 0.01
        },
        "valueAtRisk": {
            "securityVar": 9.83,
            "indexVar": 0,
            "varMargin": 9.83,
            "extremeLossMargin": 3.5,
            "adhocMargin": 0,
            "applicableMargin": 13.33
        }
    },
    "securityWiseDP": {
        "quantityTraded": 4102272,
        "deliveryQuantity": 2920190,
        "deliveryToTradedQuantity": 71.18,
        "seriesRemarks": null,
        "secWiseDelPosDate": "13-APR-2023 11:00:00"
    }
}

Use this as a temporary solution; I am adding this as Feature Request :slight_smile:

1 Like

Thanks alot for this

@dexter By when can I expect this feature request to be available?

Thanks in advance

You need it in urgency? I will do when I get access to laptop then. I am admitted now for dehydration and fever man. :frowning:

Sorry i didn’t know . Take care . Get Well Soon .

Areh lol.

I love to do these works. I just have “angry-wife” problem moment being. I think I will be released day after tomorrow. Then all will be solved.

Anyways, will do then

1 Like

Added this new feature.

Do note - same can be achievable using Bhavcopy function as shown here NSEPy Functions - Unofficed

I modified the nse_quote() function to

def nse_quote(symbol,section=""):
#https://forum.unofficed.com/t/nsetools-get-quote-is-not-fetching-delivery-data-and-delivery-can-you-include-this-as-part-of-feature-request/1115/4    
    symbol = nsesymbolpurify(symbol)

    if(section==""):
        if any(x in symbol for x in fnolist()):
            payload = nsefetch('https://www.nseindia.com/api/quote-derivative?symbol='+symbol)
        else:
            payload = nsefetch('https://www.nseindia.com/api/quote-equity?symbol='+symbol)
        return payload
    
    if(section!=""):
        payload = nsefetch('https://www.nseindia.com/api/quote-equity?symbol='+symbol+'&section='+section)            
        return payload

Now, if you do

print(nse_quote("INFY","trade_info"))

You get the desired info -

{'noBlockDeals': True, 'bulkBlockDeals': [{'name': 'Session I'}, {'name': 'Session II'}], 'marketDeptOrderBook': {'totalBuyQuantity': 0, 'totalSellQuantity': 1060, 'bid': [{'price': 0, 'quantity': 0}, {'price': 0, 'quantity': 0}, {'price': 0, 'quantity': 0}, {'price': 0, 'quantity': 0}, {'price': 0, 'quantity': 0}], 'ask': [{'price': 1227.55, 'quantity': 1060}, {'price': 0, 'quantity': 0}, {'price': 0, 'quantity': 0}, {'price': 0, 'quantity': 0}, {'price': 0, 'quantity': 0}], 'tradeInfo': {'totalTradedVolume': 5680192, 'totalTradedValue': 69680.62, 'totalMarketCap': 50902831.74, 'ffmc': 43796057.9853049, 'impactCost': 0.01}, 'valueAtRisk': {'securityVar': 10.67, 'indexVar': 0, 'varMargin': 10.67, 'extremeLossMargin': 3.5, 'adhocMargin': 0, 'applicableMargin': 14.17}}, 'securityWiseDP': {'quantityTraded': 5680192, 'deliveryQuantity': 3669872, 'deliveryToTradedQuantity': 64.61, 'seriesRemarks': None, 'secWiseDelPosDate': '26-APR-2023 EOD'}}
1 Like

Thanks Alot , this will really help

6 posts were split to a new topic: Is there any way your library allows to grab the intraday delivery data as well?

Reorganized the code to use your nsefetch() function directly. However if I haven’t updated the web-page manually it just doesn’t allow me to get the fresh data. Have you found the way how to avoid that?
Both ways work for me however even your nsefetch() function requires manual web-page update. Ideally if we can avoid that

nsefetch() does not need anything manual.

I love firing people. Check I have created unlimited modules at Leverage - Unofficed

hey is the same available for BSE (live delivery quantity and delivery %)

No bro. Only NSE. I thought BSE is going to disappear and their mumbai building will turn into hotel later haha.

xD.

For some reason im not able to retrieve information for HBLPOWER, SSWL scrips for example. Is this query limited to certain set of stocks like NIFTY 200, NIFTY 500, if so how can I retrieve info for all NSE listed companies.

thank you

@dexter

Hi Amit

I think I am seeing what @Illia has mentioned about the need to update the web-page update.

Earlier, I used to fetch the volume delivery pct data for a scrip for using nsepy and sometimes manually from website

example url https://www.nseindia.com/api/historical/securityArchives?from=30-07-2022&to=30-07-2023&symbol=ITC&dataType=priceVolumeDeliverable&series=ALL

this does not work with nsefetch unless I load up the page using the browser manually first and after which nsefetch can this happily

I think we do need method/function that can get volume delivery percentage by scrip or list of scrips from the historical securityArchives api with priceVolumeDeliverable datatype

I had solved this thing by using Python Sessions but then broke it when I updated the nsefetch() function again before I pushed changes for the nsepython server version.

As I myself use the server version mostly, I have skipped to fix it. I apologize for it.

I will fix that part.

PS - I had another interpretation of the manual update thing he mentioned