{"id":20655127,"url":"https://github.com/zxol/airbnbapi","last_synced_at":"2025-04-06T04:10:48.896Z","repository":{"id":31880498,"uuid":"105983528","full_name":"zxol/airbnbapi","owner":"zxol","description":"Unofficial airbnb.com REST API wrapper for node.js","archived":false,"fork":false,"pushed_at":"2022-12-30T17:39:54.000Z","size":763,"stargazers_count":222,"open_issues_count":42,"forks_count":53,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-30T03:04:15.169Z","etag":null,"topics":["airbnb","airbnb-api","api","javascript","node","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zxol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-06T08:38:45.000Z","updated_at":"2025-03-18T16:51:52.000Z","dependencies_parsed_at":"2023-01-14T19:59:56.759Z","dependency_job_id":null,"html_url":"https://github.com/zxol/airbnbapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxol%2Fairbnbapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxol%2Fairbnbapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxol%2Fairbnbapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxol%2Fairbnbapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zxol","download_url":"https://codeload.github.com/zxol/airbnbapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430870,"owners_count":20937874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airbnb","airbnb-api","api","javascript","node","nodejs"],"created_at":"2024-11-16T18:09:01.842Z","updated_at":"2025-04-06T04:10:48.871Z","avatar_url":"https://github.com/zxol.png","language":"JavaScript","readme":"## Breaking changes ahead!\n\nVersion 0.11.0, due to be released sometime after July 1st. Errors will no longer return null values. Instead, errors will be thrown.\n\n# _Unofficial_ **airbnb.com** REST API wrapper for node.js\n\n![](http://eloisecleans.com/blog/wp-content/uploads/2018/02/airbnb-logo-png-logo-black-transparent-airbnb-329-300x300.png)\n![](https://cdn2.iconfinder.com/data/icons/nodejs-1/256/nodejs-256.png)  \n![](https://travis-ci.org/zxol/airbnbapi.svg?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/zxol/airbnbapi/badge.svg?branch=master)](https://coveralls.io/github/zxol/airbnbapi?branch=master)\n\n---\n\nHi there! 👋 This is a javascript library for interacting with airbnb's API.  \n_Disclaimer: this library is not associated with airbnb and should only be used for educational reasons. It is an interface for a private API used by airbnb's mobile applications._  \nThis is a pre 1.0 library. Please request endpoints and functionality as repo issues. Collaborators wanted!\n\n# Essential Info\n\n-   All functions return [**promises**.](https://github.com/wbinnssmith/awesome-promises)\n-   The returned data format is pre-parsed JSON, i.e. a javascript object. Multiple records will be returned as an array.\n-   The auth system is a simple crypto token. For the uninitiated, this is like a username and password in one. If you're only using a single account, you can supply a token with `.setDefaultToken()`, otherwise, you will have to supply a token with every function call.\n-   Yeah, I know, airlock is a massive pain in the posterior.\n-   Error reporting and data validation is spotty at this stage!\n-   This library only has one dependency - request-promise.\n\n# Getting started 👨‍💻\n\n## Installing\n\n```\nnpm install airbnbapijs\n```\n\n## Importing\n\n```\nvar airbnb = require('airbnbapijs')\n```\n\nor es6...\n\n```\nimport airbnb from 'airbnbapijs'\n```\n\n# Reference 📗\n\n## Contents\n\n1. Authorization\n1. Users\n1. Calendars\n1. Listings\n1. Threads\n1. Reservations\n1. Posting\n1. Configuration\n\n---\n\n## AUTHORIZATION\n\n### testAuth\n\nTest a token\n\n```js\nairbnb.testAuth('faketoken3sDdfvtF9if5398j0v5nui')\n// returns bool\n```\n\n### newAccessToken\n\nRequest a new token\n\n```js\nairbnb.newAccessToken({ username: 'foo@bar.com', password: 'hunter2' })\n// returns {token: 'faketoken3sDdfvtF9if5398j0v5nui'} or {error: {error obj}}\n```\n\n### login\n\nRequest a new token (v2 endpoint). Similar to the above function but returns a user info summary with much more information.\n\n```js\nairbnb.login({ username: 'foo@bar.com', password: 'hunter2' })\n// returns a user info object (includes token) or {error: {error obj}}\n```\n\n### setDefaultToken\n\nSet the token to use if a token is not supplied for an endpoint function.\n\n```js\nairbnb.setDefaultToken('faketoken3sDdfvtF9if5398j0v5nui')\n```\n\nTODO: support other login methods (facebook, twitter, etc...)\n\n---\n\n## USERS\n\n### getGuestInfo\n\nGet a user's public facing information\n\n```js\nairbnb.getGuestInfo(2348485493)\n// returns public info about user (JSON)\n```\n\n### getOwnUserInfo\n\nObtain user data for the logged in account\n\n```js\nairbnb.getOwnUserInfo('faketoken3sDdfvtF9if5398j0v5nui')\n// returns private info about user (JSON)\n```\n\n---\n\n## CALENDARS\n\n### getPublicListingCalendar\n\nPublic availability and price data on a listing. `count` is the duration in months.\n\n```js\nairbnb.getPublicListingCalendar({\n    id: 109834757,\n    month: 1,\n    year: 2018,\n    count: 1\n})\n// returns array of calendar days, with availability and price\n```\n\n### getCalendar\n\nPrivate calendar data regarding your listings. Reservations, cancellations, prices, blocked days.\n\n```js\nairbnb.getCalendar({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    id: 109834757,\n    startDate: '2018-01-01',\n    endDate: '2018-02-28'\n})\n// returns array of calendar days with extended info, for your listings\n```\n\n### setPriceForDay\n\nSet a price for a day.\n\n```js\nairbnb.setPriceForDay({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    id: 109834757,\n    date: '2018-01-01',\n    price: 1203\n})\n// returns a result of the operation\n```\n\n### setAvailabilityForDay\n\nSet availability for a day.\n\n```js\nairbnb.setAvailabilityForDay({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    id: 109834757,\n    date: '2018-01-01',\n    availability: 'available' // or 'blocked'?\n})\n// returns a result of the operation\n```\n\n---\n\n## LISTINGS\n\n### listingSearch\n\nAirbnb's mighty search bar in JSON form. All arguments are optional.\n\n```js\nairbnb.listingSearch({\n    location: 'Akihabara, Tokyo',\n    checkin: '2020-01-21',\n    checkout: '2020-02-10',\n    offset: 0,\n    limit: 20,\n    language: 'en-US',\n    currency: 'USD',\n    guests: 6, // Number of guests for price quote\n    instantBook: true, // only list instant bookable listings.\n    minBathrooms: 0,\n    minBedrooms: 2,\n    minBeds: 6,\n    minPrice: 0,\n    maxPrice: 0,\n    superhost: true,\n    amenities: [1, 2, 4, 23], // array of IDs.\n    hostLanguages: [1, 3, 6], // array of IDs.\n    keywords: 'ocean view,garden,quiet', //comma separated\n    roomTypes: ['Entire home/apt', 'Private room', 'Shared room'],\n    neighborhoods: ['westside', 'riverside'],\n    minPicCount: 4,\n    sortDirection: 1 // 1 = forward, 0 = reverse\n})\n// returns an array of listings\n```\n\n### getListingInfo\n\nGets public facing data on any listing.\n\n```js\nairbnb.getListingInfo(109834757)\n// returns public info for any listing (JSON)\n```\n\n### getListingInfoHost\n\nGets private data on one of your listings.\n\n```js\nairbnb.getListingInfoHost({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    id: 109834757\n})\n// returns extended listing info for your listing (JSON)\n```\n\n### getHostSummary\n\nGets an object containing a host's active listings, alerts, and upcoming reservations\n\n```js\nairbnb.getHostSummary('faketoken3sDdfvtF9if5398j0v5nui')\n// returns host summary info for your account (JSON)\n```\n\n### getOwnActiveListings\n\nGets an array containing a host's active listings\n\n```js\nairbnb.getOwnActiveListings('faketoken3sDdfvtF9if5398j0v5nui')\n// returns listing array for your account (JSON)\n```\n\n---\n\n### getOwnListings\n\nGets an array containing a host's listings\n\n```js\nairbnb.getOwnListings({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    userId: '2344594'\n})\n// returns listing array for your account (JSON)\n```\n\n---\n\n## THREADS\n\n### getThread\n\nReturns a conversation with a guest or host. This is a legacy endpoint which is somewhat limited in the content (only basic messages are reported in the 'posts' array)\n\n```js\nairbnb.getThread({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    id: 909878797\n})\n// returns a single thread in the legacy format (JSON)\n```\n\n### getThreads\n\nA simple list of thread ID's, ordered by latest update. The offset is how many to skip, and the limit is how many to report.\n\n```js\nairbnb.getThreads({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    offset: 0,\n    limit: 20\n})\n// returns an array of thread IDS (only the ids, ordered by latest update) (JSON)\n```\n\n### getThreadsFull\n\nThis is the best way to pull thread data. Returns an array of full thread data, ordered by latest update. The `offset` is how many to skip, and the `limit` is how many to report.\n\n```js\nairbnb.getThreadsFull({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    offset: 0,\n    limit: 10\n})\n// returns an array of threads in the new format, ordered by latest update (JSON)\n```\n\n### getThreadsBatch\n\nA batch version of the above. You can grab a collection of threads referenced by thread ID.\n\n```js\nairbnb.getThreadsBatch({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    ids: [23049848, 203495875, 398328244]\n})\n// returns an array of threads in the new format (JSON)\n```\n\n---\n\n## RESERVATIONS\n\n### getReservation\n\nReservation data for one reservation.\n\n```js\nairbnb.getReservation({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    id: 909878797\n})\n// returns a single reservation in the mobile app format (JSON)\n```\n\n### getReservations\n\nReturns a list of reservations in the same format as above, ordered by latest update\n\n```js\nairbnb.getReservations({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    offset: 0,\n    limit: 10\n})\n// returns an array of reservations in the mobile app format, ordered by latest update (JSON)\n```\n\n### getReservationsBatch\n\nBatch call for grabbing a list of reservations by ID.\n\n```js\nairbnb.getReservationsBatch({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    ids: [98769876, 98769543, 98756745]\n})\n// returns an array of reservations in the new format (JSON)\n```\n\n---\n\n## POSTING\n\n### sendMessage\n\nSend a message to a thread.\n\n```js\nairbnb.sendMessage({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    id: 2039448789,\n    message: 'Hi there!'\n})\n// returns confirmation\n```\n\n### sendPreApproval\n\nSend a pre-approval to a guest.\n\n```js\nairbnb.sendPreApproval({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    thread_id: 2039448789,\n    listing_id: 340598483,\n    message: ''\n})\n// returns confirmation\n```\n\n### sendReview\n\nSend a review to a guest after they have checked out. (`id` is the thread id)\n\n```js\nairbnb.sendReview({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    id: 2039448789,\n    comments: 'They were great guests!',\n    private_feedback: 'Thank you for staying!',\n    cleanliness: 5,\n    communication: 5,\n    respect_house_rules: 5,\n    recommend: true\n})\n// returns confirmation\n```\n\n### sendSpecialOffer\n\nSend a special offer to a guest.\n\n```js\nairbnb.sendSpecialOffer({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    check_in: '2018-10-13T00:00:00+00:00',\n    guests: 1,\n    listing_id: 9876676,\n    nights: 1,\n    price: 100000,\n    thread_id: 98766767,\n    currency: 'USD'\n})\n// returns confirmation\n```\n\n### alterationRequestResponse\n\nSend a \"reservation alteration request response\" to a guest  \nTo accept the request, supply the `decision` prop with `true`  \nTo decline the request, supply the `decision` prop with `false`\n\n```js\nalterationRequestResponse({\n    token: 'faketoken3sDdfvtF9if5398j0v5nui',\n    reservationId: 23049459,\n    alterationId: 2134094,\n    decision: true,\n    currency: 'USD'\n})\n// returns alteration object, or an error object.\n```\n\n## CONFIGURATION\n\n### setConfig\n\nSet multiple config variables at once\n\n```js\nsetConfig({\n    defaultToken: 'faketoken3sDdfvtF9if5398j0v5nui',\n    apiKey: '01123581321345589144233377610987',\n    currency: 'USD',\n    userAgent: 'Mosaic/0.9',\n    proxy: 'myproxy.com'\n})\n```\n\n### setDefaultToken\n\nSet the token to use if a token is not supplied for an endpoint function.\n\n```js\nairbnb.setDefaultToken('faketoken3sDdfvtF9if5398j0v5nui')\n```\n\n### setApiKey\n\nUse an api key different from the standard one\n\n```js\nairbnb.setApiKey('01123581321345589144233377610987')\n```\n\n### setCurrency\n\nSet the default [currency](https://www.iban.com/currency-codes.html) (the default is JPY, sorry USA)\n\n```js\nairbnb.setCurrency('USD')\n```\n\n### setUserAgent\n\nset the user agent string for the requests\n\n```js\nairbnb.setUserAgent('Mosaic/0.9')\n```\n\n### setProxy\n\nset a proxy server to run traffic through\n\n```js\nairbnb.setProxy('myproxy.com')\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxol%2Fairbnbapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzxol%2Fairbnbapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxol%2Fairbnbapi/lists"}