# API not connecting from python

**URL:** <https://community.aliceblueonline.com/t/api-not-connecting-from-python/148>\
**Category:** API\
**Created:** [March 20, 2023, 6:55am UTC](https://community.aliceblueonline.com/t/api-not-connecting-from-python/148 "2023-03-20T06:55:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rasind\_Raveendran](https://sea1.discourse-cdn.com/flex015/user_avatar/community.aliceblueonline.com/rasind_raveendran/32/42_2.png) [@Rasind\_Raveendran](https://community.aliceblueonline.com/u/Rasind_Raveendran)\
**Post date:** [March 20, 2023, 6:55am UTC](https://community.aliceblueonline.com/t/api-not-connecting-from-python/148/1 "2023-03-20T06:55:53Z")

</div>

API not connecting with python

---

<div class="post-metadata">

**Author:** ![nandagopal](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@nandagopal](https://community.aliceblueonline.com/u/nandagopal)\
**Post date:** [March 20, 2023, 6:57am UTC](https://community.aliceblueonline.com/t/api-not-connecting-from-python/148/2 "2023-03-20T06:57:55Z")

</div>

Kindly provide more information with a screen shot.

---

<div class="post-metadata">

**Author:** ![Sai\_SaiGraph](https://sea1.discourse-cdn.com/flex015/user_avatar/community.aliceblueonline.com/sai_saigraph/32/2028_2.png) [@Sai\_SaiGraph](https://community.aliceblueonline.com/u/Sai_SaiGraph)\
**Post date:** [July 25, 2023, 4:06am UTC](https://community.aliceblueonline.com/t/api-not-connecting-from-python/148/3 "2023-07-25T04:06:46Z")

</div>

Facing this issue since today morning:

historical,alice = login(61…9)  
File “C:\Users\…t.py”, line 280, in login  
alice = AliceBlue(username =str(user), session\_id = session\_id,master\_contracts\_to\_download=[‘NSE’,‘NFO’])  
File “C:\Users\naveen\AppData\Roaming\Python\Python39\site-packages\alice\_blue\alice\_blue.py”, line 164, in **init**  
self.\_\_get\_master\_contract(e)  
File “C:\Users\naveen\AppData\Roaming\Python\Python39\site-packages\alice\_blue\alice\_blue.py”, line 951, in \_\_get\_master\_contract  
body = self.\_\_api\_call\_helper(‘master\_contract’, Requests.GET, params={‘exchange’: exchange})  
File “C:\Users\naveen\AppData\Roaming\Python\Python39\site-packages\alice\_blue\alice\_blue.py”, line 1006, in \_\_api\_call\_helper  
return response.json()  
File “C:\ProgramData\Anaconda3\lib\site-packages\requests\models.py”, line 975, in json  
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)  
requests.exceptions.JSONDecodeError: Unterminated string starting at: line 1 column 13706371 (char 13706370)

---

<div class="post-metadata">

**Author:** ![Sai\_SaiGraph](https://sea1.discourse-cdn.com/flex015/user_avatar/community.aliceblueonline.com/sai_saigraph/32/2028_2.png) [@Sai\_SaiGraph](https://community.aliceblueonline.com/u/Sai_SaiGraph)\
**Post date:** [July 25, 2023, 4:08am UTC](https://community.aliceblueonline.com/t/api-not-connecting-from-python/148/4 "2023-07-25T04:08:31Z")

</div>

It worked fine till yesterday it looked like… please help.

---

<div class="post-metadata">

**Author:** ![Sai\_SaiGraph](https://sea1.discourse-cdn.com/flex015/user_avatar/community.aliceblueonline.com/sai_saigraph/32/2028_2.png) [@Sai\_SaiGraph](https://community.aliceblueonline.com/u/Sai_SaiGraph)\
**Post date:** [July 25, 2023, 10:55am UTC](https://community.aliceblueonline.com/t/api-not-connecting-from-python/148/5 "2023-07-25T10:55:35Z")

</div>

Any help on this please

---

<div class="post-metadata">

**Author:** ![Shivaraman\_Arumugam](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Shivaraman\_Arumugam](https://community.aliceblueonline.com/u/Shivaraman_Arumugam)\
**Post date:** [July 25, 2023, 11:37am UTC](https://community.aliceblueonline.com/t/api-not-connecting-from-python/148/6 "2023-07-25T11:37:32Z")

</div>

Kindly find our GitHub library in the given below link.

> **[GitHub - jerokpradeep/pya3](https://github.com/jerokpradeep/pya3)**
>
> Contribute to jerokpradeep/pya3 development by creating an account on GitHub.

Kindly find our youtube tutorial in the given link below

[![](https://us1.discourse-cdn.com/flex015/uploads/aliceblueonline/original/2X/7/79938879829c17b490971465a3f30c2d3e564390.jpeg "NEW UPDATES IN ALICE BLUE PYTHON API.") ](https://www.youtube.com/watch?v=CQMneD9W7mQ)

---

<div class="post-metadata">

**Author:** ![arkanoids](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arkanoids](https://community.aliceblueonline.com/u/arkanoids)\
**Post date:** [August 11, 2023, 5:19am UTC](https://community.aliceblueonline.com/t/api-not-connecting-from-python/148/7 "2023-08-11T05:19:27Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/aliceblueonline/original/2X/f/fafb53adb97c366d786e6cce809b147d9c3b05fb.png)  
above is the message I get when i use print session id code . Pre note: I login into my aliceblue account on [a3.aliceblueonline.com](http://a3.aliceblueonline.com) before executing this code, I have also gone through the video, pls tell me what I am missing

---

<div class="post-metadata">

**Author:** ![arkanoids](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arkanoids](https://community.aliceblueonline.com/u/arkanoids)\
**Post date:** [August 11, 2023, 5:28pm UTC](https://community.aliceblueonline.com/t/api-not-connecting-from-python/148/8 "2023-08-11T17:28:02Z")

</div>

Its working now … thks
