Actor picture

Airbnb Scraper

dtrungtin/airbnb-scraper

Extract data for a location from Airbnb. You can scrape all home listings, even for big cities, and get all listing information and reviews from publicly available Airbnb data. Download your data as HTML table, JSON, CSV, Excel, XML, and RSS feed.

Author's avatarTin Duong
  • Modified
  • Users671
  • Runs5,466
Actor picture

Airbnb Scraper

To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running actors via the API in Apify Docs.

const { ApifyClient } = require('apify-client');

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

// Prepare actor input
const input = {
    "locationQuery": "Sacramento",
    "currency": "USD",
    "proxyConfiguration": {
        "useApifyProxy": true
    },
    "maxListings": 10,
    "maxConcurrency": 50,
    "limitPoints": 100,
    "timeoutMs": 60000
};

(async () => {
    // Run the actor and wait for it to finish
    const run = await client.actor("dtrungtin/airbnb-scraper").call(input);

    // Fetch and print actor results from the run's dataset (if any)
    console.log('Results from dataset');
    const { items } = await client.dataset(run.defaultDatasetId).listItems();
    items.forEach((item) => {
        console.dir(item);
    });
})();