error while fetching data from

Getting below error: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /api/option-chain-indices?symbol=BANKNIFTY (Ca used by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

I am assuming it's because i have free account. Pls let me know if I upgrade my account to 'Hacker', will you be able to whitelist this url?

I mean this url host='', port=44

That does not have an API, so you will not be able to access it from a free account.

Thats what my question is. If I upgrade my account, will I be able to access it.

Yes, you will.

Thanks. I have upgraded to paid account. I am running same program. It was stuck at one point. So I forced closed it and below is the message:

12:47 ~/Trade $ python3
^CTraceback (most recent call last):
  File "/home/csomkuwar/Trade/", line 20, in <module>
    atmstrike = getatmStrike()
  File "/home/csomkuwar/Trade/", line 16, in getatmStrike
    ltp = oi_chain_builder(symbol,"latest","full")[1]
  File "/home/csomkuwar/.local/lib/python3.10/site-packages/nsepython/", line 90, in oi_chain_builder
    payload = nse_optionchain_scrapper(symbol)
  File "/home/csomkuwar/.local/lib/python3.10/site-packages/nsepython/", line 82, in nse_optionchain_scrapper
    payload = nsefetch(''+symbol)
  File "/home/csomkuwar/.local/lib/python3.10/site-packages/nsepython/", line 33, in nsefetch
    output = requests.get(payload,headers=headers).json()
  File "/usr/local/lib/python3.10/site-packages/requests/", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/", line 489, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/", line 703, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/", line 449, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.10/site-packages/urllib3/", line 444, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.10/http/", line 1374, in getresponse
  File "/usr/local/lib/python3.10/http/", line 318, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.10/http/", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.10/", line 705, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/lib/python3.10/", line 1274, in recv_into
    return, buffer)
  File "/usr/local/lib/python3.10/", line 1130, in read
    return, buffer)

Code that I am running is below:

from nsepython import*
symbol = "BANKNIFTY"
# to get atmstrike using nsepython
def getatmStrike():
    ltp = oi_chain_builder(symbol,"latest","full")[1]
    return atmstrike
atmstrike = getatmStrike()
ceStrike = atmstrike + 300
peStrike = atmstrike - 300

ceLTP = nse_quote_ltp(symbol,"latest","CE",ceStrike)
peLTP = nse_quote_ltp(symbol,"latest","PE",peStrike)

combineFirstPremium = ceLTP+peLTP
print("combined initial premium is:", combineFirstPremium)

Hello, could you try creating a new console and running it from there?

Hi - still facing same issue.

Pls let me know if anything needs to be whitelisted.

It looks like it's NSE blocking. We have seen that in the past. It's not something we can do anything about.

I had asked this same question before upgrading the account

You can't be sure before you try. It's beyond our control. You can downgrade and let us know. We will refund you.

Pls check once - whether is whitelisted?

Paid accounts are not affected by the allowlist.

@fjl - as mentioned I have downgraded the account. Pls process refund. Would love to upgrade later when data is not blocked.

@csomkuwar -- no problem, we've refunded your last payment; it should be processed within 5-10 working days.