# Page query company

Page query company, you can page through the full amount of company data.

**Notice**：Delay Description:
- **The master-slave delay of the database is within 2 seconds, that is, if this interface is called within 2 seconds after the company is directly created, data may not be queried**.
- **In the response body, the fields of full_address_local_script (complete address, local script) and full_address_western_script (complete address, Western script) under registered_office_address_info (registered address detail ) and office_address_info (office address detail) are calculated fields, with a delay of within 5 seconds. When there is a backlog, the delay will be extended**.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/corehr/v1/companies
HTTP Method | GET
Rate Limit | [1000 per minute & 50 per second](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.**<br>Enable any scope from the list | Get company information(corehr:company:read)<br>Obtain core HR information(corehr:corehr:readonly)<br>Update core HR information(corehr:corehr)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
page_token | string | No | Page identifier. It is not filled in the first request, indicating traversal from the beginning; when there will be more groups, the new page_token will be returned at the same time, and the next traversal can use the page_token to get more groups<br>**Example value**: 1231231987
page_size | string | Yes | Page size<br>**Example value**: 100
effective_date | string | No | Effective date, in yyyy-MM-dd format.<br>After this parameter is provided, the API queries company data as of the corresponding point in time on that date, and returns only companies that are effective at that time. Companies that become effective after that date will not be returned.<br>**Example value**: 2022-01-01<br>**Data validation rules**:<br>- Regular expression: `^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))$`

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
items | company\[\] | Company Information Queried
id | string | Entity's unique key inside CoreHR
hiberarchy_common | hiberarchy_common | Hierarchical relationship, see entity for inner field
parent_id | string | parent<br>- This field will not be displayed if the query is for a first-level company
name | i18n\[\] | Name
lang | string | Language
value | string | Content
type | enum | Organization type
enum_name | string | Enumeration value
display | i18n\[\] | Enumeration multilingual display
lang | string | Language
value | string | Content
active | boolean | Enable
effective_time | string | Effective date<br>- Return format: YYYY-MM-DD 00:00:00 (minimum unit to day)<br>- Date range: 1900-01-01 00:00:00～9999-12-31 23:59:59
expiration_time | string | Expiration date<br>- Return format: YYYY-MM-DD 00:00:00 (minimum unit to day)<br>- Date range: 1900-01-01 00:00:00～9999-12-31 23:59:59
code | string | Encoding
description | i18n\[\] | Description
lang | string | Language
value | string | Content
custom_fields | object_field_data\[\] | Custom fields (this function is not supported for the time being, it can be ignored)
field_name | string | Field name
value | string | The field value is the character string after json escape. According to the metadata definition, the field format is different (such as 123, 123.23, "true", [\ "id1\",\ "id2 \"], " 2006-01-02 15:04:05")
type | enum | The nature of the company is obtained through the [Get Field Details](https://open.larkoffice.com/document/server-docs/corehr-v1/basic-infomation/custom_field/get_by_param) query. Request parameters: object_api_name = company; custom_api_name = type.
enum_name | string | Enumeration value
display | i18n\[\] | Enumeration multilingual display
lang | string | Language
value | string | Content
industry_list | enum\[\] | The industry is located, and it is obtained through the [Get Field Details](https://open.larkoffice.com/document/server-docs/corehr-v1/basic-infomation/custom_field/get_by_param) query. Request parameters: object_api_name = company; custom_api_name = industry.
enum_name | string | Enumeration value
display | i18n\[\] | Enumeration multilingual display
lang | string | Language
value | string | Content
legal_representative | i18n\[\] | Legal Representative
lang | string | Language
value | string | Content
post_code | string | Zip Code
tax_payer_id | string | Taxpayer identification number
confidential | boolean | Whether to keep it confidential
sub_type_list | enum\[\] | Company principal type, obtained by [Get Field Details](https://open.larkoffice.com/document/server-docs/corehr-v1/basic-infomation/custom_field/get_by_param) query. Request parameters: object_api_name = company; custom_api_name = subtype.
enum_name | string | Enumeration value
display | i18n\[\] | Enumeration multilingual display
lang | string | Language
value | string | Content
branch_company | boolean | Is it a branch
primary_manager | i18n\[\] | Main person in charge
lang | string | Language
value | string | Content
custom_fields | object_field_data\[\] | custom fields (this function is not supported for the time being, it can be ignored)
field_name | string | Field name
value | string | The field value is the character string after json escape. According to the metadata definition, the field format is different (such as 123, 123.23, "true", [\ "id1\",\ "id2 \"], " 2006-01-02 15:04:05")
currency | currency | Default currency
id | string | Currency ID.<br>- Detailed information can be obtained through the [[Search currency information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-currency/search)
currency_name | i18n\[\] | currency name
lang | string | language
value | string | content
numeric_code | int | Numeric code
currency_alpha_3_code | string | Three-letter code
country_region_id_list | string\[\] | Currency country/region ID list.<br>- Detailed information can be obtained through the [[Query country or region information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region/search)
phone | phone_number_and_area_code | Telephone
area_code | enum | area code
enum_name | string | enumeration value
display | i18n\[\] | enumeration multilingual presentation
lang | string | language
value | string | content
phone_number | string | number
fax | phone_number_and_area_code | fax
area_code | enum | area code
enum_name | string | enumeration value
display | i18n\[\] | enumeration multilingual presentation
lang | string | language
value | string | content
phone_number | string | number
registered_office_address | i18n\[\] | Registered address
lang | string | language
value | string | content
office_address | i18n\[\] | office address
lang | string | language
value | string | content
registered_office_address_info | address | Registered address details
full_address_local_script | string | Full address (local text)
full_address_western_script | string | Full address (Western text)
id | string | Address ID
country_region_id | string | Country/region ID. For the fields filled in by each country/region, please refer to [[Address Filling Rules]](https://bytedance.larkoffice.com/wiki/GoL4wAKAXis3OWku72YcEjTxnKe?sheet=0sMjoP) to inquire. You can pass  [[Query country/region information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region/search) Query to obtain.
region_id | string | Main Administrative Region ID. <br>- Detailed information can be obtained through the [[Query Province/Main Administrative Region Information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region_subdivision/search)
city_id | string | City ID.<br>- Detailed information can be obtained through the [[Search city information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-city/search)
distinct_id | string | District/County ID.<br>- Detailed information can be obtained through the [[Search district or county information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-district/search)
address_line1 | string | Address line 1
address_line2 | string | Address line 2
address_line3 | string | Address line 3
address_line4 | string | Address line 4
address_line5 | string | Address line 5
address_line6 | string | Address line 6
address_line7 | string | Address line 7
address_line8 | string | Address line 8
address_line9 | string | Address line 9
local_address_line1 | string | Address line 1 (non-Latin native scripts)
local_address_line2 | string | Address line 2 (non-Latin native scripts)
local_address_line3 | string | Address line 3 (non-Latin native scripts)
local_address_line4 | string | Address line 4 (non-Latin native scripts)
local_address_line5 | string | Address line 5 (non-Latin native scripts)
local_address_line6 | string | Address line 6 (non-Latin native scripts)
local_address_line7 | string | Address line 7 (non-Latin native scripts)
local_address_line8 | string | Address line 8 (non-Latin native scripts)
local_address_line9 | string | Address line 9 (non-Latin native scripts)
postal_code | string | Postal code
address_type_list | enum\[\] | address type
enum_name | string | enumeration value
display | i18n\[\] | enumerated multilingual display
lang | string | language
value | string | content
is_primary | boolean | main address
is_public | boolean | public address
office_address_info | address | Office Address Details
full_address_local_script | string | Full address (local text)
full_address_western_script | string | Full address (Western text)
id | string | Address ID
country_region_id | string | Country/region ID. For the fields filled in by each country/region, please refer to [[Address Filling Rules]](https://bytedance.larkoffice.com/wiki/GoL4wAKAXis3OWku72YcEjTxnKe?sheet=0sMjoP) to inquire. You can pass  [[Query country/region information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region/search) Query to obtain.
region_id | string | Main Administrative Region ID. <br>- Detailed information can be obtained through the [[Query Province/Main Administrative Region Information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region_subdivision/search)
city_id | string | City ID.<br>- Detailed information can be obtained through the [[Search city information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-city/search)
distinct_id | string | District/County ID.<br>- Detailed information can be obtained through the [[Search district or county information]](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-district/search)
address_line1 | string | Address line 1
address_line2 | string | Address line 2
address_line3 | string | Address line 3
address_line4 | string | Address line 4
address_line5 | string | Address line 5
address_line6 | string | Address line 6
address_line7 | string | Address line 7
address_line8 | string | Address line 8
address_line9 | string | Address line 9
local_address_line1 | string | Address line 1 (non-Latin native scripts)
local_address_line2 | string | Address line 2 (non-Latin native scripts)
local_address_line3 | string | Address line 3 (non-Latin native scripts)
local_address_line4 | string | Address line 4 (non-Latin native scripts)
local_address_line5 | string | Address line 5 (non-Latin native scripts)
local_address_line6 | string | Address line 6 (non-Latin native scripts)
local_address_line7 | string | Address line 7 (non-Latin native scripts)
local_address_line8 | string | Address line 8 (non-Latin native scripts)
local_address_line9 | string | Address line 9 (non-Latin native scripts)
postal_code | string | Postal code
address_type_list | enum\[\] | address type
enum_name | string | enumeration value
display | i18n\[\] | enumerated multilingual display
lang | string | language
value | string | content
is_primary | boolean | main address
is_public | boolean | public address
has_more | boolean | Whether the response body has more parameters
page_token | string | Page identifier, when has_more is true, a new page_token will also be returned. Otherwise, page_token will not be returned

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "items": [
            {
                "id": "4692472714243080020",
                "hiberarchy_common": {
                    "parent_id": "4719168654814483759",
                    "name": [
                        {
                            "lang": "zh-CN",
                            "value": "张三"
                        }
                    ],
                    "type": {
                        "enum_name": "type_1",
                        "display": [
                            {
                                "lang": "zh-CN",
                                "value": "张三"
                            }
                        ]
                    },
                    "active": true,
                    "effective_time": "2020-05-01 00:00:00",
                    "expiration_time": "2020-05-02 00:00:00",
                    "code": "12456",
                    "description": [
                        {
                            "lang": "zh-CN",
                            "value": "张三"
                        }
                    ],
                    "custom_fields": [
                        {
                            "field_name": "name",
                            "value": "Sandy"
                        }
                    ]
                },
                "type": {
                    "enum_name": "type_1",
                    "display": [
                        {
                            "lang": "zh-CN",
                            "value": "张三"
                        }
                    ]
                },
                "industry_list": [
                    {
                        "enum_name": "type_1",
                        "display": [
                            {
                                "lang": "zh-CN",
                                "value": "张三"
                            }
                        ]
                    }
                ],
                "legal_representative": [
                    {
                        "lang": "zh-CN",
                        "value": "张三"
                    }
                ],
                "post_code": "邮编",
                "tax_payer_id": "123456840",
                "confidential": true,
                "sub_type_list": [
                    {
                        "enum_name": "type_1",
                        "display": [
                            {
                                "lang": "zh-CN",
                                "value": "张三"
                            }
                        ]
                    }
                ],
                "branch_company": true,
                "primary_manager": [
                    {
                        "lang": "zh-CN",
                        "value": "张三"
                    }
                ],
                "custom_fields": [
                    {
                        "field_name": "name",
                        "value": "Sandy"
                    }
                ],
                "currency": {
                    "id": "1",
                    "currency_name": [
                        {
                            "lang": "zh-CN",
                            "value": "刘梓新"
                        }
                    ],
                    "numeric_code": 12,
                    "currency_alpha_3_code": "12",
                    "country_region_id_list": [
                        "6862995757234914824"
                    ]
                },
                "phone": {
                    "area_code": {
                        "enum_name": "phone_type",
                        "display": [
                            {
                                "lang": "zh-CN",
                                "value": "刘梓新"
                            }
                        ]
                    },
                    "phone_number": "213213"
                },
                "fax": {
                    "area_code": {
                        "enum_name": "phone_type",
                        "display": [
                            {
                                "lang": "zh-CN",
                                "value": "刘梓新"
                            }
                        ]
                    },
                    "phone_number": "213213"
                },
                "registered_office_address": [
                    {
                        "lang": "zh-CN",
                        "value": "刘梓新"
                    }
                ],
                "office_address": [
                    {
                        "lang": "zh-CN",
                        "value": "刘梓新"
                    }
                ],
                "registered_office_address_info": {
                    "full_address_local_script": "中国北京北京",
                    "full_address_western_script": "Beijing, Beijing, China,",
                    "id": "6989822217869624863",
                    "country_region_id": "6862995757234914824",
                    "region_id": "6863326815667095047",
                    "city_id": "6863333254578046471",
                    "distinct_id": "6863333516579440141",
                    "address_line1": "丹佛测试地址-纽埃时区",
                    "address_line2": "PoewH",
                    "address_line3": "PoewH",
                    "address_line4": "jmwJc",
                    "address_line5": "jmwJc",
                    "address_line6": "jmwJc",
                    "address_line7": "jmwJc",
                    "address_line8": "rafSu",
                    "address_line9": "McPRG",
                    "local_address_line1": "丹佛测试地址-纽埃时区",
                    "local_address_line2": "PoewH",
                    "local_address_line3": "PoewH",
                    "local_address_line4": "jmwJc",
                    "local_address_line5": "jmwJc",
                    "local_address_line6": "jmwJc",
                    "local_address_line7": "jmwJc",
                    "local_address_line8": "rafSu",
                    "local_address_line9": "McPRG",
                    "postal_code": "611530",
                    "address_type_list": [
                        {
                            "enum_name": "phone_type",
                            "display": [
                                {
                                    "lang": "zh-CN",
                                    "value": "刘梓新"
                                }
                            ]
                        }
                    ],
                    "is_primary": true,
                    "is_public": true
                },
                "office_address_info": {
                    "full_address_local_script": "中国北京北京",
                    "full_address_western_script": "Beijing, Beijing, China,",
                    "id": "6989822217869624863",
                    "country_region_id": "6862995757234914824",
                    "region_id": "6863326815667095047",
                    "city_id": "6863333254578046471",
                    "distinct_id": "6863333516579440141",
                    "address_line1": "丹佛测试地址-纽埃时区",
                    "address_line2": "PoewH",
                    "address_line3": "PoewH",
                    "address_line4": "jmwJc",
                    "address_line5": "jmwJc",
                    "address_line6": "jmwJc",
                    "address_line7": "jmwJc",
                    "address_line8": "rafSu",
                    "address_line9": "McPRG",
                    "local_address_line1": "丹佛测试地址-纽埃时区",
                    "local_address_line2": "PoewH",
                    "local_address_line3": "PoewH",
                    "local_address_line4": "jmwJc",
                    "local_address_line5": "jmwJc",
                    "local_address_line6": "jmwJc",
                    "local_address_line7": "jmwJc",
                    "local_address_line8": "rafSu",
                    "local_address_line9": "McPRG",
                    "postal_code": "611530",
                    "address_type_list": [
                        {
                            "enum_name": "phone_type",
                            "display": [
                                {
                                    "lang": "zh-CN",
                                    "value": "刘梓新"
                                }
                            ]
                        }
                    ],
                    "is_primary": true,
                    "is_public": true
                }
            }
        ],
        "has_more": true,
        "page_token": "1234452132"
    }
}
```

