The direct URL returns a nice JSON with price data in it, instantly. I let the bean-price command run for a while and it finished after a couple minutes. I'll stew on it.
On Wed, 2024-09-18 at 08:17 +0200, 'Patrick Ruckstuhl' via Beancount wrote: > That sounds weird, can you try to call the following URLs > > https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=IBM&apikey=demo > and > https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=AAPL&apikey=yourkey > > maybe with curl? > > On 18.09.2024 03:39, 'Aaron Axvig' via Beancount wrote: > > > > > Very strange, it just sits and does nothing after starting the > > HTTPS connection. So that makes me wonder I have some other > > network problem, because I was using the Yahoo source on a > > different machine and that started hanging in a similar way a > > couple weeks ago. I thought that was just Yahoo cutting everyone > > off. :) > > > > (venv):~/beancount/venv/bin$ ./bean-price -e > > 'USD:alphavantage/price:AAPL:USD' -vv --cache cache.db > > INFO : Using price cache at "cache.db" (with indefinite expiration) > > INFO : Processing at date: 2024-09-17 > > INFO : Fetching: price:AAPL:USD (time: None) > > DEBUG : Starting new HTTPS connection (1): www.alphavantage.co:443 > > > > The API key is set: > > > > (venv):~/beancount/venv/bin$ printenv | grep ALPHA > > ALPHAVANTAGE_API_KEY=snipped > > > > > > > > On Tue, 2024-09-17 at 18:30 +0200, 'Patrick Ruckstuhl' via > > Beancount wrote: > > > > > Hi, > > > > > > sure, first you have to provide the api key as an environment > > > variable > > > e.g. something like > > > export ALPHAVANTAGE_API_KEY=demo > > > and then call it like > > > > > > bean-price -e 'USD:alphavantage/price:AAPL:USD' -vv > > > > > > Regards, > > > Patrick > > > > > > On 17.09.2024 14:53, 'Aaron Axvig' via Beancount wrote: > > > > > > > > > > Could someone provide an example of fetching a price using > > > > Alphavantage? It is non-obvious to me: > > > > bean-price -e 'USD:alphavantage/AAPL' -vv > > > > INFO : Using price cache at "/tmp/bean-price.cache" (with indefinite > > > > expiration) > > > > INFO : Processing at date: 2024-09-17 > > > > INFO : Fetching: AAPL (time: None) > > > > ERROR : Error fetching AAPL: Invalid ticker. Use "price:SYMBOL:BASE" > > > > or "fx:CCY:BASE" format. > > > > ERROR : Could not fetch for job: DatedPrice(base='AAPL', quote='USD', > > > > date=None, sources=[PriceSource(module=<module > > > > 'beanprice.sources.alphavantage' from > > > > '/home/aaron/beancount/venv/lib/python3.11/site- > > > > packages/beanprice/sources/alphavantage.py'>, symbol='AAPL', > > > > invert=False)]) -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/711adbff4fe9c9c7905faed23d0ba1cfb4144952.camel%40axvig.com.
