Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api exception for pricing #15

Open
matej14086 opened this issue May 2, 2023 · 4 comments
Open

Api exception for pricing #15

matej14086 opened this issue May 2, 2023 · 4 comments

Comments

@matej14086
Copy link

Hello,

I am trying to get prices for this property (https://www.airbnb.com/rooms/33371350)
When I run
python ./stl.py pricing 33371350 --checkin=2023-07-01 --checkout=2023-07-08

I am getting APiException, after little digging I found out that airbnb returns
{'message': "Validation error of type UnknownType: Unknown type ThirdPartyBookingMessagesSection @ 'ThirdPartyBookingMessagesFragment'", 'locations': [], 'extensions': {'classification': 'ValidationError'}}

How can I fix this?

@JoeBashe
Copy link
Owner

JoeBashe commented May 3, 2023

Hello @matej14086. I haven't run into this error before. I would need to spend some time looking into it. There may have been an API change on AirBNB's side. Please let me know if you find any more information. Also, a stack trace would help. Thank you!

@BertCly
Copy link

BertCly commented May 14, 2023

I was looking to debug this error. But do you know where in the Airbnb website this endpoint is called?
/api/v3/startStaysCheckout

@JoeBashe
Copy link
Owner

Hi @BertCly, Thank you for your question. However, I'm sorry to say that I don't know the answer.

Many of these APIs were used in older versions of the website, and so may have been deprecated or removed by now.

The best place to look would be in the Network requests tab of Chrome, and see if you find any matching requests. But it may be necessary to rewrite the script to use whichever new requests are being made. Such is the nature of a scraper, where the subject website is under constant flux.

@NuniTelo
Copy link

Hi @matej14086 !
I don't know if it's still relevant as a question but on the __get_url function inside the Pdp class you can change the following:

data = {
            'variables':  {
                'request': {
                    'id':                                 listing_id, // set id here
                    'checkIn':                       None, // set check in date here
                    'checkOut':                      None, // set checkout date here
                }
    }
    }

Then in your run function inside the AirbnbSearchScraper class, you can access the pricing by accessing: listing['total_price']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants