# 403 Forbidden response using the API to access Company Profiles

**URL:** <http://forum.companieshouse.gov.uk/t/403-forbidden-response-using-the-api-to-access-company-profiles/4269>\
**Category:** API Issues\
**Created:** [August 16, 2021, 4:18pm UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-response-using-the-api-to-access-company-profiles/4269 "2021-08-16T16:18:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.clements](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/p/b5ac83/32.png) [@peter.clements](http://forum.companieshouse.gov.uk/u/peter.clements)\
**Post date:** [August 16, 2021, 4:18pm UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-response-using-the-api-to-access-company-profiles/4269/1 "2021-08-16T16:18:39Z")

</div>

Hi,

I am attempting to use Company Profile api to download company profiles but am getting a 403 Forbidden error.

I intend to write PHP code to do this but am carrying out initial testing (to verify that I am using the API correctly) using curl (api key and company number obfuscated):

curl -v -XGET -u 01234567-89ab-cdef-0123-456789abcdef: [https://api.company-information.service.gov.uk/company/01234567](https://api.company-information.service.gov.uk/company/01234567)

This is giving the following response:

\< HTTP/1.1 403 Forbidden  
\< Date: Mon, 16 Aug 2021 15:51:42 GMT  
\< Content-Length: 0  
\< Connection: keep-alive

- Server CompaniesHouse is not blacklisted  
\< Server: CompaniesHouse  
\<
- Connection #0 to host [api.company-information.service.gov.uk](http://api.company-information.service.gov.uk) left intact

The API Key was created today by me with the Live options selected. I had initially tried creating a Test API key and used that with sandbox url but that also just fails. I had also initially restricted the IP addresses, but then tried removing the restriction without success.

Am I doing something wrong? Can you help?

Peter Clements
