StackOverflow - web-scraping, graphql, airbnb-js-styleguide
How to set the AirBNB API "extensions" parameter?
I had the same issue (wanted to get the prices) and after investigating in the HAR files that you can get with Chrome, I found out that you get this value from a Javascript file called PdpPlatformRoute.xxx.js The steps to get this hash are simply to load the file PdpPlatformRoute.xxx.js, then to parse the file to get an "operationId". If this helps, this is how I did this. // contentPage is the HTML content of the listing page (e.g. https://www.airbnb.com/rooms/1234567) function getPdpPlatformRouteUrl(contentPage) { return 'https://a0.muscache.com/airbnb/static/packages/web/en/frontend/gp-stays-pdp-route/routes/' + `${contentPage}`.match(/(PdpPlatformRoute\.\w+\.\js)/)?.[1]; } // textContent is the JS content that you get when you fetch the previously found URL function getSha256(textContent) { return `${textContent}`.match(/name:'StaysPdpSections',type:'query',operationId:'(.*)'/)?.[1]; }
Was this helpful?
Related Articles
Have a different question?
Can't find the answer you're looking for? Submit your own question to our community.
🛎️ Get Weekly OTA Fixes
New answers, vendor issues, and updates — straight to your inbox.