Responses from the API are by default [compressed with GZIP](https://api.stackexchange.com/docs/compression). Your browser knows how to handle this; with most libraries you have to specify explicitly that you want support for compression.

(I've been bitten by this as well in the past...)