Bitcoin Forum
September 08, 2024, 05:44:31 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Use this BBCode to insert historical BTC quote in your post  (Read 203 times)
npuath (OP)
Copper Member
Jr. Member
*
Offline Offline

Activity: 42
Merit: 67


View Profile
January 30, 2023, 04:50:36 AM
Last edit: February 05, 2023, 01:21:14 PM by npuath
Merited by hugeblack (10), Welsh (8), vapourminer (4), LoyceV (4), DdmrDdmr (4), Halab (2), dkbit98 (1), joker_josue (1), noorman0 (1), digaran (1)
 #1

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).

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 examples

[img]https://ztt.se/btc:quote[/img]  =>      No date equals today.
[img]https://ztt.se/btc:quote?date=2013-06-09[/img]  =>      Specific date.
[img]https://ztt.se/btc:quote?date=2013-06-09&nof=2[/img]  =>      Number of coins.
[img]https://ztt.se/btc:quote?img=col:green[/img]  =>      Image colour.

Here'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):
Code:
[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]



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.


digaran
Copper Member
Hero Member
*****
Offline Offline

Activity: 1330
Merit: 899

🖤😏


View Profile
January 30, 2023, 06:01:43 AM
 #2

Do we need to do it ourselves or is this for the Boss theymos to add to the forum? I'm going back editing my posts adding BTCBTC.🙃 thanks for the work done.👍

🖤😏
npuath (OP)
Copper Member
Jr. Member
*
Offline Offline

Activity: 42
Merit: 67


View Profile
January 30, 2023, 06:26:28 AM
 #3

It should work on its own  Smiley
PX-Z
Hero Member
*****
Online Online

Activity: 1568
Merit: 883


Top Crypto Casino


View Profile WWW
January 30, 2023, 06:28:59 AM
Merited by npuath (1)
 #4

There is an existing thread made by TryNinja[1]. Here's also the reference thread[2] but seems both are not working now. So i suggest you to create a thread for this on Project Development[3], maybe you can create it as version 3 with some conversions too? Idk.
But anyway this is a useful site, especially to sellers in Marketplace and those who are active in auctions who usually use a dynamic price in USD, BTC or EUR.

[1] https://bitcointalk.org/index.php?topic=5160033
[2] https://bitcointalk.org/index.php?topic=151565.0
[3] https://bitcointalk.org/index.php?board=12.0

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
npuath (OP)
Copper Member
Jr. Member
*
Offline Offline

Activity: 42
Merit: 67


View Profile
January 30, 2023, 06:34:33 AM
 #5

Thanks, I'll check them out.
joker_josue
Legendary
*
Offline Offline

Activity: 1778
Merit: 4838


**In BTC since 2013**


View Profile WWW
January 30, 2023, 07:57:26 AM
 #6

Interesting information, good job.

In the image that sets the price based on a date, I think you should also include the date.
Thus, it is easier for the reader to understand what price that value refers to.

npuath (OP)
Copper Member
Jr. Member
*
Offline Offline

Activity: 42
Merit: 67


View Profile
January 30, 2023, 12:21:50 PM
 #7

Thanks! And you're right, but as it is, you can choose if and how to include a date using normal text, so that you could write "The price in dollars was for one (1) BTC at 9 november 2022" quite fluidly (that's why I also don't include a $ sign).

joker_josue
Legendary
*
Offline Offline

Activity: 1778
Merit: 4838


**In BTC since 2013**


View Profile WWW
January 30, 2023, 12:32:05 PM
 #8

But taking into account that the information is always in dollars and, in this case, from a specific date, it would be better for the image itself to include this information to avoid misinterpretations, if whoever makes the post does not include all the information.

npuath (OP)
Copper Member
Jr. Member
*
Offline Offline

Activity: 42
Merit: 67


View Profile
January 30, 2023, 12:52:56 PM
 #9

But it should be optional, don't you think? After all, we're not Apple; we actually let people decide things for themselves.  Cheesy
joker_josue
Legendary
*
Offline Offline

Activity: 1778
Merit: 4838


**In BTC since 2013**


View Profile WWW
January 30, 2023, 02:48:16 PM
 #10

But it should be optional, don't you think? After all, we're not Apple; we actually let people decide things for themselves.  Cheesy

There it is true.  Cheesy
But at least the indication that the value is in dollars, I think it made sense. Here's the suggestion.

noorman0
Hero Member
*****
Offline Offline

Activity: 1764
Merit: 696


[Nope]No hype delivers more than hope


View Profile WWW
January 30, 2023, 03:32:00 PM
Merited by npuath (3), vapourminer (2)
 #11

Loved this, exactly what I was hoping for in my request in another tool. Can you retrieve prices with a shorter time history for no date query (eg closing price in the last 1 hour).

For everyone's information: use "&" to combine multiple queries like color and date at once. Example (BTC price per 2017-12-27)

Code:
[img]https://ztt.se/btc:quote?img=col:blue&date=2017-12-27[/img]

This space for rent.
Available in mid January 2024 - PM me
npuath (OP)
Copper Member
Jr. Member
*
Offline Offline

Activity: 42
Merit: 67


View Profile
February 01, 2023, 10:30:18 AM
Merited by vapourminer (2)
 #12

... Can you retrieve prices with a shorter time history for no date query (eg closing price in the last 1 hour). ...

Sure, [img]https://ztt.se/btc:quote[/img] (and all other no-date queries) now yields the real-time XBT average (disregarding forum image proxy caches).


npuath (OP)
Copper Member
Jr. Member
*
Offline Offline

Activity: 42
Merit: 67


View Profile
February 01, 2023, 12:20:45 PM
 #13

For everyone's information: use "&" to combine multiple queries like color and date at once.

Right, I'll update the OP to be clearer on that, thanks!

Also, I'll add some examples on other formating options.


Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!