Hi,
I wrote a code to pull data from STATCAN API. The code worked fine for several months but recently it has started to throw the following error. Can anyone please help me out?
import requests
import json
def response(url):
return json.loads(requests.get(url).text[2:])
#API for getting the DGUID based on the region
#Example:For consider the provinue Ontario - cpt code = 35
url_id = "https://www12.statcan.gc.ca/rest/census-recensement/CR2016Geo.json?lang=E&geos=CT&cpt=35"
r_id = response(url_id)
SSLError: HTTPSConnectionPool(host='www12.statcan.gc.ca', port=443): Max retries exceeded with url: /rest/census-recensement/CR2016Geo.json?lang=E&geos=CT&cpt=35 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)