
Zagame Automotive Inventory Scraper
Pricing
Pay per event

Zagame Automotive Inventory Scraper
Scrape a live list of zagame automotive inventory
0.0 (0)
Pricing
Pay per event
0
Total users
1
Monthly users
1
Last modified
2 days ago
Zagame Automotive Scraper
A comprehensive web scraper for Zagame Automotive that tracks vehicle inventory and maintains historical data in Airtable. Built for deployment on Apify.
Features
- π Complete Vehicle Data Extraction: Scrapes all vehicle listings including make, model, year, price, kilometers, condition, and more
- π Airtable Integration: Automatically updates Airtable database with current inventory
- π Historical Tracking: Maintains historical data for price and availability changes
- π Smart Updates: Only updates records when significant changes are detected
- π€ Apify Ready: Fully configured for deployment on Apify platform
- π Robust Scraping: Handles pagination, retries, and various website layouts
- π Detailed Logging: Comprehensive logging for monitoring and debugging
Vehicle Data Captured
Each vehicle record includes:
- Basic Info: Title, Make, Model, Year, Variant
- Pricing: Price (numerical), Price Text (original format)
- Details: Kilometers, Condition (New/Used/Demo), Fuel Type, Body Type
- Location: Dealer/Branch information
- Links: Direct vehicle URL, Image URLs
- Tracking: Unique ID, Last Seen timestamp, Active status
- History: Scraped timestamp, historical changes
Setup Instructions
1. Airtable Setup
- Create a new Airtable base or use an existing one
- Create a table called "Vehicles" with the following fields:
Field Name | Field Type | Description |
---|---|---|
Unique ID | Single line text | Primary key for vehicles |
Title | Single line text | Full vehicle title |
Year | Number | Vehicle year |
Make | Single line text | Vehicle manufacturer |
Model | Single line text | Vehicle model |
Variant | Single line text | Specific variant/trim |
Price | Number | Numerical price value |
Price Text | Single line text | Original price text |
Kilometers | Number | Odometer reading |
Kilometers Text | Single line text | Original km text |
Condition | Single select | New, Used, Demo |
Fuel Type | Single line text | Petrol, Electric, etc. |
Body Type | Single line text | Sedan, Hatch, SUV, etc. |
Dealer | Single line text | Selling dealer |
Vehicle URL | URL | Link to vehicle page |
Images | Long text | Comma-separated image URLs |
Scraped At | Date | When first scraped |
Last Seen | Date | Last seen timestamp |
Is Active | Checkbox | Currently available |
Raw Text | Long text | Raw extracted text |
-
Optional: Create a "Vehicles_History" table for historical tracking with similar fields plus "Snapshot Date"
-
Get your Airtable API key from https://airtable.com/create/tokens
-
Get your Base ID from the Airtable API documentation page
2. Apify Deployment
Option A: Deploy via GitHub (Recommended)
- Fork or clone this repository
- Push to your GitHub repository
- In Apify Console:
- Create new Actor
- Connect to your GitHub repository
- Set build settings to use this repository
- Configure input schema (automatically detected)
Option B: Manual Upload
- Zip the entire project
- Upload to Apify Console
- Configure as Node.js + Playwright actor
3. Configuration
When running the actor, provide the following input:
{"airtableApiKey": "your_airtable_api_key","airtableBaseId": "your_base_id","airtableTableName": "Vehicles","maxPages": 0,"trackHistory": true,"runInterval": 24}
Input Parameters
- airtableApiKey (required): Your Airtable API key
- airtableBaseId (required): Your Airtable base ID
- airtableTableName (optional): Table name (default: "Vehicles")
- maxPages (optional): Maximum pages to scrape (0 = all pages)
- trackHistory (optional): Enable historical tracking (default: true)
- runInterval (optional): How often to run in hours (default: 24)
Local Development
Prerequisites
- Node.js 18+
- npm or yarn
Installation
# Clone the repositorygit clone <your-repo-url>cd zag-scraper# Install dependenciesnpm install# Set environment variables (optional for local testing)export AIRTABLE_API_KEY=your_api_keyexport AIRTABLE_BASE_ID=your_base_id
Running Locally
# Run the scrapernpm start# Run with development settingsnpm run dev
Testing
# Run testsnpm test
Architecture
src/βββ main.js # Entry point and orchestrationβββ scrapers/β βββ vehicleScraper.js # Main scraping logicβββ services/β βββ airtableManager.js # Airtable operationsβββ utils/βββ logger.js # Logging utilitiesβββ helpers.js # Data processing helpers
Key Components
VehicleScraper
- Handles navigation and pagination
- Extracts vehicle data from listings
- Processes and cleans scraped data
- Generates unique identifiers
AirtableManager
- Manages Airtable connections
- Handles batch operations (create/update)
- Tracks historical changes
- Calculates inventory statistics
Data Processing
- Price extraction and normalization
- Kilometer parsing
- Make/model recognition
- Text sanitization
Monitoring & Logging
The scraper provides detailed logging for:
- Scraping progress (pages, vehicles found)
- Airtable operations (creates, updates)
- Error handling and retries
- Performance metrics
Error Handling
- Network Issues: Automatic retries with exponential backoff
- Rate Limits: Built-in delays between requests
- Data Validation: Handles missing or malformed data gracefully
- Airtable Limits: Batch operations with size limits
Scheduling
Apify Scheduler
Set up recurring runs in Apify Console:
- Recommended: Every 6-12 hours for active inventory tracking
- Minimum: Daily for basic inventory updates
- High Frequency: Every 2-4 hours for time-sensitive tracking
Custom Scheduling
The scraper can be configured with different intervals based on your needs:
- Real Estate Mode: Every 4-6 hours
- Standard Mode: Every 12-24 hours
- Archive Mode: Weekly for historical data
Data Analysis
The Airtable database enables powerful analysis:
- Price trend tracking
- Inventory turnover rates
- Popular models and makes
- Dealer performance
- Market insights
Troubleshooting
Common Issues
- No vehicles found: Website structure may have changed
- Airtable connection fails: Check API key and base ID
- Rate limit exceeded: Increase delays between requests
- Memory issues: Reduce batch sizes or page limits
Debug Mode
Enable detailed logging by setting the log level:
log.setLevel('DEBUG');
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues and questions:
- Check the troubleshooting section
- Review Apify logs for error details
- Verify Airtable configuration
- Test with smaller page limits first
Changelog
v1.0.0
- Initial release
- Full vehicle data extraction
- Airtable integration
- Historical tracking
- Apify deployment ready