Zagame Automotive Inventory Scraper avatar
Zagame Automotive Inventory Scraper

Pricing

Pay per event

Go to Store
Zagame Automotive Inventory Scraper

Zagame Automotive Inventory Scraper

Developed by

Rithvik Chand

Rithvik Chand

Maintained by Community

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

  1. Create a new Airtable base or use an existing one
  2. Create a table called "Vehicles" with the following fields:
Field NameField TypeDescription
Unique IDSingle line textPrimary key for vehicles
TitleSingle line textFull vehicle title
YearNumberVehicle year
MakeSingle line textVehicle manufacturer
ModelSingle line textVehicle model
VariantSingle line textSpecific variant/trim
PriceNumberNumerical price value
Price TextSingle line textOriginal price text
KilometersNumberOdometer reading
Kilometers TextSingle line textOriginal km text
ConditionSingle selectNew, Used, Demo
Fuel TypeSingle line textPetrol, Electric, etc.
Body TypeSingle line textSedan, Hatch, SUV, etc.
DealerSingle line textSelling dealer
Vehicle URLURLLink to vehicle page
ImagesLong textComma-separated image URLs
Scraped AtDateWhen first scraped
Last SeenDateLast seen timestamp
Is ActiveCheckboxCurrently available
Raw TextLong textRaw extracted text
  1. Optional: Create a "Vehicles_History" table for historical tracking with similar fields plus "Snapshot Date"

  2. Get your Airtable API key from https://airtable.com/create/tokens

  3. Get your Base ID from the Airtable API documentation page

2. Apify Deployment

  1. Fork or clone this repository
  2. Push to your GitHub repository
  3. 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

  1. Zip the entire project
  2. Upload to Apify Console
  3. 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 repository
git clone <your-repo-url>
cd zag-scraper
# Install dependencies
npm install
# Set environment variables (optional for local testing)
export AIRTABLE_API_KEY=your_api_key
export AIRTABLE_BASE_ID=your_base_id

Running Locally

# Run the scraper
npm start
# Run with development settings
npm run dev

Testing

# Run tests
npm 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

  1. No vehicles found: Website structure may have changed
  2. Airtable connection fails: Check API key and base ID
  3. Rate limit exceeded: Increase delays between requests
  4. Memory issues: Reduce batch sizes or page limits

Debug Mode

Enable detailed logging by setting the log level:

log.setLevel('DEBUG');

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support

For issues and questions:

  1. Check the troubleshooting section
  2. Review Apify logs for error details
  3. Verify Airtable configuration
  4. Test with smaller page limits first

Changelog

v1.0.0

  • Initial release
  • Full vehicle data extraction
  • Airtable integration
  • Historical tracking
  • Apify deployment ready