MycroftAI / skill-stock

Mycroft AI official Stock Skill - providing current prices of stocks
https://mycroft.ai/skills
Apache License 2.0
6 stars 18 forks source link

Skill doesn't return symbols or values with financialmodelingprep API changes #31

Open NeonDaniel opened 4 years ago

NeonDaniel commented 4 years ago

financialmodelingprep no longer offers a free api and the request syntax has changed. Are there any alternative free sources?

krisgesling commented 4 years ago

Hey Daniel, we've deactivated the Skill for the moment :(

It's a recurring issue unfortunately - see #19

If anyone can suggest a good alternatively please let us know :)

NeonDaniel commented 4 years ago

Yeah, I was surprised when FMP was added here with no API key requirement.. I've used AlphaVantage (Requires an API key and is limited to 500/day and 5/minute); I changed our forked stock skill to support either FMP or AlphaVantage, but still looking for an unlimited or less limited source.

NeonDaniel commented 4 years ago

Found this comparative of sources (https://medium.com/@andy.m9627/the-ultimate-guide-to-stock-market-apis-for-2020-1de6f55adbb). Haven't had time to look into all of these, but I think finnhub has some non-personal-use restrictions and iex-cloud looks promising but lacks search by name (symbol only). Not sure if this skill is something Mycroft would consider handling like weather or wolfram|alpha as far as managing API credentials, or have users provide their own credentials (some options offer free personal accounts)?

Also, it may be worth building an internal database/dictionary of names to symbols (or maybe there's a package for this that I haven't been able to find). This would allow a more modular approach to replacing the data provider if we already have symbols available.

krisgesling commented 4 years ago

Yeah we're going to add an API proxy with the option for people to enter a personal key if they don't want to use our proxy service.

At the moment I'm leaning toward sticking with FMP. Any preferences yourself?

I would also prefer to extract the service providers from the Skill logic for these types of Skills - weather included.

NeonDaniel commented 4 years ago

I was happy with FMP and Alpha Vantage in terms of their search and results (didn't do more than spot check the accuracy of either).

I like having the flexibility of services built into the skills (i.e. I have get_symbol and get_quote as two functions with a case statement for which service within each). That helped me keep my stock skill working when FMP changed their API since I just changed my config back to Alpha Vantage. I think this is what you mean by extracting service providers from skill logic?

gcoon151 commented 4 years ago

This seems an easy answer? https://raw.githubusercontent.com/pstadler/ticker.sh/master/ticker.sh

For the actual quote. I haven't dug into the shell script itself yet but I think you could easily call the Yahoo stock lookup the same way.

krisgesling commented 4 years ago

Hey thanks for the tip.

It does seem open, though I can't find any official documentation for it. It seems like it's officially been shut down but still exists in a few forms unofficially. Some claim a rate limit of 500 per day, others 2000 per hour :shrug:

I think we're better off switching to paid and sustainable service, but if anyone wants to add the Yahoo finance API in the meantime, we'll happily accept a PR.

danboysk commented 4 years ago

Hi

In terms of alternative Financial API's - I came across this:

https://towardsdatascience.com/best-5-free-stock-market-apis-in-2019-ad91dddec984

It includes Yahoo Finance, Google and others.

I also found this article. https://rapidapi.com/blog/best-stock-api/

Would this help? I'd like to be more help but my programming skills aren't yet strong enough to do the heavy lifting.

krisgesling commented 3 years ago

Hey Dan, if anyone wants to add a free API, we're happy to accept a PR, but I'm keen for us to just move to a solid paid solution and have a more stable Skill so we don't need to keep fixing it.

We'll add a paid key to the backend as soon as we (or anyone else) has time to rework the Skill for FMP's paid service.

danboysk commented 3 years ago

Hi Kris

Not sure what you mean by PR, but is there demand for a paid/premium skill? I'd be interested in supporting the effort,

On a different topic, I raised an issue with Spotify as per the request but is there any news on that front?

Cheers

krisgesling commented 3 years ago

Sorry, PR is a pull request, essentially a code contribution.

Some Skills require paid API's and we provide that as part of the service. Individual users could get their own API key but it's a real hassle having to go and do that for all the different Skills. They also come with different levels of free vs paid.

In terms of Spotify, we are continuing to try and talk with them but so far they haven't been helpful. :(

danboysk commented 3 years ago

Sorry, PR is a pull request, essentially a code contribution.

Some Skills require paid API's and we provide that as part of the service. Individual users could get their own API key but it's a real hassle having to go and do that for all the different Skills. They also come with different levels of free vs paid.

In terms of Spotify, we are continuing to try and talk with them but so far they haven't been helpful. :(

Thanks for the explaination and update

goldyfruit commented 3 years ago

@danboysk about Spotify have a look here: https://community.mycroft.ai/t/attention-are-you-a-spotify-user-spotify-disabled-on-mycroft/9320/23?u=goldyfruit

NeonDaniel commented 3 years ago

Came across this option if this skill is still being maintained: https://developer.tradier.com/

krisgesling commented 3 years ago

Yeah cool - I have submitted a PR to remove the Skill from the Marketplace and devices as we aren't prioritizing it internally yet and it seems silly to install an intentionally disabled Skill if there's no timeline on when it will be fixed.

If anyone does want to work on it, we'd still love to switch over to one of these alternative API's, just not sure when we'll get time to do it if no one in the community is keen.

NeonDaniel commented 3 years ago

Could treat this like Spotify and just require users to provide a key in config (many of these API's are free for personal use with reasonable limits).

Another option is if someone wants to write a module to get stock ticker symbols (it is all public information), I came across a module for getting stock values: yfinance (currently maintained with a release today) https://pypi.org/project/yfinance/