Hi Errol,

Did you install beanprice separately?

https://github.com/beancount/beanprice

I'm using alphavantage on a daily basis.

You will need to set an environment variable ALPHAVANTAGE_API_KEY with a free 
api key from them and use it like

USD:alphavantage/price:AAPL:USD

Regards,
Patrick 

On December 24, 2024 2:48:02 AM GMT+01:00, Errol Lee <errolle...@gmail.com> 
wrote:
>
>
>Hi everyone,
>
>
>I’m new to Beancount (and honestly, I’m amazed by the amount of 
>functionality it offers—wish I had discovered it sooner!). I’m trying to 
>set up bean-price to fetch stock prices, but I’ve run into some issues, 
>particularly with Yahoo and Alphavantage as sources.
>
>
>Here’s what I’ve tried so far:
>
>1. *Yahoo*:
>
>It seems like Yahoo has blocked API access for fetching stock prices. When 
>I try fetching prices for AAPL, I get the following error:
>
>
>❯ bean-price -e 'USD:yahoo/AAPL'                 
>
>ERROR   : Error fetching AAPL: Status 401: {'code': 'Unauthorized', 
>'description': 'User is unable to access this feature - 
>https://bit.ly/yahoo-finance-api-feedback'}
>
>ERROR   : Could not fetch for job: DatedPrice(base='AAPL', quote='USD', 
>date=None, sources=[PriceSource(module=<module 
>'beancount.prices.sources.yahoo' from 
>'/opt/homebrew/lib/python3.11/site-packages/beancount/prices/sources/yahoo.py'>,
> 
>symbol='AAPL', invert=False)])
>
>
>
>2. *Alphavantage*:
>
>Despite being listed as a source in the GitHub documentation, I can’t seem 
>to get it working. Here’s the error I encounter:
>
>
>❯ bean-price -e 'USD:alphavantage/AAPL'          
>
>Traceback (most recent call last):
>
>  File 
>"/opt/homebrew/lib/python3.11/site-packages/beancount/prices/price.py", 
>line 178, inimport_source
>
>    __import__(default_name)
>
>ModuleNotFoundError: No module named 'beancount.prices.sources.alphavantage'
>
>
>During handling of the above exception, another exception occurred:
>
>
>Traceback (most recent call last):
>
>  File 
>"/opt/homebrew/lib/python3.11/site-packages/beancount/prices/price.py", 
>line 182, inimport_source
>
>    __import__(module_name)
>
>ModuleNotFoundError: No module named 'alphavantage'
>
>
>Ultimately, I’d like to fetch prices for some Australian stocks in my 
>portfolio (e.g., ASX:VDHG, ASX:VGS, etc.).
>
>
>Does anyone have advice on:
>
>• Workarounds for Yahoo?
>
>• How to enable or properly configure Alphavantage as a source?
>
>• Any other sources I can use for Australian stocks?
>
>
>Thanks in advance for your help! Any guidance would be much appreciated.
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"Beancount" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to beancount+unsubscr...@googlegroups.com.
>To view this discussion visit 
>https://groups.google.com/d/msgid/beancount/00f2c97f-9f7c-40b6-a783-93a1f53b1aafn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/beancount/EC61CBD7-52BA-43E4-90A3-926475F036EA%40tario.org.

Reply via email to