import requests import subprocess out1 = subprocess.Popen(["curl", "https://platform.tier-services.io/v1/vehicle/f6f55778-9339-4f81-8584-7645f3a6c4be", "-H", "x-api-key: bpEUTJEBTf74oGRWxaIcW7aeZMzDDODe1yBoSxi2"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, stderr = out1.communicate() print(stdout(['43data']))