Giter Club home page Giter Club logo

airbnbapi's People

Contributors

zxol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airbnbapi's Issues

getPublicListingCalendar not working

I have tried multiple different ways now, but I cannot get

airbnb.getPublicListingCalendar({
    id: 109834757,
    month: 1,
    year: 2018,
    count: 1
})

to work. Does this work for anyone else? Any help is much appreciated. Thanks.

API v3 (GraphQL)

It seems the website started using the V3 of the API which seems to be a GraphQL API.

Has anyone tried accessing that API? Has anyone had success authenticating to it? If yes, then all our troubles around finding the correct formats, api endpoints go away, since graphql is more or less self-documenting.

setAvailabilityForDay method does not seem to work

I find set setAvailabilityForDay does not work but setPriceForDay is ok.

> var setav;
undefined
> airbnb.setAvailabilityForDay({
...     id: 27836280,
...     date: '2019-07-29',
...     availability: 'blocked' // or 'blocked'?
... }).then( v => { setav = v } ) .catch( e => { console.log(e) } )
Promise {
  <pending>,
  domain:
   Domain {
     domain: null,
     _events:
      [Object: null prototype] {
        removeListener: [Function: updateExceptionCapture],
        newListener: [Function: updateExceptionCapture],
        error: [Function: debugDomainError] },
     _eventsCount: 3,
     _maxListeners: undefined,
     members: [],
     [Symbol(kWeak)]: WeakReference {} } }
>
> setav
undefined

Co-Host Issua

While most of the functions this API provide are based on Primary Host, right? For example, the function, will only return the Listings which hosted by the token authorized user. What if there are listings that co-hosted by the user, is there any route we could use to get the limited version of information which is provided to the co-host?

all listingSearch for country?

I am trying to download all listings for Georgia, if i set location: 'Georgia, GE', which seems to work, the offset: 500, brings an empty list already. Any idea how to get all listings without looping through towns?

Thanks for awesome project!!

Airbnb ToS compliance?

Hey guys,

This library looks really good, and I'm very much considering using it!

But before doing so, I'm wondering if anyone ever got airbnb's side on whether or not using their unofficial API goes against their terms of services? I would appreciate anyone's insights on this.

getCalendar seem not working

Hi guys, I am really new in this. I have to tried to request the calendar but I get this error
error_code: 401,
error: 'authentication_required',
error_message: 'Please login to continue.'

My token is correct because I can call to other functions.

Split main.js into endpoint files?

On the issue of giving each endpoint it's own file.

Pros:

  • It would help with git merges and the like,
  • Large files (a la main.js) are considered bad coding style by many.
  • Easier to find specific endpoints to edit.
  • The directory becomes an index of all endpoints in the package.

Cons:

  • Refactoring time (could be a nice scripting challenge to automate)
  • Additional boilerplate
  • More tabs and file juggling to do in the editor
  • Slightly more difficult to refactor code and make project wide changes

I feel this would be a good thing to do before 1.0 version is released.

error code 420

I try to get a token with:
let token = airbnb.newAccessToken({username:'user', password:'password'})

and I get this error msg:


{ error_code: 420,
  error: 'unknown_error',
  error_message: 'Unable to perform action. Please try again through the website or contact support if you need immediate assistance.',
  client_error_info:
   { airlock:
      { action_name: 'account_login',
        completion_redirect_url: '',
        error_redirect_url: '',
        escapable: true,
        fallback_friction: 'contact_us_form',
        first_name: 'xxxxx',
        flow: 'captcha_flow',
        friction_data: [Object],
        header_text: 'Please verify yourself',
        id: 12345678,
        identifier: null,
        keep_webview_open_on_redirect: false,
        redux: true,
        status: 0,
        should_replay_request: true,
        user_id: 876654321,
        user_message: null },
     metadata: {} } }

no ability to set start/end date for listingSearch ? or rental type?

am I missing something? this seems like one of the most important filters when searching for listings.. nearly all filters are available but I can't find how to set the date range.. I mean.. if I want to see listings available between June 1st and June 30th for example.

Also would be lovely to add the "rental type" filter.. eg 'shared room', 'full apartment', etc

Thanks a lot for your contribution! Looking forward to future updates

Proper error reporting

Currently, the library does not have adequate error reporting.

When I initially wrote this library, it was part of a project that used a simple null check to essentially ignore errors. Quite daft, I know. :/

So I think I will need to make some serious changes to the API. I will change it to return a rejected promise with a JS Error object. It will contain either a wrapper level error (i.e. a missing argument) or a error response from airbnb (for example, "listing not found", or "you must be authorized to do that")

How to import?

I would like to import SDK

var airbnb = require('airbnbapijs')

I do not see any component like airbnbapijs. Shouldn't it exist to be import into my web app?

Has anybody ever had any problems for using this API?

The following statement in the project description has scared me away from this project until now:

"(Ab)using it could result in an account ban"

  • Has anybody ever had any related problems?
  • Has any Airbnb representative ever given an opinion on this?
  • If I use it for listings I'm co-host of, do I just risk getting my account banned, or could I cause problems for the listing and its creator as well?

some queries about airbnb.listingSearch method

  1. Is the returned .metadata.listings_count value representing the number of results found? I can't find any other field that is providing a count.

  2. Assuming #1 is correct, when there are a lot of results (>350), I observed that only the first 350 listings returned is unique (this is involving incrementing the offset at each iteration by 50). If you try to get more after that the results are just a duplicate of what was previously returned.

listingSearch doesn't work anymore?

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

