Given an api that returns gzip content (Content-Encoding: gzip at responde header), the code below is goint to gunzip the content. curl -v -H 'Accept-Encoding: gzip, deflate, sdch' http://url | gunzip -