[FR] API
See original GitHub issueWhat’s the problem of not having this feature? GamestonkTerminal has collected a ton of useful scripts and code, but it is all directly coupled to the command line program. it would be nice to have extensible ways to create other types of visualizations or clients.
Describe the solution you would like I think the simplest and most robust near term solution would be to:
- pull the core data fetching logic out out of the command methods
- publish the package so people can tap into it programatically
fortunately, the well structured code means these types of changes are as minor as they can get. if we take stocktwits_api.py for example, you can see we never need to change code, only slightly reorganize it:
def get_messages(s_ticker):
return requests.get(f"https://api.stocktwits.com/api/2/streams/symbol/{s_ticker}.json")
this method could now still be used by the internal messages() andbullbear() without more changes, but can also be consumed and reformatted by other programs.
Describe alternatives you’ve considered currently i am just maintaining a separate fork where i am extracting all these methods out. the speed at which the project is moving suggests this is not a tenable solution though.
i could also try parsing the string based output of the program, but please don’t make me.
Additional information when i say “publish the package” i say this because i was unable to include GamestonkTerminal as an external package, even when using a git remote. but Python is not my native home so maybe i was doing something wrong. in any case, even if this is oversight on my part, it would still require the data fetching methods to be abstracted out before it was super useful.
while this “feature” would be useful for any program, i am personally using it to create a GraphQL API so i can power any number of other clients:

if you think this is a viable suggestion, i’d be happy to contribute to a solution. and it would enable me to separately publish the GraphQL API i made. 😃
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:18 (2 by maintainers)

Top Related StackOverflow Question
also, what command do i use to figure out why all my stocks are tanking right now?
You would want to look at cyclical performance. I.e. compare stock performance March 2019 to March 2020 to March 2021.
Also compare the behavior of different industries at different stages of the business life cycle. Compare the behavior of growth stocks to value stocks. Stock market vs Bonds vs Commodities.
I will be adding portfolio analysis and modeling features.