Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticker for stocks #34

Open
ReneFroger opened this issue Jan 30, 2021 · 3 comments
Open

Ticker for stocks #34

ReneFroger opened this issue Jan 30, 2021 · 3 comments

Comments

@ReneFroger
Copy link

ReneFroger commented Jan 30, 2021

Hi there!

We met each other on Twitter. I would like to use this handy tool for stocks. I found a very good stock API:

For example, I use the ticker AAPL for the stock Apple, and MSFT for the stock MSFT. The query looks like this:

https://query1.finance.yahoo.com/v7/finance/quote?lang=en-US&region=US&corsDomain=finance.yahoo.com&symbols=AAPL,MSFT

I get the data back in JSON format. So I'm trying to use that API in your rate.sx.

When looking on the codebase, it seems the script uses Coinmarketcap's API to collect the data.When I tried to collect the data from the API of coinmarketcap, with the URL https://api.coinmarketcap.com/v1/ticker/ or https://api.coinmarketcap.com/v1/ticker/ETH I get an error

{"code": "410 Gone", "reason": "We no longer serving this endpoint here" }

But the script is still running fine however. Perhaps I'm missing something?

@chubin
Copy link
Owner

chubin commented Jan 31, 2021

Hi there!

We met each other on Twitter. I would like to use this handy tool for stocks. I found a very good stock API:

Hi Rene, please to meet you on Github too :) What was your twitter account? Are not Hodler by chance?

For example, I use the ticker AAPL for the stock Apple, and MSFT for the stock MSFT. The query looks like this:

https://query1.finance.yahoo.com/v7/finance/quote?lang=en-US&region=US&corsDomain=finance.yahoo.com&symbols=AAPL,MSFT

I get the data back in JSON format. So I'm trying to use that API in your rate.sx.

It would be absolutely great to have stocks as well all commodities prices (AU, AG etc)
on rate.sx, the main problem here is the data. If we would use open data sources like Yahoo Finance etc, we would generate too much traffic and very fast run into limits, but this problem is solvable too, if the users really would like to have this feature

The second question, is what namespace should we use for stocks, because cryptos and stocks names sets intersection is not empty, e.g. TRX is the TRON coin and Tanzanian Gold Corporation at the same time. We already discussed it, and suggestions were:

  • _TRX
  • .TRX
  • =TRX
  • ~TRX

for the stocks.

When looking on the codebase, it seems the script uses Coinmarketcap's API to collect the data.When I tried to collect the data from the API of coinmarketcap, with the URL https://api.coinmarketcap.com/v1/ticker/ or https://api.coinmarketcap.com/v1/ticker/ETH I get an error

{"code": "410 Gone", "reason": "We no longer serving this endpoint here" }

But the script is still running fine however. Perhaps I'm missing something?

Yes, this endpoint was switched off long ago, and now we use the paid service to get the data

@ReneFroger
Copy link
Author

Hi there!
We met each other on Twitter. I would like to use this handy tool for stocks. I found a very good stock API:

Hi Rene, please to meet you on Github too :) What was your twitter account? Are not Hodler by chance?

My name was "Denaamishaas" :)

It would be absolutely great to have stocks as well all commodities prices (AU, AG etc)
on rate.sx, the main problem here is the data. If we would use open data sources like Yahoo Finance etc, we would generate too much traffic and very fast run into limits, but this problem is solvable too, if the users really would like to have this feature

Concerning the traffic, I don't think so, I have another Stock ticker script running in my second monitor: https://github.com/pstadler/ticker.sh

On my second montior I see 68 stock tickers simultaneously, and it's refreshing every 1 second. It's running fine for some months, so I never got a issue with it. So I don't think we need to worry about that 😃

The second question, is what namespace should we use for stocks, because cryptos and stocks names sets intersection is not empty, e.g. TRX is the TRON coin and Tanzanian Gold Corporation at the same time. We already discussed it, and suggestions were:

  • _TRX
  • .TRX
  • =TRX
  • ~TRX

for the stocks.

Perhaps we could use the ticker $TRX instead? It's often used on Twitter to indicate stocks. As far I can see, the dollar sign is not used for cryptocurrencies. Perhaps the dollar sign should be self-explaining for the newcomers.

Yes, this endpoint was switched off long ago, and now we use the paid service to get the data

Okay, but I don't understand one thing: I'm still using your script, and it's working fine without paying for a paid service?

@chubin
Copy link
Owner

chubin commented Apr 22, 2021

I have another Stock ticker script running in my second monitor

The problem is that rate.sx is a service, what means that it will have to handle traffic
for all its clients, and not only for one client. I made some research in this area in the mean time,
and I think we will find a solution

Perhaps we could use the ticker $TRX instead?

This would be an obvious choice, the only problem with it that $ has special meaning
in shell, and it must be escaped in the query: curl rate.sx/\$TRX. I think many users will forget it,
but maybe it is still an option.

and it's working fine without paying for a paid service?

Yes. That's excatly what meant in the first paragraph.
The service is paid (for the server), but our service (rate.sx) is free for its users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants