# Alice.search\_instruments() function is not working anymore

**URL:** <https://community.aliceblueonline.com/t/alice-search-instruments-function-is-not-working-anymore/7320>\
**Category:** API\
**Created:** [August 31, 2023, 4:36am UTC](https://community.aliceblueonline.com/t/alice-search-instruments-function-is-not-working-anymore/7320 "2023-08-31T04:36:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subi](https://sea1.discourse-cdn.com/flex015/user_avatar/community.aliceblueonline.com/subi/32/3023_2.png) [@Subi](https://community.aliceblueonline.com/u/Subi)\
**Post date:** [August 31, 2023, 4:36am UTC](https://community.aliceblueonline.com/t/alice-search-instruments-function-is-not-working-anymore/7320/1 "2023-08-31T04:36:30Z")

</div>

Hi sir/Mam, I’m using alicebue python api for last 4 months without any issue but all of the suden only this function alice.search\_instruments() started to throw error. i even tried with hard codeed values they mentioned in their docs [here](https://github.com/jerokpradeep/pya3). when i try this

> all\_sensex\_scrips = alice.search\_instruments(‘BSE’, ‘SENSEX’)

get this weird key error

> all\_sensex\_scrips = alice.search\_instruments(‘BSE’, ‘SENSEX’)  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “G:\lussia\venv\Lib\site-packages\pya3\alicebluepy.py”, line 776, in search\_instruments  
> inst.append(Instrument(scrip\_response[i][‘exch’],scrip\_response[i][‘token’],scrip\_response[i][‘formattedInsName’],scrip\_response[i][‘symbol’],scrip\_response[i][‘expiry’],scrip\_response[i][‘lotSize’]))  
> ~~~~~~~~~~~~~~ ^^^  
> KeyError: 0

---

<div class="post-metadata">

**Author:** ![kzatakia](https://sea1.discourse-cdn.com/flex015/user_avatar/community.aliceblueonline.com/kzatakia/32/1353_2.png) [@kzatakia](https://community.aliceblueonline.com/u/kzatakia)\
**Post date:** [September 5, 2023, 12:45pm UTC](https://community.aliceblueonline.com/t/alice-search-instruments-function-is-not-working-anymore/7320/2 "2023-09-05T12:45:58Z")

</div>

Yes, I am facing the same error, so I switched my code to a new function.

---

<div class="post-metadata">

**Author:** ![kzatakia](https://sea1.discourse-cdn.com/flex015/user_avatar/community.aliceblueonline.com/kzatakia/32/1353_2.png) [@kzatakia](https://community.aliceblueonline.com/u/kzatakia)\
**Post date:** [September 5, 2023, 1:01pm UTC](https://community.aliceblueonline.com/t/alice-search-instruments-function-is-not-working-anymore/7320/3 "2023-09-05T13:01:07Z")

</div>

Yes, I am facing same error, so I switch my code to new function.

---

<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:** [September 12, 2023, 7:53am UTC](https://community.aliceblueonline.com/t/alice-search-instruments-function-is-not-working-anymore/7320/4 "2023-09-12T07:53:54Z")

</div>

Kindly recheck once again search instrument is working properly.
