Skip to content

Latest commit

 

History

History
73 lines (45 loc) · 1.96 KB

File metadata and controls

73 lines (45 loc) · 1.96 KB

Public API

Using what you have learnt about HTTP request and REST APIs, in today's project you will build a website that uses data from a public API.

For example, previously we create a rain alert app using a weather API. We also created an ISS tracker and looking into Bitcoin prices, all using a public API.

Today, you get to work on an API that you find interesting and build a service or website based on that API.

Here are some example APIs:

New York Subway Data

Elephant Data

Barcode Generator/Recognition

Stock Market Data

Harry Potter Data

Art Data

Dictionary API

ESPN Data

Food Facts API

Brewery Data

Spelling and Grammar Check API

Sound Effects API

Lord of the Rings API

✅ Complete Application Created

Main Components:

 - app.py - Flask application with blueprint registration
 - config.py - Configuration with Open Food Facts API settings
 - 3 Services - Barcode decoder, generator, and product API client
 - 2 Route Blueprints - Main pages and barcode operations
 - 6 HTML Templates - Full responsive UI with Bootstrap 5
 - CSS/JavaScript - Custom styling and interactive features
 - Tests - Basic test suite included

Key Features:

 - 📸 Decode barcodes from uploaded images
 - ✨ Generate barcodes in multiple formats (EAN-13, EAN-8, UPC-A, Code128)
 - 🍕 Product lookup using Open Food Facts API (free, no key needed!)
 - 📱 Responsive design works on all devices
 - 🔒 Security - file validation, sanitization, auto-cleanup

Recommended Setup:

 - API: Open Food Facts (perfect for European/Italian products)
 - Barcode Type: EAN-13 (standard in Europe)
 - Test Barcodes: Italian products included (Nutella, Barilla, etc.)

To start:

 sudo apt-get install libzbar0
 python3 -m venv venv
 source venv/bin/activate
 pip install -r requirements.txt
 python app.py

Then open http://localhost:5000 in your bro

Check QUICKSTART.md for detailed instructions!