Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ListaYours

Python FastAPI Next.js TypeScript

E-commerce product scraper that extracts structured data (price, images, specs, etc.) from product pages. Uses multiple parsing strategies with automatic fallback.

Quick Start

Docker (easiest)

git clone https://github.com/yourusername/ListaYours.git
cd ListaYours
docker compose up --build

Open http://localhost:3000 (frontend) and http://localhost:8000 (API)

Local

Backend:

cd api
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
playwright install chromium
uvicorn app.main:app --reload

Frontend:

cd frontend
npm install
npm run dev

Structure

api/                    # FastAPI backend
├── app/main.py         # Entry point
├── models.py           # Pydantic schemas
└── scraper/
    ├── engine.py       # Orchestration
    ├── parser.py       # Data extraction
    └── parsers/
        ├── amazon.py   # Amazon-specific
        └── default.py  # Generic parsing

frontend/               # Next.js frontend
├── src/app/
│   ├── layout.tsx
│   └── page.tsx
└── package.json

How it Works

  1. Frontend sends URL + strategy (HTTPX or Playwright)
  2. Backend tries HTTPX first (fast), falls back to Playwright if needed
  3. Extraction pipeline runs: JSON-LD → microdata → OpenGraph → heuristics
  4. Returns structured JSON with product data

API

POST /api/scrape

{
  "url": "https://example.com/product",
  "strategy": "HTTPX" // or "PLAYWRIGHT"
  "debug": false
}

Returns:

{
  "success": true,
  "strategy_used": "HTTPX",
  "data": {
    "title": "...",
    "price": 29.99,
    "currency": "USD",
    "images": ["..."],
    "description": "...",
    // ... more fields
  }
}

Docs at /docs and /redoc

Config

Frontend needs NEXT_PUBLIC_API_URL (default: http://localhost:8000)

cp .env.example .env

Troubleshooting

  • Playwright missing: playwright install chromium
  • venv issues: source .venv/bin/activate (Linux/Mac) or .venv\Scripts\activate (Windows)
  • API 404: Make sure backend running on 8000
  • Docker issues: docker compose down -v && docker compose up --build

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages