kmadac / bitstamp-python-client

Python package to communicate with bitstamp.net
MIT License
143 stars 70 forks source link

Bitstamp API seems to refuse requests without user-agent #42

Open Deelight-fr opened 5 years ago

Deelight-fr commented 5 years ago

Bitstamp API seems to refuse requests without user-agent.

I added a fake user-agent around here to make it work again: https://github.com/kmadac/bitstamp-python-client/blob/35b9a61f3892cc281de89963d210f7bd5757c717/bitstamp/client.py#L80

Example:

        kwargs['headers'] = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36'
        }
kmadac commented 5 years ago

I just tried couple of requests and I did not experience the issue. Could you please paste output of error which you get when user agent is not defined?