The bitcoin price image generator is a simple tool that creates a dynamic image of a price in BTC, based on a fixed USD price. The resulting image can be embedded in a forum post, for example, and it will always show an up-to-date BTC equivalent price. This is useful when you want to show a price for something in BTC, but you want the price to be pinned to a USD value (and not have to update your post every day as the BTC/USD exchange rate fluctuates). This tool relies on the global weighted average from BitcoinAverage.
Problems? Suggestions? Open an issue.
Source available on GitHub.
The advanced version of the tool allows for a choice of currency (anything supported by BitcoinAverage). Read about it below.
Simply build a URL of the form:
<price_in_usd> is the price you want in USD.
You can also add an optional color argument to change the color of the text:
The color code should be an html-like hex code (for white:
f). See wikipedia
for more info. The background of the image will be transparent.
Say you want to sell an item for $10. You can generate an image using:
Which will yield the image:
If you want to change the color (to more closely match the text in your forum post, for example), use:
You can then embed the image in your post using that URL. In BBCode, this would be:
Higher resolution images can be generated by including a device pixel ratio in the url path:
Note that this will require scaling the image down using CSS. In the above example, the
<img> tag includes the inline style
The advanced version is available to allow changing the display currency, and allow for fancier options in the future. The URL format is of the form:
price: the desired price in USD, e.g.
10.0. Include a currency code to use something else as your reference, like
LTC. Defaults to
color: same as in the basic version above.
dpr: device pixel ratio, e.g.
2x. Defaults to
An additional tool allows you to check the balance of any bitcoin address using the API from blockchain.info. Simply build a URL of the form:
As in the basic version above, the color argument is optional and accepts html-like hex codes.
This endpoint also includes a high resolution form:
by Ford Hurley (1E765eZrLQnhANCmgBSu3Hy2DbZktEFQ7h)