Coder Social home page Coder Social logo

chubin / rate.sx Goto Github PK

View Code? Open in Web Editor NEW
966.0 966.0 87.0 265 KB

:moneybag: curl cryptocurrencies exchange rates

Home Page: http://rate.sx

License: MIT License

Python 88.04% Shell 10.80% CSS 0.34% JavaScript 0.83%
bitcoin cli crypto cryptocurrency curl terminal

rate.sx's People

Contributors

0xflotus avatar asymmetric avatar brlipi avatar cclauss avatar chubin avatar cypherius17 avatar goznalo-git avatar jerzybrzoska avatar kasramp avatar lukesmithxyz avatar smartm0use avatar stigi avatar turbo-cafe avatar yellowred avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rate.sx's Issues

curl rate.sx/avax not working

Hello, I can't curl for avax coin
I mean, when I run
$ curl 'rate.sx?n=30'

The result shows Avax
image

But
$ curl 'rate.sx/avax'
not works as expected
image

Ticker for stocks

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?

Feature Request: Side by Side of two charts

While I can do this with in bash by simply using a paste command (paste <(curl -s rate.sx/BTC) <(curl -s rate.sx/DOGE)), the spacing between chart elements above and below the chart is lacking. For most part it's like a tab separation (probably because of paste's default -d option being set to the tab character)

I was wondering if there was anyway to move the information from the second chart to align with the second chart.

Possible Bogus Value at Specific Date

Hello, for a few weeks now I've noticed that December 14th has a strange and extraordinarily large value for multiple coins; in fact, every one that I've tested.
Is this something wrong on my end? I feel that this would have been brought up already if that wasn't the case.
I've tested this on an Arch and Gentoo installation, with several terminals, as well as on an iPhone.
Curious to see if this is affecting anyone else.
dec14

JSON output

Hello,

I'm BM. A very nice and polite guy.

Feature requests:

  1. Choosing which columns to display. For example I don't want the graph in the rightmost column.

  2. Output as plain text. When I try to use curl rate.sx > rates.txt the valuable data gets obscured by all the formatting. It's currently not possible to do that. Please make it so that we can simply choose the data we want and output to plain text without coloring, lines, graphics etc. Example:

BTC. Price: 39000. Changes +1%
ETH. Price: 2000. Changes +2%

Thanks.

Missing lines in chart

https://uplr.it/d9820.png

There seems to be some missing lines for doge@1y. Is this missing data (expected) or a bug in the renderer?

No Ravencoin?

Ravencoin is in top 100
Can I get a graph for RVN?
curl rate.sx/rvn
prints out ERROR: Invalid coin/currency name: RVN

Invalid coin/currency name: USD

Hi! Awesome project!

Any reason why rate.sx can't graph currencies against currencies?

For example, the following doesn't work:

$ curl brl.rate.sx/usd@id
ERROR: Invalid coin/currency name: USD

While curl brl.rate.sx/btc@id works fine.

Thank you.

Invalid coin/currency name: USD

Hi! Awesome project!

Any reason why rate.sx can't graph currencies against currencies?

For example, the following doesn't work:

$ curl brl.rate.sx/usd@1d
ERROR: Invalid coin/currency name: USD

While curl brl.rate.sx/btc@1d and curl brl.rate.sx/1usd work fine.

Thank you.

Prints Dollar Sign for any currency

Hi,
since .. like 2 hours ago I get a $ sign instead of € sign when I query like this:
curl eur.rate.sx/xmr
... begin: $219.01 (Thu 27 00:10) // end: $205.60 (Fri 28 00:00)~ ...

ERROR: Invalid coin/currency name: VET

VET is currently ranked at #34 but not supported by rate.sx :

curl rate.sx/\?n=40 | grep VET
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 26880  100 26880    0     0  30494      0 --:--:-- --:--:-- --:--:-- 30720
│ 34   │ VET   │ 0.0165256   │ 3.31%        │ 1.14%       │ 1.198B           │ ▁▃▁▂▇▂▂▃▂▇▁▅ │

When you try to get rate specific for VET

curl rate.sx/vet
ERROR: Invalid coin/currency name: VET

This is a similar issue with #63 and #65 ..

Fiat currencies except USD are not supported

curl eur.rate.sx/xmr

returns

`

<title>500 Internal Server Error</title>

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

`

SSL certificate has expired - https

Is it on my end, or is this the result for everyone?
Output of:

$ curl https://rate.sx

curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Dependency missing prevents building from source

Currently termdata is missing from Pypi so its not possible to source from requirements.txt. Has this dependency changed names? Punching it into search engines has turned up nothing, I can't seem to find an archive of it, or a description of what it did.

Default to HTTPS

It would be cool if the rate.sx defaulted to HTTPS. AFAIK two ways of doing this would be 301 redirects or HSTS.