Add support for locale (location)

Some endpoints accept a locale option that adds some translated info and changes the currency. Lets implement an option for each endpoint and a default option.

destructure error with airbnb.getOwnListings()

I am getting the following destructure error on getOwnListings method

var ol = airbnb.getOwnListings().then( v => { console.log(v) } ) .catch( e => { console.log(e) } )
undefined
TypeError: Cannot destructure property token of 'undefined' or 'null'.
at AirApi.getOwnListings (C:\mynode\node_modules\airbnbapijs\build\main.js:415:25)
at repl:1:17
at Script.runInThisContext (vm.js:122:20)
at REPLServer.defaultEval (repl.js:332:29)
at bound (domain.js:402:14)
at REPLServer.runBound [as eval] (domain.js:415:12)
at REPLServer.onLine (repl.js:642:10)
at REPLServer.emit (events.js:203:15)
at REPLServer.EventEmitter.emit (domain.js:448:20)
at REPLServer.Interface._onLine (readline.js:308:10)
at REPLServer.Interface._line (readline.js:656:8)
at REPLServer.Interface._ttyWrite (readline.js:937:14)
at REPLServer.self._ttyWrite (repl.js:715:7)
at ReadStream.onkeypress (readline.js:184:10)
at ReadStream.emit (events.js:198:13)
at ReadStream.EventEmitter.emit (domain.js:448:20)
at emitKeys (internal/readline.js:424:14)
at emitKeys.next ()
at ReadStream.onData (readline.js:1075:36)
at ReadStream.emit (events.js:198:13)
at ReadStream.EventEmitter.emit (domain.js:448:20)
at addChunk (_stream_readable.js:288:12)

Specialist is required

As I need a specialist for AirBnB API integration with our current system I would like to know if an expert can help to finalize our project
Thanks

is this repo dead?

i know login broke long time ago but i used to be able to search at least. now the search is empty always

What to learn from Tokeet and Smartbnb

Hi,
Im using Smartbnb and Tokeet for two months now. I've seen some common characteristics on them, I think they have no real API integration. Maybe we could learn something about Airbnb API from their login process.

When you register your Airbnb account. You should go to an Airbnb page and make a Captcha verification.

  • Where does this link comes from? What data is passed in the URL?
  • It is mandatory to make a Captcha to validate phone, mail verification code? As we saw on AirbnbApi Verification EndPoints We can make a request to an URL
  • We have to Captcha, it means Airbnb identifies the petition as a Robot, So... They use Proxy or not?

Smartbnb makes updates every 30 seconds.

  • Why? What is the petition limit per second/minutes?

Sending a message to a thread

I'm having trouble sending a message to a thread (POST /v2/messages), returning a 404:

{"error_code":404,"error_type":"invalid_action","error_message":"Action not found.","error_id":"27d129c058199e4fdeea1d9d76ea90a9"}

Is anyone else seeing the same error?

Reading reviews

A GET to /v2/reviews with the following parameters:

{ 
  _format: "for_web_host_stats",
  _offset: offset, 
  _limit: limit, 
  _order: "recent",
  role: "guest", 
  "reviewee_id": user_id
}

Returns the reviews with pretty much all info. Role can be "host" to return all the reviews made by the hosts for that person.

Your own user_id can be deduced by get_host_summary['active_listings'].first['listing']['listing']['user_id']. Yuck. Whatever, I saved it as a constant and hardwired it, it's good enough for my use case.

Usage Examples in Documentation

Hi there,

Could additional usage examples be included in the README for people not familiar with JS? I am coming from Python, so I am unsure exactly how to use promises. Unfortunately, I am having trouble with the basic task of printing the data from the promises to the console.

This repo seems to be one of the only viable methods to get the Airbnb data I need. Python alternatives are not great.

get all listing for a token

Right now we are able to get only the active listing.
It would be usefull to have an option like isActive to get also non-active listing

Access Denied

var airbnb = require('airbnbapijs');

airbnb.newAccessToken({ username: '[email protected]', password: 'xxxx' }).then(
    x =>
        console.log(x)
);


Access Denied

Token is not generating

Hi,

I am trying to get token for airbnb and it returning null in response. Here is the code I am using
airbnb.login({ username: 'xxxxx', password: 'xxxxx }).then(function(data) { console.log('data: ', data); })

It returning null in console.

airbnb.newAccessToken({ username: 'xxxxxx', password: 'xxxxxx' }).then(function(data) { console.log('data: ', data); })

Above code returning error:-
data: { error: { error_code: 420, error: 'unknown_error', error_message: 'Unable to perform action. Please try again through the website or contact support if you need immediate assistance.' } }

Please help me and let me know where I am doing wrong.

_format=for_mobile_host

Hi,
with get all reservations, I am getting 403 forbidden for _format=for_mobile_host
_format=for_mobile_guest is working well.
Did Airbnb change the API?
Thanks
Petr

Currency setting is not used for all requests

buildOptions defaults currency to JPY:

    buildOptions({
        token,
        method = 'GET',
        route = '/v2/batch',
        uri,
        json = true,
        headers,
        currency = 'JPY',
        format,
        qs,
        body,
        timeout,
        proxy
    })

Even if you use airbnb.setCurrency('USD'); or airbnb.setConfig({ currency: 'USD' }); the requests are being sent with qs.currency: 'JPY' unless specifically set in the method. So e.g. if you ping getOwnListings, you'll get all prices in JPY currency.

Maybe add something in buildOptions to respect the config, instead of the default values there.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.