Call API from Python

import requests
import urllib3

# suppress the HTTPS warnings in terminal

session = requests.Session()
session.verify = False

url = ""
headers = {'content-type': 'application/json', 'Accept-Charset': 'UTF-8'}

# call the HTTP endpoint
httpResult = session.get(url, headers=headers)

# some extra details
elapsedSeconds = httpResult.elapsed.total_seconds()
statusCode = httpResult.status_code

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)’: /simple/pylint/ >>>>>>>> Could not fetch URL There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’’, port=443): Max retries exceeded with url: /simple/setuptools/ (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)) – skipping

// add the following flag to the pip command:

--trusted-host --trusted-host

// or wherever the error indicates a problem in

HTTPSConnectionPool(host='', port=443)

Install GPIO Python library

//Install pip:
sudo apt-get install python3-pip

//Install the library and dependencies:
python3 -m pip install setuptools
python3 -m pip install RPi.GPIO
python3 -m pip install gpiozero
python3 -m pip install RPIO
python3 -m pip install pigpio