Skip to content

apscrapes/ExtractToInk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExtractToInk

alt text

ExtractToInk is a minimal, end-to-end demo project that shows how to extract live data from the web using Zyte API and render it on an e-ink display.

It scrapes gold and silver prices from website and displays them on an Inky pHAT e-ink screen using a Raspberry Pi.


What this project demonstrates

It shows how to:

  • Use Zyte Extract API to fetch fully browser rendered HTML
  • Parse structured data using CSS selectors
  • Separate scraping logic from rendering logic
  • Render clean, high-contrast UI on an e-ink display
  • Build a real-world, physical output from web data

Think of it as:

From web data → physical display, with no dashboards in between.


Hardware used

  • Raspberry Pi on RaspberryPi OS (tested on Pi Zero 2 W)
  • Pimoroni Inky pHAT (Black / SSD1608)
  • 5V power supply

Software stack

  • Python 3
  • Zyte Extract API (browserHTML:true)
  • Requests
  • BeautifulSoup
  • Pillow
  • Inky Python library
  • Fredoka One font

How it works

Website (JS-heavy)
↓
Zyte Extract API 
↓
Rendered browserHTML
↓
BeautifulSoup + CSS selectors
↓
Structured price data
↓
Pillow image rendering
↓
Inky pHAT e-ink display

Install dependencies

#1 Install Raspberry Pi OS #2 Attach the e-ink display #3 boot the pi #4 Update the pi sudo apt update && sudo apt -y upgrade #5 Enable i2c and SPI using sudo raspi-config #6 reboot

Install necessary libraries to run e-ink display

for this example I am using Pimoroni e-ink pHat, but every vendor has a support package just find and install it. for example, for pimorini the instructions are available on their product page, if you're using same e-ink you can follow along or after your setup move to next step.

git clone https://github.com/pimoroni/inky
cd inky
./install.sh

Install zyte-api

pip install zyte-api requests beautifulsoup4 pillow 

Working

Inside your raspberry pi (using ssh or otherwise)

  1. clone the project
git clone https://github.com/yourusername/extract-to-ink.git
cd extract-to-ink
  1. Create a .env file and add your Zyte API key
echo "ZYTE_API_KEY = "YOUR_API_KEY_HERE" > .env
  1. Run the project
python main.py

⚠️ E-ink displays take 5-10 seconds to refresh. Don’t interrupt the process.


Output

The display shows:

  • Gold buy price
  • Gold sell price
  • Silver price
  • Last refreshed timestamp

Ideas to extend this project

  • Run it via cron every 10 minutes or 4 hours
  • Add more commodities, stocks or currencies
  • Display price deltas (▲ ▼)
  • Add diff-based refresh (update only when data changes)
  • Turn it into a systemd service
  • Swap e-ink for another output (LED, PDF, dashboard)

Who is this for?

Zyte community members Developers learning web scraping Raspberry Pi & e-ink hobbyists


Common debugging

Q. E-ink display not getting detected : A. Make sure you enabled i2c and SPI

Q. How can I make data refreshed automatically A. Create a cronjob to run main.py after your desired interval

Q. Zyte API call failed A. Make sure Zyte API key is correctly set in a .env file located in same directory.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages