Hi @prikhi, thanks for this nice command. I'd like to list it with the other third-party addons (iadd, interest) and have hledger-install.sh install it. To make it more user ready, I'll file a few wishlist issues here if that's ok ?
Some examples, as complete and reproducible as possible, will be a big help for users getting started. I had some trouble getting it to work when run as hledger stockquotes
; hledger-stockquotes
is working better. My biggest question at the moment is which commodities can be fetched. Could you explain the failures below - unsupported commodities, wrong symbols, rate limit exceeded, flaky api, or... ?
~/src/hledger$ cat commodities.journal
commodity USD 0.00
commodity EUR 0.00
commodity GBP 0.00
commodity AAPL 0.00
commodity TSLA 0.00
commodity ADA 0.000000
commodity BTC 0.00000000
commodity ETH 0.000000
~/src/hledger$ hledger-stockquotes -f commodities.journal -n
Error Fetching Symbol `ADA`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `BTC`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `EUR`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `GBP`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `TSLA`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
I tried it again respecting the rate limit (pretty slow!). This time it fetched TSLA:
~/src/hledger$ hledger-stockquotes -f commodities.journal
Error Fetching Symbol `GBP`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Waiting 60 seconds to respect API rate limits.
Error Fetching Symbol `ADA`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `BTC`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `EUR`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
I commented out all but AAPL and TSLA and saw intermittent failures:
~/src/hledger$ hledger-stockquotes -f commodities.journal
~/src/hledger$ hledger-stockquotes -f commodities.journal
~/src/hledger$ hledger-stockquotes -f commodities.journal
Error Fetching Symbol `TSLA`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
~/src/hledger$ hledger-stockquotes -f commodities.journal
Error Fetching Symbol `AAPL`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `TSLA`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
~/src/hledger$ hledger-stockquotes -f commodities.journal
Error Fetching Symbol `AAPL`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `TSLA`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
~/src/hledger$ hledger-stockquotes -f commodities.journal
Error Fetching Symbol `AAPL`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `TSLA`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
~/src/hledger$ hledger-stockquotes -f commodities.journal
Error Fetching Symbol `AAPL`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
Error Fetching Symbol `TSLA`: JsonHttpException "Error in $: key \"Time Series (Daily)\" not found"
~/src/hledger$ hledger-stockquotes -f commodities.journal
~/src/hledger$ hledger-stockquotes -f commodities.journal
Is their rate limiting really strict, is yours not entirely effective, or is it not a rate limit issue ? Might there be more error details that could be reported ?