pratik141 / nsedt

Library to collect NSE data in pandas dataframe
http://nsedt.nse.pratikanand.co.in/
Apache License 2.0
34 stars 16 forks source link

Dynamic headers for making API calls to NSE #51

Closed jitendravarma closed 6 months ago

jitendravarma commented 6 months ago

Right now I see that we have fixed headers for making api requests to NSE. Problem with this is, if many users are requesting the NSE api, then NSE blocks the given headers. So no new reqports file will be downloaded for same headers.

Solution that I like to propose it, to use python header faker library to mock headers and then shoot request. That way all different users will have their own set of headers and wont get blocked.

Library: https://pypi.org/project/fake-headers/

pratik141 commented 6 months ago

Good suggestion

Library: https://pypi.org/project/fake-headers/

This library is in a stale state. Need to find a different one.

or I will add some random headers

jitendravarma commented 6 months ago

Added working fake headers logic to the get_headers function.

pratik141 commented 6 months ago

Link #50

pratik141 commented 6 months ago

Some warning are coming in py 3.11 need to fix later