Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AirAsia Flight Price Scraper Chrome Extension

A Chrome extension that automatically extracts AirAsia API tokens and scrapes flight prices for analysis and comparison.

Features

πŸ”‘ Automatic Token Extraction

  • Automatically captures AirAsia API tokens from web requests
  • Displays token details including expiration time
  • JWT token decoding and validation
  • Copy tokens to clipboard with one click

✈️ Flight Price Scraping

  • Scrape flight prices for multiple destinations
  • Support for both one-way and round-trip flights
  • Configurable date ranges and request delays
  • Real-time progress tracking with detailed logs

πŸ“Š Advanced Analysis

  • Round-trip price analysis with trip duration optimization
  • Multiple sorting options (price, trip days, destination)
  • Weekend flight detection
  • CSV export functionality

βš™οΈ Customizable Settings

  • Configurable request delays to avoid rate limiting
  • Default airport and date preferences
  • Token history management
  • Settings import/export functionality

Installation

Method 1: Load Unpacked Extension (Development)

  1. Download or clone this repository
  2. Open Chrome and navigate to chrome://extensions/
  3. Enable "Developer mode" in the top right corner
  4. Click "Load unpacked" and select the airasia-extension folder
  5. The extension should now appear in your extensions list

Method 2: Install from Chrome Web Store (Coming Soon)

Note: This extension is not yet available on the Chrome Web Store

Usage

Step 1: Capture AirAsia Tokens

  1. Install the extension
  2. Visit airasia.com
  3. Search for flights (this will generate API requests with tokens)
  4. Click the extension icon to view captured tokens
  5. The extension badge will show the number of captured tokens

Step 2: Configure Scraping Parameters

  1. Open the extension popup
  2. Select a captured token or enter one manually
  3. Configure your scraping parameters:
    • Departure Airport: Select your departure airport
    • Destination Airports: Choose one or more destinations
    • Date Range: Set your travel period
    • Flight Type: Choose one-way or round-trip
    • Request Delay: Set delay between API requests (default: 2.5s)

Step 3: Start Scraping

  1. Click "Start Scraping" to begin the process
  2. Monitor progress in the real-time log
  3. The extension will automatically export results as CSV
  4. For round-trip flights, analysis will be performed automatically

Configuration

Extension Settings

Access settings by clicking the gear icon in the popup or visiting the options page:

  • Maximum Token History: Number of captured tokens to keep (5-50)
  • Default Request Delay: Default delay between API requests
  • Default Dates: Default from/to dates for searches
  • Default Departure: Default departure airport

Data Management

  • Clear Storage: Remove all captured tokens and data
  • Export Settings: Backup your configuration
  • Import Settings: Restore from backup

API Endpoints

The extension uses the following AirAsia API endpoints:

  • Base URL: https://flights.airasia.com/fp/lfc/v1/lowfare
  • Method: GET
  • Headers: Includes authorization token and required headers
  • Parameters: Airport codes, dates, currency, etc.

Output Format

One-Way Flights

CSV with columns:

  • departure_station
  • arrival_station
  • departure_date
  • price
  • formatted_price
  • short_price
  • airline_profile
  • aa_flight
  • direction
  • fetch_date

Round-Trip Analysis

CSV with columns:

  • Destination
  • Outbound Date
  • Outbound Price
  • Inbound Date
  • Inbound Price
  • Total Price
  • Trip Days

Security & Privacy

  • Local Storage: All data is stored locally in your browser
  • No External Servers: The extension doesn't send data to external servers
  • Token Security: Tokens are only used for API requests to AirAsia
  • Data Export: You control when and what data is exported

Troubleshooting

No Tokens Captured

  • Ensure you're on airasia.com or flights.airasia.com
  • Try searching for flights to generate API requests
  • Check that the extension has the necessary permissions

Scraping Errors

  • Verify your access token is valid and not expired
  • Increase the request delay to avoid rate limiting
  • Check the log for specific error messages

Permission Issues

  • Ensure the extension has access to the required websites
  • Check Chrome's extension permissions settings

Development

Project Structure

airasia-extension/
β”œβ”€β”€ manifest.json          # Extension manifest
β”œβ”€β”€ service-worker.js      # Background service worker
β”œβ”€β”€ popup/
β”‚   β”œβ”€β”€ popup.html        # Popup interface
β”‚   β”œβ”€β”€ popup.css         # Popup styles
β”‚   β”œβ”€β”€ popup.js          # Popup functionality
β”‚   └── json-viewer.bundle.js  # JSON viewer library
β”œβ”€β”€ options/
β”‚   β”œβ”€β”€ options.html      # Options page
β”‚   β”œβ”€β”€ options.css       # Options styles
β”‚   └── options.js        # Options functionality
β”œβ”€β”€ icons/                # Extension icons
└── README.md            # This file

Building

This extension is ready to use as-is. No build process required.

Testing

  1. Load the extension in Chrome
  2. Visit airasia.com and search for flights
  3. Test token capture functionality
  4. Test flight scraping with various parameters

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This extension is for educational and personal use only. Please respect AirAsia's terms of service and rate limits. The developers are not responsible for any misuse of this tool.

Support

For issues and questions:

  • Check the troubleshooting section above
  • Review the Chrome DevTools console for error messages
  • Ensure you have the latest version of Chrome

Changelog

Version 1.0

  • Initial release
  • Automatic token extraction
  • Flight price scraping
  • Round-trip analysis
  • CSV export functionality
  • Configurable settings

About

A Chrome extension that automatically extracts AirAsia API tokens and scrapes flight prices for analysis and comparison.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages