An ESP32 walks into a bar - Jokes web API MicroPython tutorial

In this tutorial, we learn to use the network and urequests libraries in MicroPython to connect an ESP32 to the web and fetch programming jokes!

An ESP32 walks into a bar - Jokes web API MicroPython tutorial

(If this is your first time here, check out my first MicroPython tutorial. Use it to get acquainted with the Wokwi simulator interface so that you are prepared to dive into this tutorial)

This week, our MicroPython tutorial flies away and connects to the web to fetch data from an API! While filming it, I ran into a temporary issue with the Wokwi simulator (thankfully it's fixed now 🙂) so I ported the code to an actual ESP32 to continue the tutorial. Crisis averted, whew! What we can learn from this experience is that Wokwi is actually a perfect prototyping tool because I had to make zero changes to the code for it to work on real hardware. Amazing!

Hope you enjoy, and click follow/subscribe down below and on my YouTube channel to get notified when new tutorials are out! I release them about once a week. As always, if you have questions or just wanna chat, hit me up on twitter!

Final solution - Live Wokwi simulator playground