Checks to find any matching companies filtered on company name and/or postcode. You can filter on any partial name or partial postcode - a wildcard is assumed.
The companystatus parameter allows you to restrict the results to only the status code you want. The most useful of these is Active which restricts the results to only currently active companies.
The return value includes an array of CompaniesHousePartialResult records that include a summary of all companies matching the search. The details from one or more of these records can be passed to the GetCompanyDetails method to retrieve the full details of the company.
<!-- Import the Integr8 Ajax API -->
<!-- NOTE: Get your own API key to use in the following script tag from: -->
<!-- http://www.data-8.co.uk/integr8/Admin/Ajax.aspx -->
<script src="https://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key" type="text/javascript">
</script>
<script type="text/javascript">
function loadIntegr8() {
// Load the CompaniesHouse Integr8 service
data8.load('CompaniesHouse');
}
function FindCompanyByNameOrPostcode(companyname, postcode, companystatus) {
/// <param name="companyname">string</param>
/// <param name="postcode">string</param>
/// <param name="companystatus">string</param>
var companieshouse = new data8.companieshouse();
companieshouse.findcompanybynameorpostcode(
companyname,
postcode,
companystatus,
null,
showFindCompanyByNameOrPostcodeResult
);
}
function showFindCompanyByNameOrPostcodeResult(result) {
// Check that the call succeeded, and show the error message if there was a problem.
if (!result.Status.Success) {
alert('Error: ' + result.Status.ErrorMessage);
}
else {
// TODO: Process method results here.
// Results can be extracted from the following fields:
// result.Results
// Contains the partial details found for the requested companies on the companies house database.
}
}
loadIntegr8();
</script>
// NOTE: A reference to the web service must be added to use this sample code.
// See the details at:
// https://www.data-8.co.uk/developers/how-to/-net-1-0-1-1-and-2-0-web-references
// or
// https://www.data-8.co.uk/developers/how-to/-net-3-5-and-later-service-references
private void FindCompanyByNameOrPostcode(string companyname, string postcode, string companystatus)
{
// Invoke the web service method.
CompaniesHouseSoapClient proxy = new CompaniesHouseSoapClient();
CompaniesHousePartialOutput results = proxy.FindCompanyByNameOrPostcode("username", "password", companyname, postcode, companystatus, null);
// Check that the call succeeded, and show the error message if there was a problem.
if ((results.Status.Success == false))
{
MessageBox.Show(("Error: " + results.Status.ErrorMessage));
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// result.Results
// Contains the partial details found for the requested companies on the companies house database.
}
}
'NOTE: A reference to the web service must be added to use this sample code.
'See the details at:
'https://www.data-8.co.uk/developers/how-to/-net-1-0-1-1-and-2-0-web-references
'or
'https://www.data-8.co.uk/developers/how-to/-net-3-5-and-later-service-references
Private Sub FindCompanyByNameOrPostcode(ByVal companyname As String, ByVal postcode As String, ByVal companystatus As String)
'Invoke the web service method.
Dim proxy As CompaniesHouseSoapClient = New CompaniesHouseSoapClient()
Dim results As CompaniesHousePartialOutput = proxy.FindCompanyByNameOrPostcode("username", "password", companyname, postcode, companystatus, Nothing)
'Check that the call succeeded, and show the error message if there was a problem.
If (results.Status.Success = false) Then
MessageBox.Show(("Error: " + results.Status.ErrorMessage))
Else
'TODO: Process method results here.
'Results can be extracted from the following fields:
'result.Results
' Contains the partial details found for the requested companies on the companies house database.
End If
End Sub
// NOTE: The php_soap.dll extension must be enabled in the php.ini file.
function FindCompanyByNameOrPostcode($companyname, $postcode, $companystatus)
{
$params = array(
"username" => "your-username",
"password" => "your-password",
"companyname" => $companyname,
"postcode" => $postcode,
"companystatus" => $companystatus,
"options" => $options
);
$client = new SoapClient("https://webservices.data-8.co.uk/CompaniesHouse.asmx?WSDL");
$result = $client->FindCompanyByNameOrPostcode($params);
if ($result->FindCompanyByNameOrPostcodeResult->Status->Success == 0)
{
echo "Error: " . $result->FindCompanyByNameOrPostcodeResult->Status->ErrorMessage;
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// $result->FindCompanyByNameOrPostcodeResult->Results
// Contains the partial details found for the requested companies on the companies house database.
// NOTE: This field contains an array of items, but if it contains only one item,
// PHP may not recognise it as an array. To always extract the result of this
// field as an array, we recommend you always access it using the
// getArrayFromResponse method described at
// http://www.php.net/soap_soapclient_soapcall#75797, e.g.
// foreach (getArrayFromResponse($result->FindCompanyByNameOrPostcodeResult->Results) as $item)
// {
// ...
// }
}
}
Public Sub FindCompanyByNameOrPostcode(companyname As String, postcode As String, companystatus As String)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "https://webservices.data-8.co.uk/recordset.ashx?service=CompaniesHouse&method=FindCompanyByNameOrPostcodeSimple" &
"&username=your-username" &
"&password=your-password" &
"&companyname=" & companyname &
"&postcode=" & postcode &
"&companystatus=" & companystatus
If rs.MoveFirst Then
If rs.Fields(0).Name = "Success" And rs.Fields(0).Value = false Then
MsgBox "Error: " & rs.Fields(1)
Else
'TODO: Process method results here.
'Each result is available in a different row in the recordset.
'Results can be extracted from the following fields:
'CompanyName
'CompanyNumber
'CompanyCategory
'CompanyStatus
'Town
End If
End If
End Sub