# Loop through position list (Python)

**URL:** https://forum.alpaca.markets/t/loop-through-position-list-python/7490
**Category:** Alpaca Integration Applications
**Created:** [November 19, 2021, 3:51pm UTC](https://forum.alpaca.markets/t/loop-through-position-list-python/7490 "2021-11-19T15:51:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Meirtaub](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Meirtaub](https://forum.alpaca.markets/u/Meirtaub)
#### Post date: [November 19, 2021, 3:51pm UTC](https://forum.alpaca.markets/t/loop-through-position-list-python/7490/1 "2021-11-19T15:51:20Z")

</div>

I wish to loop through my position list, to get the symbols in it. How do I do that?

for exampl:

api.list\_positions()[0]

would return:

Position({ ‘asset\_class’: ‘us\_equity’,  
‘asset\_id’: ‘f30d734c-2806-4d0d-b145-f9fade61432b’,  
‘asset\_marginable’: True,  
‘avg\_entry\_price’: ‘2615.88’,  
‘change\_today’: ‘0.0017749437658003’,  
‘cost\_basis’: ‘18311.16’,  
‘current\_price’: ‘3019.53’,  
‘exchange’: ‘NASDAQ’,  
‘lastday\_price’: ‘3014.18’,  
‘market\_value’: ‘21136.71’,  
‘qty’: ‘7’,  
‘side’: ‘long’,  
‘symbol’: ‘GOOG’,  
‘unrealized\_intraday\_pl’: ‘37.45’,  
‘unrealized\_intraday\_plpc’: ‘0.0017749437658003’,  
‘unrealized\_pl’: ‘2825.55’,  
‘unrealized\_plpc’: ‘0.1543075370429836’})

* * *

now I would like to return only:  
‘symbol’: ‘GOOG’

how do I go about it?

---

<div class="post-metadata">

### Author: ![Sanjay\_Jadhav](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@Sanjay\_Jadhav](https://forum.alpaca.markets/u/Sanjay_Jadhav)
#### Post date: [November 19, 2021, 4:49pm UTC](https://forum.alpaca.markets/t/loop-through-position-list-python/7490/2 "2021-11-19T16:49:59Z")

</div>

use for loop and return symbol  
my\_positions = api.list\_positions()  
for position in my\_positions:  
print( **position.symbol** ,position.qty, position.market\_value)
