Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'vwdId' with the response #35

Open
JohnnyQQQ opened this issue Mar 18, 2021 · 4 comments
Open

KeyError: 'vwdId' with the response #35

JohnnyQQQ opened this issue Mar 18, 2021 · 4 comments

Comments

@JohnnyQQQ
Copy link

This seems to be a new issue only started over the weekend and only effects some shares.

It works if I check Tesla and other shares

degiro = degiroapi.DeGiro()
degiro.login(USERNAME, PASSWORD)

products = degiro.search_products('TSLA')
realprice = degiro.real_time_price(Product(products[0]).id, degiroapi.Interval.Type.One_Day)

print(realprice[0])

Now this is probably a change on Degiros part but if I check this share Glanbia

degiro = degiroapi.DeGiro()
degiro.login(USERNAME, PASSWORD)

products = degiro.search_products('GL9')
realprice = degiro.real_time_price(Product(products[0]).id, degiroapi.Interval.Type.One_Day)

print(realprice[0])
Traceback (most recent call last):

  File "send_mail.py", line 4, in <module>
    import share_details
  File "/home/myacc/projects/degiroholdings/share_details.py", line 99, in <module>
    sh.main()
  File "/home/myacc/projects/degiroholdings/share_details.py", line 23, in main
    self.get_shares()
  File "/home/myacc/projects/degiroholdings/share_details.py", line 44, in get_shares
    realprice = self.degiro.real_time_price(Product(products[0]).id, degiroapi.Interval.Type.One_Day)
  File "/usr/local/lib/python3.7/dist-packages/degiroapi/__init__.py", line 221, in real_time_price
    vw_id = self.product_info(product_id)['vwdId']
KeyError: 'vwdId'

The response doesn't seem to have a key 'vwdId'

Share Details:
SHARES
IRL | GL9 | IE0000669501 | EUR | ED
GLANBIA PLC

@JohnnyQQQ
Copy link
Author

From the payload returned I can see there is no
'vwdId' or vwdIdSecondary

Probably as "No realtime data available for this exchange; trading is supported. Your orders will be sent to the exchange directly."

{'id': '353237', 'name': 'GLANBIA PLC', 'isin': 'IE0000669501', 'symbol': 'GL9', 'contractSize': 1.0, 'productType': 'STOCK', 'productTypeId': 1, 'tradable': True, 'category': 'B', 'currency': 'EUR', 'exchangeId': '384', 'onlyEodPrices': True, 'orderTimeTypes': ['DAY', 'GTC'], 'buyOrderTypes': ['LIMIT', 'MARKET', 'STOPLOSS', 'STOPLIMIT'], 'sellOrderTypes': ['LIMIT', 'MARKET', 'STOPLOSS', 'STOPLIMIT'], 'productBitTypes': [], 'closePrice': 11.84, 'closePriceDate': '2021-03-17'}

What would be the best course of action?

Thanks again for this library

@JohnnyQQQ
Copy link
Author

I've tried a few things but can't get over the error.

Is there a option how I could skip the KeyError: 'vwdId' and just use the info in the payload?

@Chavithra
Copy link

Hello, what kind of properties about this product are you looking for ?

@JohnnyQQQ
Copy link
Author

JohnnyQQQ commented Mar 19, 2021

Hi Chavithra

The only figure I needed from the payload was the last price realprice[0]['data']['lastPrice']

But I can't see away around it if Degiro has stopped reporting this share in real time now

I'll just use the close of day price → Product(products[0]).close_price instead and that will work for me.

I've learnt a lot about the library in the last couple of days looking for a solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants