# Almosafer Flights Scraper – Saudi Arabia Fares (`boring_internet_explorer/almosafer-flights-scraper`) Actor

Scrape Almosafer (المسافر) flight fares for Saudi Arabia in SAR: one-way and round-trip prices across multiple routes with airlines, flight numbers, stops, layovers, baggage, refundability and seats left. Search routes from Jeddah, Riyadh, Dammam and more.

- **URL**: https://apify.com/boring_internet_explorer/almosafer-flights-scraper.md
- **Developed by:** [Boring Internet Explorer](https://apify.com/boring_internet_explorer) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## ✈️ Almosafer المسافر Flights Scraper — Saudi Arabia (SAR)

[Almosafer](https://www.almosafer.com/en) (المسافر) is Saudi Arabia's leading online travel agency, selling flights from 450+ airlines in Saudi riyals (SAR). This scraper runs a flight search for any route, date, cabin and passenger mix and returns every fare option as structured data — prices, airlines, flight numbers, stops, layovers, baggage, refundability and seats left — ready for price tracking, comparison and analysis.

### Why use this scraper?

- 💰 **Fare monitoring** — track SAR prices on any route day by day
- 📊 **Route benchmarking** — compare airlines, direct vs connecting itineraries and cabins
- 🧳 **Baggage and refund insights** — see which fares include checked bags or are refundable
- 🏢 **Travel agencies and OTAs** — feed competitor price comparisons and dynamic pricing
- 📈 **Market research** — measure capacity, seat availability and low-cost carrier pricing in Saudi Arabia
- 🔔 **Deal alerts** — schedule runs and notify on price drops
- 🤖 **AI and analytics pipelines** — clean, flat JSON with full leg and segment detail

### Search inputs

This is a flight actor, so the input is a set of dedicated search fields rather than URLs.

| Field                | Type    | Default   | Description                                                                                                       |
| -------------------- | ------- | --------- | ----------------------------------------------------------------------------------------------------------------- |
| `tripType`           | string  | `oneWay`  | `oneWay` or `roundTrip`. Round-trip results list outbound flights priced with the cheapest total round-trip fare. |
| `origin`             | string  | —         | 3-letter IATA code of the departure airport or city (e.g. `JED`, `RUH`, `DMM`).                                   |
| `destination`        | string  | —         | 3-letter IATA code of the arrival airport or city (e.g. `DXB`, `CAI`, `LON`).                                     |
| `departureDate`      | string  | —         | `YYYY-MM-DD` or relative to today (e.g. `14 days`).                                                               |
| `returnDate`         | string  | —         | Required for round trips. `YYYY-MM-DD` or relative.                                                               |
| `adults`             | integer | `1`       | Adults (12+).                                                                                                     |
| `children`           | integer | `0`       | Children (2–11).                                                                                                  |
| `infants`            | integer | `0`       | Infants (under 2), at most one per adult. Up to 9 passengers in total.                                            |
| `cabinClass`         | string  | `Economy` | `Economy`, `PremiumEconomy`, `Business` or `First` (First is shown by the site as Business fares).                |
| `directFlightsOnly`  | boolean | `false`   | Keep only non-stop itineraries.                                                                                   |
| `maxItems`           | integer | `50`      | Maximum flights returned, cheapest first.                                                                         |
| `proxyConfiguration` | object  | no proxy  | Optional Apify proxy settings.                                                                                    |

### Example input

```json
{
  "tripType": "roundTrip",
  "origins": ["JED", "RUH"],
  "destinations": ["DXB", "CAI"],
  "departureDate": "2026-11-20",
  "returnDate": "2026-11-27",
  "adults": 1,
  "cabinClass": "Economy",
  "maxItems": 50,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

### Output

Each flight option is stored as one record in the default dataset, cheapest first. Prices are numbers in SAR. For one-way searches `price` is the one-way fare for all travellers; for round trips it is the lowest total round-trip fare available with that outbound flight (`priceScope: "roundTripFrom"`).

### Example output

```json
{
  "scrapedAt": "2026-10-07T16:29:23.551Z",
  "url": "https://www.almosafer.com/en/flights/JED-DXB/2026-11-20/Economy/1Adult",
  "title": "JED → DXB · Flynas · XY-509 · 14:30",
  "price": 709.99,
  "currency": "SAR",
  "country": "Saudi Arabia",
  "market": "sa",
  "itineraryId": "1c095a00XY-cda1b510_XY_ONE",
  "tripType": "oneWay",
  "priceScope": "oneWay",
  "pricePerTraveller": 709.99,
  "basePrice": 445.99,
  "taxes": 264,
  "outboundPrice": 709.99,
  "origin": "JED",
  "destination": "DXB",
  "departureDate": "2026-11-20",
  "returnDate": null,
  "adults": 1,
  "children": 0,
  "infants": 0,
  "cabinClass": "Economy",
  "departureAirport": "JED",
  "arrivalAirport": "DXB",
  "departureDateTime": "2026-11-20T14:30:00",
  "arrivalDateTime": "2026-11-20T18:30:00",
  "durationMinutes": 180,
  "stops": 0,
  "airlines": ["Flynas"],
  "flightNumbers": ["XY-509"],
  "validatingAirline": "Flynas",
  "refundable": false,
  "cabinBaggage": "1 x 7 kg",
  "checkedBaggage": null,
  "seatsRemaining": 9,
  "hasFareFamilies": true,
  "tabbyEligible": true,
  "tamaraEligible": true,
  "loyaltyProgram": "flynas - nasmiles",
  "legs": [
    {
      "direction": null,
      "departureAirport": "JED",
      "arrivalAirport": "DXB",
      "departureDateTime": "2026-11-20T14:30:00",
      "arrivalDateTime": "2026-11-20T18:30:00",
      "durationMinutes": 180,
      "stops": 0,
      "route": "JED - DXB",
      "airlines": ["Flynas"],
      "flightNumbers": ["XY-509"],
      "layovers": [],
      "segments": [
        {
          "flightNumber": "XY-509",
          "marketingAirline": "XY",
          "operatingAirline": "XY",
          "aircraft": null,
          "departureAirport": "JED",
          "departureTerminal": "1",
          "arrivalAirport": "DXB",
          "arrivalTerminal": "1",
          "departureDateTime": "2026-11-20T14:30:00",
          "arrivalDateTime": "2026-11-20T18:30:00",
          "durationMinutes": 180,
          "cabin": "Economy",
          "seatsRemaining": 9
        }
      ]
    }
  ]
}
```

### Field reference

| Field                                   | Type    | Description                                                                                                   |
| --------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
| `scrapedAt`                             | string  | ISO 8601 scrape timestamp                                                                                     |
| `url`                                   | string  | Almosafer search results page for this search                                                                 |
| `title`                                 | string  | Route, airline, first flight number and departure time                                                        |
| `price`                                 | number  | Total price for all travellers (see Output)                                                                   |
| `currency`                              | string  | `SAR`                                                                                                         |
| `country` / `market`                    | string  | `Saudi Arabia` / `sa`                                                                                         |
| `itineraryId`                           | string  | Almosafer itinerary identifier                                                                                |
| `tripType` / `priceScope`               | string  | Search type; `oneWay` or `roundTripFrom`                                                                      |
| `pricePerTraveller`                     | number  | Average price per traveller                                                                                   |
| `basePrice` / `taxes`                   | number  | Outbound fare before taxes and taxes                                                                          |
| `outboundPrice`                         | number  | Price of the outbound flight alone                                                                            |
| `origin` / `destination`                | string  | Searched IATA codes                                                                                           |
| `departureDate` / `returnDate`          | string  | Searched dates                                                                                                |
| `adults` / `children` / `infants`       | integer | Passenger mix                                                                                                 |
| `cabinClass`                            | string  | Cabin of the fare                                                                                             |
| `departureAirport` / `arrivalAirport`   | string  | Outbound airports                                                                                             |
| `departureDateTime` / `arrivalDateTime` | string  | Local outbound times                                                                                          |
| `durationMinutes`                       | integer | Total outbound travel time                                                                                    |
| `stops`                                 | integer | Number of stops                                                                                               |
| `airlines` / `flightNumbers`            | array   | Airlines and flight numbers                                                                                   |
| `validatingAirline`                     | string  | Ticketing airline                                                                                             |
| `refundable`                            | boolean | Whether the fare is refundable                                                                                |
| `cabinBaggage` / `checkedBaggage`       | string  | Allowance; `null` checked baggage means not included                                                          |
| `seatsRemaining`                        | integer | Seats left at this fare, when reported                                                                        |
| `hasFareFamilies`                       | boolean | Higher fare options exist                                                                                     |
| `tabbyEligible` / `tamaraEligible`      | boolean | Buy-now-pay-later eligibility                                                                                 |
| `loyaltyProgram`                        | string  | Airline loyalty programme                                                                                     |
| `legs`                                  | array   | Per-leg detail: route, layovers (airport, terminal, minutes) and segments (aircraft, terminals, times, cabin) |

### ❓ FAQ

**Which currency and country are used?** Prices are in Saudi riyals (SAR) as shown to travellers in Saudi Arabia.

**Can I search several routes at once?** Yes. Provide multiple `origins` and `destinations`; each origin-destination pair is searched (same-airport pairs are skipped) and `maxItems` applies per pair.

**Can I search by city name?** Use IATA codes; city codes such as `LON` or `NYC` cover all airports in the city.

**Does it return return-flight details for round trips?** Results list outbound options priced with the lowest round-trip total. Run a separate one-way search for the return date to get return flights.

**How are results ordered?** Cheapest first, limited by `maxItems`.

**How fresh is the data?** Every run performs a live search, so prices and seats reflect the moment of scraping.

**Is a proxy required?** No, the default runs without a proxy. Enable Apify proxy if you scrape at high volume.

**What if a route has no flights?** The run finishes successfully with an empty dataset.

### 🔗 Want More Data?

- [flyadeal Flight Fares Scraper](https://apify.com/boring_internet_explorer/flyadeal-scraper)
- [flynas Flight Fares Scraper](https://apify.com/boring_internet_explorer/flynas-scraper)
- [Riyadh Air Flights Scraper](https://apify.com/boring_internet_explorer/riyadh-air-scraper)
- [flydubai Fare Radar](https://apify.com/boring_internet_explorer/flydubai-flights-scraper)

### 🛠️ Need a custom scraper?

Need this scraper adapted to your use case — extra fields, additional filters, a different output format, or a new website? Reach out at boringinternetexplorer@gmail.com and we'll make it happen.

# Actor input Schema

## `tripType` (type: `string`):

One-way or round trip. Round-trip results list outbound flights priced with the total round-trip fare.

## `origins` (type: `array`):

One or more 3-letter IATA codes of departure airports or cities, e.g. JED, RUH, DMM. Every origin is searched against every destination.

## `destinations` (type: `array`):

One or more 3-letter IATA codes of arrival airports or cities, e.g. DXB, CAI, LON. Every destination is searched against every origin.

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

Departure date as YYYY-MM-DD, or relative to today (e.g. "14 days").

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

Return date as YYYY-MM-DD, or relative to today (e.g. "21 days"). Required for round trips, ignored for one-way searches.

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

Number of adult passengers.

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

Number of child passengers.

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

Number of infants. Must not exceed the number of adults.

## `cabinClass` (type: `string`):

Cabin class to search.

## `directFlightsOnly` (type: `boolean`):

Keep only non-stop itineraries.

## `maxItems` (type: `integer`):

Maximum number of flights to return per origin-destination pair (cheapest first).

## `proxyConfiguration` (type: `object`):

Your proxy configuration from Apify

## Actor input object example

```json
{
  "tripType": "oneWay",
  "origins": [
    "JED"
  ],
  "destinations": [
    "DXB"
  ],
  "departureDate": "14 days",
  "adults": 1,
  "children": 0,
  "infants": 0,
  "cabinClass": "Economy",
  "directFlightsOnly": false,
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "tripType": "oneWay",
    "origins": [
        "JED"
    ],
    "destinations": [
        "DXB"
    ],
    "departureDate": "14 days"
};

// Run the Actor and wait for it to finish
const run = await client.actor("boring_internet_explorer/almosafer-flights-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 = {
    "tripType": "oneWay",
    "origins": ["JED"],
    "destinations": ["DXB"],
    "departureDate": "14 days",
}

# Run the Actor and wait for it to finish
run = client.actor("boring_internet_explorer/almosafer-flights-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 '{
  "tripType": "oneWay",
  "origins": [
    "JED"
  ],
  "destinations": [
    "DXB"
  ],
  "departureDate": "14 days"
}' |
apify call boring_internet_explorer/almosafer-flights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,boring_internet_explorer/almosafer-flights-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/w1C72oIPBo0SMk0eG/builds/tMChXIeY0yC5gPMdy/openapi.json
