• Townie
    AI
  • Blog
  • Docs
  • Pricing
Log inSign up
wolf

wolf

QPAScrape

Public
Like
QPAScrape
Home
Code
4
backend
2
shared
1
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
Code
/
Search
index.ts
https://wolf--471c270a761211f0bbfb0224a6c84d84.web.val.run
README.md

Quarter Price Auction Scraper API

A simple, focused JSON API that scrapes every item from every auction across all pages on quarterpriceauction.com.

Structure

├── 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

Usage

Main Endpoint

  • GET / - Returns ALL items from ALL auctions (JSON format)

Other Endpoints

  • GET /csv - Returns ALL items from ALL auctions (CSV format with download)
  • GET /health - Health check endpoint
  • GET /info - API information and available endpoints
  • GET /fresh - Force fresh scrape (no cache)
  • GET /metadata - Get metadata and sample items only

Response Format

JSON Format (GET /)

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 } }

CSV Format (GET /csv)

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

Features

  • 🔍 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

Technical Implementation

Multi-Level Scraping Strategy

  1. Auction Discovery: Finds all auction URLs from main page
  2. Pagination Detection: Uses binary search to find max pages per auction
  3. 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
  4. Data Enhancement: Calculates time remaining, formats prices, extracts lot numbers

Performance Features

  • Rate Limiting: 300-500ms delays between requests
  • Caching: 10-minute cache for comprehensive scraping
  • Binary Search: Efficient pagination detection
  • Memory Management: Processes auctions sequentially

Item Data Fields

  • title - Full item name/description
  • auctionTitle - Which auction the item belongs to
  • auctionUrl - Link to the auction page
  • itemUrl - Direct link to the individual item/lot
  • imageUrl - Product image from CDN
  • lotNumber - Auction lot number
  • currentBid - Current highest bid amount
  • startingBid - Starting bid amount
  • bidCount - Number of bids placed
  • timeLeft - Time remaining in auction
  • category - Item category

Performance Notes

  • 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

✅ MISSION

Goal: Simple JSON list of every item across all auctions with metadata.

Status: ✅ Accomplished - Clean, organized, focused implementation.

HTTP
  • index.ts
    wolf--47…84.web.val.run
Code
backendsharedREADME.md
H
index.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.