Skip to content

apify-projects/store-flixbus-search-scraper

Repository files navigation

Flixbus Search Scraper

The Flixbus Search Scraper is a tool that allows you to extract essential information from Flixbus search results. With this scraper, you can easily retrieve the following details:

  • 🕒 Departure and arrival times with duration of the route
  • 💵 Fare prices
  • 🚏 Departure and arrival locations
  • 📶 Available amenities

How to Use

To utilize the Flixbus Search Scraper, you have two options:

  1. Apify Client: You can use the Apify Client to interact with the scraper programmatically.

  2. API: Alternatively, you can leverage the API to integrate the scraper into your own applications.

Benefits of Using Flixbus Search Scraper

There are several advantages to using the Flixbus Search Scraper:

  • 🚀 Access: Since Flixbus no longer provides public APIs without prior application and approval, this scraper allows you to retrieve the data you need without going through the complex approval process.

  • ⚡️ Efficiency: By automating the data extraction process, the scraper saves you time and effort. You can obtain Flixbus search results quickly and seamlessly.

  • 🛠 Flexibility: With the extracted Flixbus data, you can build powerful applications that combine multiple aggregators like Regiojet, enhancing your users' experience and providing comprehensive travel information.

Input Schema

The input schema defines the parameters required to configure and customize the Flixbus Search Scraper. Here are the available input properties:

  • lang (string, default: "English (US)"): The language that will be used. Determines the language of the input and output data.

  • from (string, default: "Berlin"): The departing city for the search.

  • to (string, default: "Prague"): The arrival city for the search.

  • rideDate (string): The date of the trip.

  • adult (integer, default: 1): The number of adults traveling.

  • student (integer, default: 0): The number of students traveling. Students are required to show a valid Student ID.

  • children_0_5 (integer, default: 0): The number of children aged 0-5 traveling.

  • children_6_17 (integer, default: 0): The number of children aged 6-17 traveling.

  • senior (integer, default: 0): The number of seniors (older than 65 years old) traveling.

  • bike_slot (integer, default: 0): The number of bike slots. Note that E-bikes and scooters are not allowed on buses.

  • proxyConfiguration (object): Proxy configuration options for using Apify Proxy or your custom proxy. Please provide a proxy from a place where cookies policy acceptance is not required.

Please ensure to provide the required properties: from, to, rideDate, and proxyConfiguration.

Note: You need to provide at least one valid passenger or you will it will error out. Please note that the available passenger types may vary depending on the specific route and country. For instance, when traveling from Prague to Brno, you will have the option to select "students" as a passenger type, whereas when traveling from Prague to Berlin, this option may not be available. In such cases, please refrain from selecting passenger types other than "adults."

Getting Started

To get started with the Flixbus Search Scraper, follow these steps:

  1. Install the Apify Client or utilize the Apify API.

  2. Configure the input parameters such as language, departure and arrival cities, travel dates, and the number of passengers.

  3. Run the scraper and retrieve the extracted Flixbus search results.

  4. Process the obtained data and incorporate it into your applications, websites, or services.

Example

Here's a sample code snippet to demonstrate how to use the Flixbus Search Scraper with the Apify Client:

// Import the Apify Client
import {ApifyClient} from 'apify-client';

// Define variables
const TOKEN = "YOUR_APIFY_TOKEN"
const ACTOR_NAME = "celnar.lukas/flixbus-search-scraper"

// Create a new client
const client = new ApifyClient({
  token: TOKEN
});

// Define your input parameters
const input = {
  lang: 'en-gb',
  from: 'Berlin',
  to: 'Prague',
  rideDate: '2023-06-19', // Change this to your current date
  adult: 1,
  student: 0,
  children_0_5: 0,
  children_6_17: 0,
  bike_slot: 0,
  senior: 0,
  proxyConfiguration: {
    useApifyProxy: true,
    apifyProxyCountry: "US" // Make sure to use proxies from a country where cookies policy acceptance isnt required
  },
};

// Starts an actor and waits for it to finish.
const { defaultDatasetId } = await client.actor(ACTOR_NAME).call(input);
// Fetches results from the actor's dataset.
const { items } = await client.dataset(defaultDatasetId).listItems();

// Console log output
console.log(items)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published