UKHSA-Internal / coronavirus-dashboard-api-python-sdk

Coronavirus (COVID-19) in the UK - API Service SDK for Python
https://coronavirus.data.gov.uk/
MIT License
67 stars 18 forks source link

'Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check' #15

Open bhavesh0009 opened 4 years ago

bhavesh0009 commented 4 years ago

Not able to get data from API. This code was working fine till yesterday. Today getting following error - "ContentDecodingError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check'))"

from uk_covid19 import Cov19API
import pandas as pd

ltla_filter = ['areaType=ltla']
cases_and_deaths = {
                    "areaType":"areaType"
                    ,"areaName":"areaName"
                    ,"areaCode":"areaCode"
                    ,"specimenDate":"date"
                    ,"dailyLabConfirmedCases":"newCasesBySpecimenDate"
                    ,"totalLabConfirmedCases":"cumCasesBySpecimenDate"
                    }
api = Cov19API(filters=ltla_filter, structure=cases_and_deaths)
data = api.get_json()  # Returns a dictionary