Random Nerd Tutorials

Retrieving Bitcoin Price Using ESP8266 WiFi Module


In this project you’re going to create a simple HTTP client with an ESP8266 WiFi module. Having your ESP8266 connected to your network, it requests the current Bitcoin price. This is an example on how to  retrieve data from the web.


Before you read this post, I recommend reading these tutorials about the ESP8266:

First, flash your ESP8266 module with NodeMCU

NodeMCU is a firmware that allows you to program the ESP8266 modules with LUA script. And you’ll find it very similar to the way you program your Arduino. With just a few lines of code you can establish a WiFi connection, control the ESP8266 GPIOs, turning your ESP8266 into a web server and a lot more. Follow this tutorial to Flash your ESP8266 with NodeMCU.

Where to buy?

You can click here to compare the ESP-01 Board price at different stores (read Best ESP8266 Wi-Fi Development Board)

Schematics (3.3V FTDI Programmer)

The schematics for this project are very straight forward. You only need to establish a serial communication between your FTDI programmer and your ESP8266. You can check this page to get an FTDI programmer at the best price.


  • RX -> TX
  • TX -> RX
  • CH_PD -> 3.3V
  • VCC -> 3.3V
  • GND -> GND


You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Downloading ESPlorer

I recommend using the ESPlorer program created by 4refr0nt to create and save LUA files into your ESP8266. Follow these instructions to download and install ESPlorer:

  1. Click here to download ESPlorer
  2. Unzip that folder
  3. Go to the dist folder (here’s the path: ESPlorer-master\ESPlorer\dist)
  4. Run ESPlorer.jar. It’s a JAVA program, so you need JAVA installed on your computer.
  5. Open the ESPlorer

esplorer start

How to send commands to your ESP8266

When you open the ESPlorer you should see a window similar to the preceding Figure, follow these instructions to send commands to your ESP8266:

  1. Connect your FTDI programmer to your computer
  2. Select your FTDI programmer port (COM8, for example)
  3. Press Open/Close
  4. Select NodeMCU+MicroPtyhon tab
  5. Copy the following script into ESPlorer

Note: You need to add your own network credentials to line 2.


Then you simply click the button Send to ESP. And you should see a query appearing in your screen with the current Bitcoin price and a few other detailsEverything that you need to worry about or change is highlighted in red box in the following Figure.


Retrieved Data

Here’s the data that your ESP8266 is requesting, you can access it with your web browser right now: http://api.coindesk.com/v1/bpi/currentprice.json

Below you can see the data that your ESP8266 requested which is the current price of Bitcoins in USD, GPB and EUR.

{“time”:{“updated”:”Mar 4, 2015 15:10:00 UTC”,”updatedISO”:”2015-03-04T15:10:00+00:00″,”updateduk”:”Mar 4, 2015 at 15:10 GMT”},”disclaimer”:”This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org”,”bpi”:{“USD”:{“code”:”USD“,”symbol”:”$”,”rate”:”282.5891“,”description”:”United States Dollar”,”rate_float”:282.5891},”GBP”:{“code”:”GBP“,”symbol”:”£”,”rate”:”184.6234“,”description”:”British Pound Sterling”,”rate_float”:184.6234},”EUR”:{“code”:”EUR“,”symbol”:”€”,”rate”:”254.3166“,”description”:”Euro”,”rate_float”:254.3166}}}


Sometimes your ESP8266 doesn’t have enough time to send the HTTP request when you press “Send to ESP”. So It won’t show any data retrieved. You might want to use this feature on the ESPlorer that is called “Send current line to ESP8266“. And send each line of your script at a time.


Taking it further

You’re requesting the current Bitcoin price, that doesn’t seem that useful… right? Wrong! Just think for one second with a $4 WiFi module you can request any data from the web, how awesome is that?

Now my question is: which data is important for your project? The weather? Sport scores? Just type in your search engine: “weather api”, “finances api”, pretty much any term that contains some sort of data followed by api will be available to retrieve data.

Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.

MicroPython Programming with ESP32/ESP8266 eBook

Learn how to program the ESP boards with MicroPython, including projects, tips, and tricks! The registrations are open for a limited time, so SIGN UP NOW »

Recommended Resources

Home Automation using ESP8266 »
Build IoT projects and home automation gadgets with the ESP8266 Wi-Fi module.

Build a Home Automation System »
Learn how to build a automation system using open-source hardware and software from scratch.

Arduino Step-by-Step Projects »
Build 25 cool Arduino projects with our course even with no prior experience!

Leave a Comment:

Add Your Reply

⏰ Registrations are open for "MicroPython Programming with ESP32 and ESP8266" eBook