V
V
Vladsilav2020-04-03 14:23:24
Python
Vladsilav, 2020-04-03 14:23:24

Airbnb api (python) how to create a theme?

I need to use python to create themes on an Airbnb website, I found a wrapper https://github.com/nderkach/airbnb-python but it doesn't have the features I need. Then I found an api on nodejs https://github.com/zxol/airbnbapi in (build/main.js) there is a function that I need (createThread) I tried to port it to Python

@require_auth
    def create_thread(self):
        assert(self._access_token)
        payload={
            'listing_id': 2563611,         #example
            'number_of_guests': 1,         #example
            'message': "Hi",               #example
            'checkin_date': "2020-04-08",  #example
            'checkout_date': "2020-04-10"  #example
        }
        r = self._session.post('https://api.airbnb.com/v1/threads/create', data=json.dumps(payload))
        print(r)  #print(404)
        return r

do
import airbnb
api = airbnb.Api(randomize = True)
api = airbnb.Api("email", "password")
create = api.create_thread()

I get Response [404] at the output

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question