Building Local APIs with Express and Flask on Raspberry Pi
This project explores how to create lightweight, local APIs using Express (Node.js) and Flask (Python) – perfect for home network setups or IoT dashboards. To demonstrate the concept, I used a Raspberry Pi as the host device, paired with a 5.79-inch Waveshare E-paper Module (B) to display weather data.
🔧 Project Overview
The system is split into two main APIs and a display module:
- Express API (Node.js):
This service fetches weather data from api.open-meteo.com and sunrise/sunset times from api.sunrise-sunset.org. It also provides basic Raspberry Pi diagnostics like CPU temperature and uptime. - Flask API (Python):
This component pulls RSS feeds and filters out the latest News and Tech headlines, making it easy to stay updated without opening all websites. - Waveshare E-paper Display:
A Python script handles rendering the weather data on the E-paper screen. The low-power nature of E-paper makes it ideal for always-on status boards.
🚀 Automation
Both APIs are configured to run at startup on the Raspberry Pi, ensuring the system is self-sustaining and ready to serve data as soon as it boots.
This setup is a great starting point for anyone looking to build local dashboards, smart home interfaces, or simply experiment with API design and hardware integration.
The latest code can be found here on GitHub: SaharaHex/Pi-HomeX-API