drawrowfly / airbnb-private-api

Unofficial AirBnb Private API Wrapper
51 stars 13 forks source link

AirBnb Private API

Attention this is Unofficial AirBnb API based on Android Application. Use this API at you own risk and only for educational purposes

If you like this tool then please Star it

Buy Me A Coffee

Features

TO DO

Content

Possible errors

Installation

Install from NPM

$ npm i airbnb-private-api

Install from YARN

$ yarn add airbnb-private-api

Usage

Import library

const { AirBnbClient } = require('airbnb-private-api');

Authorization By Email

_authentication_by_email

Authorization By Phone

_authentication_by_phone

_load_session

_get_user_profile
_get_wishlists
#### Listing
##### _get_listings
 - Method is returning a list of your listed properties
 - Method is accepting an object with **id** and **_limit** values
 - **id** - listing id. If not specified then method will return **_limit** number of listings. **Defaut value: 0**
 - **_limit** - number of listings to return. **Default value: 10**
```javascript  
(async() => {
    try {  
        let response = await airbnb._get_listings({ _limit: 20 });
        console.log('My listings: ', response)
    } catch (error) {
        console.log('Error: ', error);
    }
})()

Calendar

_update_calendar_price
_update_calendar_availability
_update_calendar_note
_update_calendar_smart_pricing

Messages

_messaging_syncs
_get_threads_ids
_get_thread_by_id
_get_threads_full

Reservations

_get_reservations
(async() => {
    try {  
        let response = await airbnb._get_reservations({
            _limit: 20,
            _offset: 0,
            order_by: 'nights',
            end_date: '2020-04-17'
        });
        console.log('Reservation list: ', response)
    } catch (error) {
        console.log('Error: ', error);
    }
})()
_get_reservation_details

Examples

const { AirBnbClient } = require('airbnb-private-api');

let airbnb = new AirBnbClient({
    email: 'email@example.com',
    password: 'password',
    session_path: '/user/bob/Downloads',
});

// If we do not have an active session then we need to call _authentication_by_email() or _authentication_by_phone() method
// If authorization was succesfull(no errors) then Do Not Use this method anymore in the future
(async() => {
    try {
        await airbnb._authentication_by_email();
        let my_listings = await airbnb._get_listings({});
        console.log("My listings: ", my_listings)
    } catch (error) {
        console.log('Error: ', error);
    }
})()

// If we already have an active session then we need to load session details with method _load_session()
(async() => {
    try {
        await airbnb._load_session();
        let my_listings = await airbnb._get_listings({});
        console.log("My listings: ", my_listings)
    } catch (error) {
        console.log('Error: ', error);
    }
})()

Options

let options = {
    //Email: {string default: ""}
    email: "exampl@mail.com",

    //Password: {string default: ""}
    password: 'bob',

    //Set proxy: {string default: ""}
    proxy: "",

    //Set currency: {string default: "USD"}
    currency: 'USD',

    //Set locale: {string default: "en-US"}
    locale: 'en-US',

    // Session is stored in json file and file it self should be stored somewhere
    // Set session file location: {string default: "{HOME_DIR}/Downloads}
    session_path:'/user/bob/Downloads',
};

Buy Me A Coffee


License

MIT

Free Software