When I fooled around with the
BTC value at msg date demo, I implemented a simple API to get the BTC price in dollars at a specific date, as an image.
For dates between 2010-10-17 and 2023-01-27, I'm using the closing quotes from a static list, downloaded from
https://coincodex.com.
From 2023-01-28, I'm appending this list daily, with the XBX average from
https://www.coindesk.com.
Queries specifying dates before 2010-10-17 yield 0. Queries with dates in the future yield the latest known quote (this limitation will be removed in a future version
![Wink](https://bitcointalk.org/Smileys/default/wink.gif)
).
I store each quote in whole dollars - queries with large quantities (specified with
nof) may suffer from rounding errors.
Because of time zones and daily volatility, the quotes should be considered approximate; in any case, I take no responsibility for the accuracy, performance or longevity of this service.
Syntax examplesHere's a long one with date and nof parameters and an img parameter with options pointsize, colour, background colour (semi-transparent), font and border (remove white-space):
[img]
https://ztt.se/btc:quote ?
date=2021-11-09 &
nof=1.5 &
img=ps:24 + col:DeepSkyBlue4 + bcol:$FECC0280 + font:Snap-ITC + border:10x4
[/img]
![](https://ip.bitcointalk.org/?u=https%3A%2F%2Fztt.se%2Fbtc%3Aquote%3Fdate%3D2021-11-09%26nof%3D1.5%26img%3Dps%3A24%2Bcol%3ADeepSkyBlue4%2Bbcol%3A%24FECC0280%2Bfont%3ASnap-ITC%2Bborder%3A10x4&t=665&c=J73KbmLJWTP2Rg)
The basic
URI is
https://ztt.se/btc:quote which yields a PNG image with text on a transparent background.
Append a questionmark
? to this if you want to add parameters.
Separate multiple parameters with ampersand
&.
Separate multiple parameter options with plus
+.
A parameter can be a singleton, or a name-value pair; use the equal sign
= to separate name and value.
A parameter option can be a singleton, or a name-value pair; use a colon
: to separate name and value.
Dates must be specified in
YYYY-MM-DD format.
Note: This gives the price in dollars for bitcoin (1 coin or as many as specified with the
nof parameter) at a specific date (specified with the
date parameter). On its own, it does
not show address balancies or anything else.