# AirAsia Scraper (`mscraper/airasia-scraper`) Actor

Under maintenance. Use the new AirAsia Flights Scraper for managed one-way flight searches: https://apify.com/mscraper/airasia-flights-scraper. Includes prices, schedules and connecting itineraries, up to 30 initial offers per search.

- **URL**: https://apify.com/mscraper/airasia-scraper.md
- **Developed by:** [mscraper](https://apify.com/mscraper) (community)
- **Categories:** Travel
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AirAsia Scraper

> **This Actor is under maintenance.** Use the new [AirAsia Flights Scraper](https://apify.com/mscraper/airasia-flights-scraper) for one-way flight searches with managed browser access, prices, schedules and connecting itineraries. The replacement returns up to 30 initial offers per search and has its own pay-per-result pricing. See its documentation for API migration details.

Scrape flights from [AirAsia](http://airasia.com). Crawl and extract flights, prices, availability, and more. Creates a AirAsia API to let you scrape based on one way trip, and passenger management (adults, children, infants) options.

### What does AirAsia Scraper do?

AirAsia Scraper is an Apify actor that allows you to scrape flights from AirAsia.

### Why scrape AirAsia?

AirAsia has a large number of users and is a great source of data for the travel industry. Here are just some of the ways you could use that data:

- Analyze pricing trends
- Monitor flight availability
- Track popular routes
- Conduct market research

If you would like more inspiration on how scraping AirAsia could help your business or organization, check out our [Travel & Logistics industry page](https://apify.com/industries/travel-and-logistics).

### How to scrape AirAsia

It's easy to scrape AirAsia with AirAsia Scraper. Just follow these few steps and you'll get your data in a few minutes.

1. Click on Try for free.
2. Enter details you want to scrape.
3. Click on Run.
4. When AirAsia Scraper has finished, preview or download your data from the Dataset tab.

### How much will it cost to scrape AirAsia?

Apify gives you $5 free usage credits every month on the [Apify Free plan](https://apify.com/pricing). You can get up to 10,000 results per month from AirAsia Scraper for that, so those 10,000 results will be completely free!

But if you need to get more data regularly from AirAsia, you should consider an Apify subscription. We recommend our [$49/month Starter plan](https://apify.com/pricing) - you can get up to 100,000 every month with the $49 monthly plan!

Or get 1,000,000 results for $499 with the [Scale plan](https://apify.com/pricing) - wow!

### Results

AirAsia Scraper produces JSON results that include details such as trip ID, seat availability, price breakdown, fare, currency code, flight details, and more. Here is a sample of the data that the actor produces:

```json
{
 "tripId": "pcfcQ8Kiq9IEVT57aNT9i3i7L011_",
 "seatAvailability": {
  "seats": 9
 },
 "priceBreakdown": null,
 "virtualInterlining": null,
 "fare": {
  "adults": 159,
  "children": 0,
  "infants": 0
 },
 "convertedFare": {
  "adults": 2012.9082,
  "children": 0,
  "infants": 0
 },
 "discount": {
  "adults": 0,
  "children": 0,
  "infants": 0
 },
 "convertedDiscount": null,
 "fareTypeCategory": null,
 "price": 159,
 "convertedPrice": 2012.9082,
 "strikeThroughPrice": 159,
 "baseFare": {
  "adults": 99,
  "children": 0,
  "infants": 0
 },
 "convertedBaseFare": {
  "adults": 1253.3202,
  "children": 0,
  "infants": 0
 },
 "convertedStrikeThroughPrice": 2012.9082,
 "currencyCode": "MYR",
 "userCurrencyCode": "PHP",
 "airlineProfile": "dotrez",
 "provider": null,
 "providerCode": null,
 "sId": null,
 "percentageDiscount": 0,
 "keywords": [],
 "flightDetails": {
  "designator": {
   "departureStation": "KUL",
   "arrivalStation": "SIN",
   "departureTime": "2023-06-22T06:05:00.000Z",
   "arrivalTime": "2023-06-22T07:15:00.000Z",
   "departureTimeUtc": "2023-06-21T22:05:00Z",
   "arrivalTimeUtc": "2023-06-21T23:15:00Z",
   "arrivalTerminal": null,
   "departureTerminal": null
  },
  "segments": [
   {
    "designator": {
     "departureStation": "KUL",
     "arrivalStation": "SIN",
     "departureTime": "2023-06-22T06:05:00.000Z",
     "arrivalTime": "2023-06-22T07:15:00.000Z",
     "departureTimeUtc": "2023-06-21T22:05:00Z",
     "arrivalTimeUtc": "2023-06-21T23:15:00Z",
     "arrivalTerminal": null,
     "departureTerminal": null
    },
    "carrierCode": "AK",
    "airline": "AK",
    "flightNumber": 701,
    "operatingCarrierCode": null,
    "operatingFlightNumber": null,
    "marketingCarrierCode": "AK",
    "marketingFlightNumber": 701,
    "vehicleType": null,
    "fareClass": "EP",
    "fareClassCategory": "M",
    "cabinClass": null,
    "fareBasis": "O02H01",
    "fareType": "O",
    "equipmentType": "320A",
    "marketingCode": "320FIX",
    "legs": [
     {
      "designator": {
       "departureStation": "KUL",
       "arrivalStation": "SIN",
       "departureTime": "2023-06-22T06:05:00.000Z",
       "arrivalTime": "2023-06-22T07:15:00.000Z",
       "departureTimeUtc": "2023-06-21T22:05:00Z",
       "arrivalTimeUtc": "2023-06-21T23:15:00Z",
       "arrivalTerminal": null,
       "departureTerminal": null
      },
      "duration": 4200,
      "layoverTime": null,
      "technicalLayover": null
     }
    ],
    "layoverTime": null,
    "duration": 4200,
    "bagsRecheckRequired": false,
    "viConnection": null,
    "connectionProtectedByAirline": true,
    "baggageTransferOption": "AIRLINE_TRANSFER",
    "connectionGuarantee": false,
    "guarantee": null,
    "isSelfTransfer": null,
    "marketingAirlineName": null,
    "operatingAirlineName": null,
    "subjectToGovtApproval": false
   }
  ],
  "totalDaysCount": 0,
  "duration": 4200,
  "layoverTime": 0,
  "numberOfStops": 0,
  "baggage": {
   "complimentaryBaggage": [
    {
     "type": "cabin_bag",
     "height": null,
     "width": null,
     "length": null,
     "weight": 7,
     "count": 1,
     "passengerGroups": null
    }
   ],
   "checkedBaggageAllowed": true
  }
 },
 "sharedFlight": "KUL-SIN-AK-701"
}
```

### Is it legal to scrape AirAsia?

Note that personal data is protected by GDPR in the European Union and by other regulations around the world.
You should not scrape personal data unless you have a legitimate reason to do so.
If you're unsure whether your reason is legitimate, consult your lawyers.
We also recommend that you read our blog post: [is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

### Contact

Please feel free to browse through the diverse array of web scrapers available on [my Apify profile](https://apify.com/mscraper). If a custom solution or extra options are what you're seeking, don't hesitate to get in touch with me directly at <contact@mscraper.com>.

# Actor input Schema

## `mode` (type: `string`):

Mode for the actor. It can be either ROUND for Round trip or ONEWAY for One way trips

## `origin` (type: `string`):

3 letter airport code for origin. You can check the codes from here: https://www.nationsonline.org/oneworld/IATA\_Codes/airport\_code\_list.htm

## `departureDate` (type: `string`):

Date for departure. Should be in the format of DD/MM/YYYY. Ex: 24/12/2023

## `returnDate` (type: `string`):

Date for return. It is required for Round trips. Should be in the format of DD/MM/YYYY. Ex: 24/12/2023

## `destination` (type: `string`):

3 letter airport code for destination. You can check the codes from here: https://www.nationsonline.org/oneworld/IATA\_Codes/airport\_code\_list.htm

## `adults` (type: `integer`):

Number of adults that will be included on the flight

## `children` (type: `integer`):

Number of children (2-11 years old) that will be included on the fligh

## `infants` (type: `integer`):

Number of infants (Under 2 years old) that will be included on the flight

## `currency` (type: `string`):

No description

## `countryCode` (type: `string`):

ALPHA-2 country code https://www.iban.com/country-codes

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "mode": "ONEWAY",
  "origin": "WAW",
  "departureDate": "24/12/2023",
  "destination": "AUH",
  "adults": 1,
  "children": 0,
  "infants": 0,
  "currency": "EUR",
  "countryCode": "PL",
  "proxy": {
    "useApifyProxy": true,
    "groups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "PL"
  }
}
```

# Actor output Schema

## `flights` (type: `string`):

Records saved to the default dataset by this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "origin": "WAW",
    "departureDate": "24/12/2023",
    "returnDate": "",
    "destination": "AUH",
    "countryCode": "PL",
    "proxy": {
        "useApifyProxy": true,
        "groups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "PL"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mscraper/airasia-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "origin": "WAW",
    "departureDate": "24/12/2023",
    "returnDate": "",
    "destination": "AUH",
    "countryCode": "PL",
    "proxy": {
        "useApifyProxy": True,
        "groups": ["RESIDENTIAL"],
        "apifyProxyCountry": "PL",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("mscraper/airasia-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "origin": "WAW",
  "departureDate": "24/12/2023",
  "returnDate": "",
  "destination": "AUH",
  "countryCode": "PL",
  "proxy": {
    "useApifyProxy": true,
    "groups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "PL"
  }
}' |
apify call mscraper/airasia-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mscraper/airasia-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/oXkCGdP2VkIKPTNgV/builds/ArV42hZRYV0DTjeWS/openapi.json