Bug: doesn't seem to handle arguments

I really love your different APIs and tools. They are really reat.

I am trying to use it on my ncurses status window, but can't get output without ANSI colors:
http://rate.sx/?T
giving me this output:
image

same with: curl 'rate.sx/?qT&n=20' which displays both footer and header, which seems to be a bug. the n argument, however, works. It just seems to be "T" and "q". also would it be possible to add the "f" argument to rate.sx, much like on wttr.in, not that i don't want to subscribe to your twitter, but i don't need to be reminded when ever i am checking the weather.

Hope you have a possibility to fix it,

Blocky charts

Hi,

There must be something wrong with my terminal configuration (maybe the fonts?), because this is how charts render:

2018-12-25-121202_1920x1080_scrot

I'm using alacritty with the hack font.

Let me know if there's any other config that could help debug the issue.

Call to get list of supported currencies

From the help page:

Supported currencies:

    USD, AUD, CAD, CHF, CNY, EUR, GBP, IDR, JPY, KRW, RUB

It could be useful for other code that uses rate.sx if this list could be pulled from a URL, perhaps ideally with descriptions of currencies. If that were available then code like this wouldn't be necessary and third party code won't need to be updated any time you add another currency.

Malformed request kills server

I was accidently found out that malformed request kills server with 504 Gateway Time-out error.
Request example ("h" char in place of number parameter):
curl rate.sx/btc@hh

Graph endpoint produces HTML instead of ascii/ansi with powershell

Invoke-WebRequest rate.sx/eth
<html>
<head><title>rate.sx</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="/files/style.css" />
<link rel="stylesheet" type="text/css" href="/files/fonts/stylesheet.css" />
<style type="text/css">
.ef0,.f0 { color: #000000; } .eb0,.b0 { background-color: #000000; }
.ef1,.f1 { color: #CD0000; } .eb1,.b1 { background-color: #CD0000; }
.ef2,.f2 { color: #00CD00; } .eb2,.b2 { background-color: #00CD00; }
.ef3,.f3 { color: #CDCD00; } .eb3,.b3 { background-color: #CDCD00; }
.ef4,.f4 { color: #0000EE; } .eb4,.b4 { background-color: #0000EE; }
.ef5,.f5 { color: #CD00CD; } .eb5,.b5 { background-color: #CD00CD; }
.ef6,.f6 { color: #00CDCD; } .eb6,.b6 { background-color: #00CDCD; }
.ef7,.f7 { color: #E5E5E5; } .eb7,.b7 { background-color: #E5E5E5; }

PSVersionTable:

Name                           Value
----                           -----
PSVersion                      7.2.3
PSEdition                      Core
GitCommitId                    7.2.3
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Remove numbers after decimal?!

Would wish there was an option to remove decimals and all numbers after. I'm not interested in the whole number because I'm having this in my tmux config.

Didn't see any option for this if this maybe is easy to implement?

Feature Request: Single line currency summary

I think it would be useful to have a single line summary for a given currency. I am interested in this so I can display cryptocurrency information in i3blocks. I was thinking it would have the current value of the coin and the 24 hour % change.

If this feature would be accepted, and it does not already exist, I can create a PR to add it.

Not working for currencies

$ curl https://rate.sx/jpy
ERROR: No data found for your query. Wrong range?

$ curl https://rate.sx/eur
ERROR: No data found for your query. Wrong range?

For USD bug, see #60

Add https support

 curl -vvvv rate.sx
* Rebuilt URL to: rate.sx/
*   Trying 5.9.243.188...
* TCP_NODELAY set
* connect to 5.9.243.188 port 443 failed: Connection refused
* Failed to connect to rate.sx port 443: Connection refused
* Closing connection 0
curl: (7) Failed to connect to rate.sx port 443: Connection refused
❯ curl --version
curl 7.55.1 (x86_64-pc-linux-gnu) libcurl/7.55.1 OpenSSL/1.0.2g zlib/1.2.11 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) librtmp/2.3
Release-Date: 2017-08-14
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy PSL

Output in ASCII

Hi

I think it would be a good idea to allow the user to get the output in ASCII rather than Unicode (Some terminals are this dumb)

Thanks!

Uniswap (UNI) and Filecoin (FIL) support?

Does rate.sx support UNI and FIL?

I tried curl rate.sx/fil and curl rate.sx/uni, and I'm getting ERROR: Invalid coin/currency name.

If there's no support, will it be possible to add it?

Add The Utility Bixos Token (UBXS)

We often use rate.sx in the office and we got pretty used to the ease and smart design it provides. Now we need rate.sx services for the calculations, tracking and daily use for our own token that we released to the market which has a great project behind it. Can you please include UBXS in rate.sx?

not updating?

since around 22:30 18th August 2022 it seems all the data is the same, nothing is updating?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.