zxol / airbnbapi

Unofficial airbnb.com REST API wrapper for node.js
MIT License
218 stars 52 forks source link

listingSearch doesn't work anymore? #40

Open d668 opened 4 years ago

d668 commented 4 years ago

Copied from the readme

var airbnb = require('airbnbapijs');
(async () => {
    var list = await airbnb.listingSearch({
        location: 'Akihabara, Tokyo',
        checkin: '2020-01-21',
        checkout: '2020-02-10',
        offset: 0,
        limit: 20,
        language: 'en-US',
        currency: 'USD',
        guests: 6, // Number of guests for price quote
        instantBook: true, // only list instant bookable listings.
        minBathrooms: 0,
        minBedrooms: 2,
        minBeds: 6,
        minPrice: 0,
        maxPrice: 0,
        superhost: true,
        amenities: [1, 2, 4, 23], // array of IDs.
        hostLanguages: [1, 3, 6], // array of IDs.
        keywords: 'ocean view,garden,quiet', //comma separated
        roomTypes: ['Entire home/apt', 'Private room', 'Shared room'],
        neighborhoods: ['westside', 'riverside'],
        minPicCount: 4,
        sortDirection: 1 // 1 = forward, 0 = reverse
    });
    console.log(list); //undefined
})().catch(err => {
    console.error(err);
});

list is undefined

jasonsbarr commented 4 years ago

Have you tried logging from a then callback?

pbvillaflores commented 4 years ago

This function stopped working for me too. It worked from earlier this year but stopped working about a couple months ago.

d668 commented 4 years ago

@pbvillaflores because it is silly to assume just calling http endpoint will keep working. Have a look at https://github.com/mgp25/Instagram-API to get the idea what it takes to fool a mega corporation

d668 commented 4 years ago

@jasonsbarr await is the same as then

Anyway

var airbnb = require('airbnbapijs');
airbnb.listingSearch({
    location: 'Akihabara, Tokyo'
})
    .then(x =>
        console.log(x)
        )
    .catch(x =>
        console.log(x)
        );

doesn't go into error, goes into then and undefined

JaLe29 commented 4 years ago

Same for me, return undefined.

Looks like there is also problem with catch block (log doesn`t work??).

After replace log.e to console.error I am getting :

StatusCodeError: 404 - {"error_code":404,"error_type":"record_not_found","error_message":"Unfortunately, this is no longer available.","error_id":"0901df9625d97646f8a8b1fa8eef9b89"}

I am using big cities in query like: Prague, New York, London...

circuitry commented 4 years ago

Was anyone able to get this working?

bobmarley29 commented 4 years ago

@circuitry @JaLe29 that one works fine https://github.com/drawrowfly/airbnb-private-api