QPAScrape
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
index.ts
https://wolf--471c270a761211f0bbfb0224a6c84d84.web.val.run
A simple, focused JSON API that scrapes every item from every auction across all pages on quarterpriceauction.com.
├── backend/
│ ├── index.ts # Main HTTP endpoint
│ └── scrapers/
│ ├── mainScraper.ts # Main orchestration logic
│ ├── auctionDiscovery.ts # Finds all auction URLs
│ ├── auctionScraper.ts # Scrapes individual auctions
│ ├── paginationDetector.ts # Detects page count per auction
│ └── itemExtractor.ts # Extracts item data from HTML/REDUX
├── shared/
│ └── types.ts # TypeScript interfaces
└── index.ts # Entry point
GET /
- Returns ALL items from ALL auctions (JSON format)
GET /csv
- Returns ALL items from ALL auctions (CSV format with download)GET /health
- Health check endpointGET /info
- API information and available endpointsGET /fresh
- Force fresh scrape (no cache)GET /metadata
- Get metadata and sample items only
Returns all items from all auctions:
{ "timestamp": "2025-08-16T18:25:00.000Z", "totalItems": 450, "totalAuctions": 6, "items": [ { "title": "Google Pixel 9a with Gemini - Unlocked Android Smartphone...", "auctionTitle": "August 22 Auction - Quarter Price", "auctionUrl": "https://www.quarterpriceauction.com/auctions/30135-august-22-auction", "itemUrl": "https://www.quarterpriceauction.com/auctions/30135/lot/291744-google-pixel...", "imageUrl": "https://d3j17a2r8lnfte.cloudfront.net/qrt/2025/8/medium/DG6mWsSZbO4GZPZh7Trv5Fza.jpeg", "lotNumber": "291744", "currentBid": "$45.00", "startingBid": "$1.00", "bidCount": 12, "timeLeft": "2d 4h 15m", "category": "Electronics" } ], "metadata": { "reduxDataFound": true, "auctionUrlsFound": 6, "scrapedAuctions": 6, "totalPagesScraped": 45, "processingTimeMs": 180000 } }
Returns the same data as a downloadable CSV file with headers:
Title,Auction,Lot Number,Current Bid,Starting Bid,Bid Count,Time Left,Category,Auction URL,Item URL,Image URL,Description "Google Pixel 9a with Gemini - Unlocked Android Smartphone...","August 22 Auction - Quarter Price","291744","$45.00","$1.00","12","2d 4h 15m","Electronics","https://www.quarterpriceauction.com/auctions/30135-august-22-auction","https://www.quarterpriceauction.com/auctions/30135/lot/291744-google-pixel...","https://d3j17a2r8lnfte.cloudfront.net/qrt/2025/8/medium/DG6mWsSZbO4GZPZh7Trv5Fza.jpeg",""
- Content-Type:
text/csv
- Filename:
quarter-price-auction-items-YYYY-MM-DD.csv
- Download: Automatically triggers download in browsers
- 🔍 Comprehensive Scraping: Extracts every item from every auction
- 📄 Multi-Page Support: Automatically detects and handles pagination
- 🎯 Detailed Item Data: Titles, lot numbers, prices, images, categories
- 🧠 Intelligent Parsing: Uses Apollo state + REDUX data extraction + HTML fallbacks
- ⚡ Performance Optimized: High-performance concurrent processing, no artificial delays
- 🛡️ Error Resilient: Graceful error handling with detailed metadata
- 📊 Rich Metadata: Processing statistics and data source information
- 📁 Multiple Formats: JSON and CSV output formats
- Auction Discovery: Finds all auction URLs from main page
- Pagination Detection: Uses binary search to find max pages per auction
- Enhanced Item Extraction:
- Apollo State (preferred): Extracts from
window.__APOLLO_STATE__
for most detailed data - REDUX Data (fallback): Uses
window.REDUX_DATA
extraction - HTML Parsing (final fallback): Traditional HTML parsing
- Apollo State (preferred): Extracts from
- Data Enhancement: Calculates time remaining, formats prices, extracts lot numbers
- Rate Limiting: 300-500ms delays between requests
- Caching: 10-minute cache for comprehensive scraping
- Binary Search: Efficient pagination detection
- Memory Management: Processes auctions sequentially
title
- Full item name/descriptionauctionTitle
- Which auction the item belongs toauctionUrl
- Link to the auction pageitemUrl
- Direct link to the individual item/lotimageUrl
- Product image from CDNlotNumber
- Auction lot numbercurrentBid
- Current highest bid amountstartingBid
- Starting bid amountbidCount
- Number of bids placedtimeLeft
- Time remaining in auctioncategory
- Item category
- High-Performance Concurrent Processing: ~2 minutes 15 seconds for 2,956+ items
- Concurrent auction processing: All auctions scraped simultaneously
- Concurrent page processing: All pages within auctions scraped in parallel
- Smart pagination detection: Uses concurrent requests and binary search
- No artificial delays: Optimized for high-performance servers
- Throughput: ~22 items per second, ~0.44 pages per second
- Results are cached to improve subsequent request performance
Goal: Simple JSON list of every item across all auctions with metadata.
Status: ✅ Accomplished - Clean, organized, focused implementation.