Skip to main content

Search companies

requires authentication

GET resource/companies/search

Headers

x-api-key
Example: your-api-key-here

Content-Type
Example: application/json

Accept
Example: application/json

Query Parameters

domain string optional

optional string The domain identifier of the company. Example: example.com

Body Parameters

domain - optional

optional string The domain identifier of the company. Example: example.com

Bash

Example request:
curl --request GET \
--get "https://api2.sonalabs.com/resource/companies/search?domain=example.com" \
--header "x-api-key: your-api-key-here" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"domain\": \"example.com\"
}"
Example response (200, Success):

{
"version": "2.0.0",
"php": "8.3.19",
"status": "success",
"data": {}
}

Example response (404, Error):

{
"version": "2.0.0",
"php": "8.3.19",
"status": "error",
"data": "No result found"
}

JavaScript

Example request:
const url = new URL(
"https://api2.sonalabs.com/resource/companies/search"
);

const params = {
"domain": "example.com",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));

const headers = {
"x-api-key": "your-api-key-here",
"Content-Type": "application/json",
"Accept": "application/json",
};

let body = {
"domain": "example.com"
};

fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, Success):

{
"version": "2.0.0",
"php": "8.3.19",
"status": "success",
"data": {}
}

Example response (404, Error):

{
"version": "2.0.0",
"php": "8.3.19",
"status": "error",
"data": "No result found"
}

PHP

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api2.sonalabs.com/resource/companies/search';
$response = $client->get(
$url,
[
'headers' => [
'x-api-key' => 'your-api-key-here',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'domain' => 'example.com',
],
'json' => [
'domain' => 'example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200, Success):

{
"version": "2.0.0",
"php": "8.3.19",
"status": "success",
"data": {}
}

Example response (404, Error):

{
"version": "2.0.0",
"php": "8.3.19",
"status": "error",
"data": "No result found"
}