# I Am unable to integrate this api

**URL:** <http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776>\
**Category:** API Issues\
**Created:** [April 27, 2018, 7:49am UTC](http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776 "2018-04-27T07:49:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak\_rai](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@deepak\_rai](http://forum.companieshouse.gov.uk/u/deepak_rai)\
**Post date:** [April 27, 2018, 7:49am UTC](http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776/1 "2018-04-27T07:49:59Z")

</div>

Hi I am just integrate the api for agent so that they can access available property and their details using zoopla .I am creating an application regarding this. But My application status either disable or in waiting stage.So Please provide the proper solution so that I can integrate this .Have I buy membership to achieve this or any thing.What I have to do .I have no any idea please help me.

---

<div class="post-metadata">

**Author:** ![lgeorge](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/lgeorge/32/457_2.png) [@lgeorge](http://forum.companieshouse.gov.uk/u/lgeorge)\
**Post date:** [April 27, 2018, 8:33am UTC](http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776/2 "2018-04-27T08:33:52Z")

</div>

The Companies House APIs are free to use. I think you might need to provide some more details of the API call you want to make.

---

<div class="post-metadata">

**Author:** ![deepak\_rai](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@deepak\_rai](http://forum.companieshouse.gov.uk/u/deepak_rai)\
**Post date:** [April 27, 2018, 8:53am UTC](http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776/3 "2018-04-27T08:53:02Z")

</div>

This is is my code to filter the properties near oxford but I am unable to get any response.

$ch = curl\_init();

curl\_setopt($ch, CURLOPT\_URL, “[http://api.companieshouse.gov.uk/search?q=oxford&items\_per\_page=10&start\_index=0](http://api.companieshouse.gov.uk/search?q=oxford&items_per_page=10&start_index=0)”);  
curl\_setopt($ch, CURLOPT\_RETURNTRANSFER, 1);  
curl\_setopt($ch, CURLOPT\_CUSTOMREQUEST, “GET”);

curl\_setopt($ch, CURLOPT\_USERPWD, “2aXMJllzG5I6M7n0H1n5-F0EGO8b-4ufh3jqu34c” . “:” . “”);

$result = curl\_exec($ch);  
if (curl\_errno($ch)) {  
echo ‘Error:’ . curl\_error($ch);  
}  
curl\_close ($ch);  
print\_r($result);exit;

---

<div class="post-metadata">

**Author:** ![lgeorge](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/lgeorge/32/457_2.png) [@lgeorge](http://forum.companieshouse.gov.uk/u/lgeorge)\
**Post date:** [April 27, 2018, 9:17am UTC](http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776/4 "2018-04-27T09:17:40Z")

</div>

There is an example showing how to use an API key in the documentation here: [https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted/apikey\_authorisation.html](https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted/apikey_authorisation.html)

This says ‘the Companies House API takes the username as the API key and ignores the password’. Does that help?

In your post you mention looking for properties near Oxford. Companies House stores data about companies, so if you want a general property search Companies House my not be the best source of this information

---

<div class="post-metadata">

**Author:** ![deepak\_rai](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@deepak\_rai](http://forum.companieshouse.gov.uk/u/deepak_rai)\
**Post date:** [April 27, 2018, 9:57am UTC](http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776/5 "2018-04-27T09:57:28Z")

</div>

When I am using curl command -------\>  
curl -XGET -u 2aXMJllzG5I6M7n0H1n5-F0EGO8b-4ufh3jqu34c: [https://api.companieshouse.gov.uk/company/00000006](https://api.companieshouse.gov.uk/company/00000006)  
it is show the proper result  
but in case of php script ------\>

$ch = curl\_init();

curl\_setopt($ch, CURLOPT\_URL, “[https://api.companieshouse.gov.uk/company/00000006](https://api.companieshouse.gov.uk/company/00000006)”);  
curl\_setopt($ch, CURLOPT\_RETURNTRANSFER, 1);  
curl\_setopt($ch, CURLOPT\_CUSTOMREQUEST, “GET”);

curl\_setopt($ch, CURLOPT\_USERPWD, “2aXMJllzG5I6M7n0H1n5-F0EGO8b-4ufh3jqu34c” . “:” . “”);

$result = curl\_exec($ch);  
if (curl\_errno($ch)) {  
echo ‘Error:’ . curl\_error($ch);  
}  
curl\_close ($ch);

response is like—  
Error:Failed to connect to [api.companieshouse.gov.uk](http://api.companieshouse.gov.uk) port 80: Connection timed out

---

<div class="post-metadata">

**Author:** ![lgeorge](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/lgeorge/32/457_2.png) [@lgeorge](http://forum.companieshouse.gov.uk/u/lgeorge)\
**Post date:** [April 27, 2018, 10:25am UTC](http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776/6 "2018-04-27T10:25:06Z")

</div>

The API is running and I can reach it, so is server where your PHP script is running able to make network requests to the API URL?

---

<div class="post-metadata">

**Author:** ![kevinbradwick](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/kevinbradwick/32/581_2.png) [@kevinbradwick](http://forum.companieshouse.gov.uk/u/kevinbradwick)\
**Post date:** [May 1, 2018, 7:46am UTC](http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776/7 "2018-05-01T07:46:21Z")

</div>

Hi Deepak,

Your PHP code works for me. I did notice however, in your error output that it was trying to connect to port 80. Could it be that you tried this original snippet against https?

Thanks  
Kevin

---

<div class="post-metadata">

**Author:** ![br001manusharma](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/br001manusharma/32/1404_2.png) [@br001manusharma](http://forum.companieshouse.gov.uk/u/br001manusharma)\
**Post date:** [December 6, 2022, 1:06pm UTC](http://forum.companieshouse.gov.uk/t/i-am-unable-to-integrate-this-api/1776/8 "2022-12-06T13:06:25Z")

</div>

Have you problem in API integration? I would recommend the [best api solution provider](https://www.brsoftech.com/blog/cricket-api-provider/) for you.
