A full-stack web application for extracting listing data from OfferUp item pages. Built with Python Flask backend and React frontend.
- π Real-time scraping - Extract data from OfferUp listings instantly
- π¨ Modern UI - Beautiful, responsive interface built with React and Tailwind CSS
- π Complete data extraction - Title, price, description, images, location, and seller info
- π‘οΈ Error handling - Robust error handling and retry logic
- π REST API - Clean Flask API with JSON responses
- β‘ Fast & efficient - Optimized JSON parsing from embedded data
Beautiful gradient UI with input field and real-time results display
- High-quality images
- Formatted pricing and location
- Full description with preserved formatting
- Seller information
βββββββββββββββββββ HTTP βββββββββββββββββββ
β β βββββββββββββββββββΊ β β
β React Frontend β (REST API) β Flask Backend β
β (Port 5173) β βββββββββββββββββββ β (Port 5000) β
β β JSON data β β
βββββββββββββββββββ βββββββββββββββββββ
β
β imports
βΌ
βββββββββββββββββββ
β scraper.py β
β (Core Logic) β
βββββββββββββββββββ
- Python 3.7 or higher
- Node.js 16 or higher
- npm or yarn
- Clone the repository
git clone https://github.com/yourusername/offerup-scraper.git
cd offerup-scraper- Set up the backend
cd backend
# Create virtual environment (optional but recommended)
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt- Set up the frontend
cd ../frontend
# Install dependencies
npm installYou'll need two terminal windows:
Terminal 1 - Start the Flask backend:
cd backend
source venv/bin/activate # If using virtual environment
python api.pyBackend will run on http://127.0.0.1:5000
Terminal 2 - Start the React frontend:
cd frontend
npm run devFrontend will run on http://localhost:5173
Open your browser to http://localhost:5173 and start scraping!!!
- Open
http://localhost:5173in your browser - Paste an OfferUp listing URL (e.g.,
https://offerup.com/item/detail/...) - Click "Scrape"
- View the extracted data including images, description, and pricing
The Flask backend provides these REST API endpoints:
Health Check
GET http://127.0.0.1:5000/api/healthTest Scrape (uses sample listing)
GET http://127.0.0.1:5000/api/testScrape Listing
POST http://127.0.0.1:5000/api/scrape
Content-Type: application/json
{
"url": "https://offerup.com/item/detail/YOUR-LISTING-ID",
"download_image": false
}Example with curl:
curl -X POST http://127.0.0.1:5000/api/scrape \
-H "Content-Type: application/json" \
-d '{"url":"https://offerup.com/item/detail/4bc65998-e110-3dc8-b0d9-89bbbafd8994"}' \
| python3 -m json.toolYou can also use the scraper from the command line:
cd backend
# Basic usage (JSON output)
python scraper.py "https://offerup.com/item/detail/YOUR-LISTING-ID"
# Human-readable text output
python scraper.py "https://offerup.com/item/detail/YOUR-LISTING-ID" -o text
# Download image
python scraper.py "https://offerup.com/item/detail/YOUR-LISTING-ID" -d
# CSV format
python scraper.py "https://offerup.com/item/detail/YOUR-LISTING-ID" -o csv
# Verbose mode (show scraping progress)
python scraper.py "https://offerup.com/item/detail/YOUR-LISTING-ID" -v
# Save to file
python scraper.py "https://offeup.com/item/detail/YOUR-LISTING-ID" > output.jsonAll CLI options:
python scraper.py --help- Python 3.7+ - Core language
- Flask - Web framework
- BeautifulSoup4 - HTML parsing
- Requests - HTTP client
- Flask-CORS - Cross-origin resource sharing
- React 18 - UI library
- Vite - Build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- JavaScript ES6+ - Modern JavaScript
offerup-scraper/
βββ backend/
β βββ api.py # Flask REST API
β βββ scraper.py # Core scraping logic + CLI
β βββ config.py # Configuration settings
β βββ utils.py # Helper functions
β βββ requirements.txt # Python dependencies
β
βββ frontend/
β βββ src/
β β βββ App.jsx # Main React component
β β βββ main.jsx # React entry point
β β βββ index.css # Tailwind CSS imports
β βββ public/ # Static assets
β βββ index.html # HTML template
β βββ package.json # Node dependencies
β βββ vite.config.js # Vite configuration
β βββ tailwind.config.js # Tailwind configuration
β
βββ .gitignore # Git ignore rules
βββ README.md # This file
- β
This scraper only accesses individual item pages allowed per OfferUp's
robots.txt - β Implements rate limiting to avoid server overload
- β Respects OfferUp's Terms of Service
Contributions are welcome! Please feel free to submit a Pull Request.
- Built as an educational project to learn full-stack development
- Thanks to the React, Flask, and Tailwind CSS communities