v1 api seems not working anymore
Opened this issue · 11 comments
I tried preapprove for v1 api, it seems like not working
If you want help, you should at least add some more detail than "seems like not working". Whats the message, what does your request look like?
I got it to work and can submit a PR if needed, but yes endpoints have changed
@mikeck1 if you could submit a PR or explain how to make it work, that'd be awesome!
I'll try to get to that, but because request-promise is deprecated I'm currently working on finding a way to do socks/https proxy support for async requests. I'm also rebuilding the python airbnbapi so it's async but I may write it in rust. I thought it would be easy to do https/socks proxies and async, but I can't find anything yet. Open to all suggestions and languages.
@mikeck1 as of today (Apr 18th 2021) all the login endpoints i tried are no longer working .. they do return a useless error .. can you confirm? are you able to get a new token on any endpoint ? .. old tokens are still working but i'm unable to get a new one :(
@nstiac Yes, it is on v3 now I just updated it today. I can show you how to find the endpoints yourself or hmu and I can give you what I got. I'm rewriting a JavaScript version up now but have a 15 line example which easily could be converted to other language's.
I would be interested in this too!
I'd appreciate the example too
This grabs the top 50 posts then prints the top 2 to console. (the calendar endpoint i'll grab soon)
Stay tuned for a finished API~
node app.js
app.js
const axios = require('axios');
let URL = 'https://www.airbnb.com/api/v3/ExploreSections?operationName=ExploreSections&locale=en¤cy=USD&variables=%7B%22isInitialLoad%22%3Atrue%2C%22hasLoggedIn%22%3Atrue%2C%22cdnCacheSafe%22%3Afalse%2C%22source%22%3A%22EXPLORE%22%2C%22exploreRequest%22%3A%7B%22metadataOnly%22%3Afalse%2C%22version%22%3A%221.7.9%22%2C%22itemsPerGrid%22%3A50%2C%22tabId%22%3A%22home_tab%22%2C%22refinementPaths%22%3A%5B%22%2Fhomes%22%5D%2C%22flexibleTripDates%22%3A%5B%22october%22%2C%22september%22%5D%2C%22flexibleTripLengths%22%3A%5B%22weekend_trip%22%5D%2C%22datePickerType%22%3A%22calendar%22%2C%22placeId%22%3A%22ChIJSx6SrQ9T2YARed8V_f0hOg0%22%2C%22source%22%3A%22structured_search_input_header%22%2C%22searchType%22%3A%22autocomplete_click%22%2C%22query%22%3A%22San%20Diego%2C%20CA%2C%20United%20States%22%2C%22cdnCacheSafe%22%3Afalse%2C%22treatmentFlags%22%3A%5B%22flex_destinations_june_2021_launch_web_treatment%22%2C%22flexible_dates_options_extend_one_three_seven_days%22%2C%22super_date_flexibility%22%2C%22search_input_placeholder_phrases%22%5D%2C%22screenSize%22%3A%22large%22%2C%22isInitialLoad%22%3Atrue%2C%22hasLoggedIn%22%3Atrue%7D%7D&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%228d0321c7f1147d0a210b82f9d11436d68f3cf9f9303aba2aa7596b9b6336fbc1%22%7D%7D&_cb=0sqf51q0n07pxg13jqvcl14k112e';
let headers = {
"accept": "*/*",
"content-type": "application/json",
"user-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36",
"Accept-Encoding": "br, gzip, deflate",
"content-type": "application/json",
"x-airbnb-api-key": "d306zoyjsyarp7ifhu67rjxn52tv0t20",
"accept-language":"en-US,en;q=0.9v"
};
var config = {
headers: headers
};
axios.get(URL,
config).then(response => {
const items = response.data['data']['presentation']['explore']['sections']['sections'][5]['section']['child']['section']['items'];
let items_cleaned = []
for (let i = 0; i <items.length; i++) items_cleaned.push({'listing':items[i]['listing'],'pricingQuote':items[i]['pricingQuote']})
console.log(items_cleaned.slice(0,2));
console.log(items_cleaned.length);
}).catch(error => {
console.log(error);
});
am I the only one having problems with sending message? The endpoint is v2/messages
I think they are retiring v2 slowly in favor of graphql based v3 @Crazy-Ivancz, messages v2 endpoint being the latest suffering from that.