Hello, Im trying to write a python code to get company profile from company registration number. I am however getting an error
{
“error”: “Empty Authorization header”,
“type”: “ch:service”
}
My code as follow:
import requests
api_key = “MY_API_KEY”
companyNumber = 99999999
url = f"https://api.company-information.service.gov.uk/company/{companyNumber}"
headers = {
“Authorization”: f"Bearer {api_key}",
“Content-Type”: “text/json”
}
response = requests.get(url, headers=headers)
print(response.content)