Subsidiaries
Get subsidiary companies.
Returns a paginated list of subsidiary companies associated with the specified parent company.
Endpoint
GET /api/v1/companies/:company_id/subsidiaries
Parameters
| Parameter | Type | In | Description |
|---|---|---|---|
company_id | integer | path | The unique identifier of the company. |
page | integer | body | Page number (default: 1). |
limit | integer | body | Records per page (default: 100). |
Code Examples
Get subsidiaries
import requests
url = 'https://statsnet.co/api/v1/companies/12345/subsidiaries'
headers = {
'Authorization': 'Bearer sk_live_YOUR_KEY',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers).json()
print(response)
const url = 'https://statsnet.co/api/v1/companies/12345/subsidiaries';
const response = await fetch(url, {
headers: {
'Authorization': 'Bearer sk_live_YOUR_KEY',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://statsnet.co/api/v1/companies/12345/subsidiaries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer sk_live_YOUR_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Response
Success response
{
"companies": [
{
"id": 100,
"identifier": "400500600",
"name": "Subsidiary Company LLP",
"name_en": "Subsidiary Company LLP"
}
],
"total": 1,
"pagination_total": 1,
"pagination_offset": 0
}
Error Handling
Error response (403)
{
"status": 403,
"message": "access denied"
}
Payment required (402)
{
"status": 402,
"message": "payment required"
}
Quota exhausted (429)
{
"status": 429,
"message": "quota exhausted"
}