### Install Tianyancha SDK
Source: https://github.com/iamsk/tianyancha/blob/main/README.md
Install the Tianyancha Python SDK using pip.
```shell
pip install tianyancha
```
--------------------------------
### GET m/employments/3.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves recruitment information for a company.
```APIDOC
## GET m/employments/3.0
### Description
Retrieves recruitment information using company name or ID.
### Method
GET
### Endpoint
m/employments/3.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET m/checkInfo/3.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves spot check and inspection information.
```APIDOC
## GET m/checkInfo/3.0
### Description
Retrieves spot check and inspection information using company name or ID.
### Method
GET
### Endpoint
m/checkInfo/3.0
### Parameters
#### Query Parameters
- **keyword** (string) - Required - Company name or ID
```
--------------------------------
### GET m/getAdministrativeLicense/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves administrative license information.
```APIDOC
## GET m/getAdministrativeLicense/2.0
### Description
Retrieves administrative license information using company name or ID.
### Method
GET
### Endpoint
m/getAdministrativeLicense/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### Tianyancha API Response Example
Source: https://github.com/iamsk/tianyancha/blob/main/README.md
Example JSON response structure from the Tianyancha API, detailing company information.
```json
{
"error_code": 0,
"reason": "ok",
"result": {
"items": [
{
"regNumber": "110108002734659",
"regStatus": "在业",
"creditCode": "91110000802100433B",
"estiblishTime": "2001-06-05 00:00:00.0",
"regCapital": "1342128万人民币",
"companyType": 1,
"name": "北京百度网讯科技有限公司",
"id": 22822,
"orgNumber": "802100433",
"type": 1,
"base": "北京",
"legalPersonName": "梁志祥"
},
{
"regNumber": "440106000623068",
"regStatus": "在业",
"creditCode": "91440101675657502F",
"estiblishTime": "2008-05-20 00:00:00.0",
"regCapital": "-",
"companyType": 1,
"name": "北京百度网讯科技有限公司广州分公司",
"id": 139572971,
"orgNumber": "675657502",
"type": 1,
"base": "广东",
"legalPersonName": "沈抖"
},
...
],
"total": 56
}
}
```
--------------------------------
### GET m/getLicenseCreditchina/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves administrative license information from other sources.
```APIDOC
## GET m/getLicenseCreditchina/2.0
### Description
Retrieves administrative license information from other sources using company name or ID.
### Method
GET
### Endpoint
m/getLicenseCreditchina/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET /services/v4/open/judicial
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves judicial assistance information for a company.
```APIDOC
## GET /services/v4/open/judicial
### Description
Retrieves judicial assistance information using company name or ID. Includes executing court, case content, and name of the person subject to enforcement.
### Method
GET
### Endpoint
/services/v4/open/judicial
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET hi/license/creditChina/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves historical administrative license information from other sources.
```APIDOC
## GET hi/license/creditChina/2.0
### Description
Retrieves historical administrative license information from other sources using company name or ID.
### Method
GET
### Endpoint
hi/license/creditChina/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET jr/bankruptcy/detail/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves detailed bankruptcy reorganization information.
```APIDOC
## GET jr/bankruptcy/detail/2.0
### Description
Retrieves detailed bankruptcy reorganization information including applicant and administrator details.
### Method
GET
### Endpoint
jr/bankruptcy/detail/2.0
### Parameters
#### Query Parameters
- **gid** (string) - Required - Company GID
- **uuid** (string) - Required - Record UUID
```
--------------------------------
### GET hi/getHisAdministrativeLicense/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves historical administrative license information.
```APIDOC
## GET hi/getHisAdministrativeLicense/2.0
### Description
Retrieves historical administrative license information using company name or ID.
### Method
GET
### Endpoint
hi/getHisAdministrativeLicense/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET /services/v4/open/investEvent
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves investment dynamics for a specific investment institution.
```APIDOC
## GET /services/v4/open/investEvent
### Description
Retrieves investment dynamics including product names, logos, amounts, and news for a given investment institution.
### Method
GET
### Endpoint
/services/v4/open/investEvent
### Parameters
#### Query Parameters
- **name** (string) - Required - Investment institution name
- **pageSize** (integer) - Optional - Number of items per page
- **pageNum** (integer) - Optional - Page number
```
--------------------------------
### GET jr/bankruptcy/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves bankruptcy reorganization information for a company.
```APIDOC
## GET jr/bankruptcy/2.0
### Description
Retrieves bankruptcy reorganization information using company name or ID.
### Method
GET
### Endpoint
jr/bankruptcy/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### Get Recruitment Information
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves recruitment information for a company. Requires specifying the company name, page number, and page size.
```python
jobs = tyc.m_employments_3_0(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Product Information
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves product information associated with a company. Requires specifying the company name, page number, and page size.
```python
products = tyc.m_appbkInfo(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### GET hi/license/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves historical AIC administrative license information.
```APIDOC
## GET hi/license/2.0
### Description
Retrieves historical AIC administrative license information using company name or ID.
### Method
GET
### Endpoint
hi/license/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET jr/courtRegister/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves case filing information for a company.
```APIDOC
## GET jr/courtRegister/2.0
### Description
Retrieves case filing information using company name or ID. Includes case number, cause of action, filing time, and details of both plaintiff and defendant.
### Method
GET
### Endpoint
jr/courtRegister/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET m/getLicense/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves administrative license information from the AIC.
```APIDOC
## GET m/getLicense/2.0
### Description
Retrieves administrative license information from the AIC using company name or ID.
### Method
GET
### Endpoint
m/getLicense/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET jr/consumptionRestriction/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves consumption restriction orders for a company.
```APIDOC
## GET jr/consumptionRestriction/2.0
### Description
Retrieves consumption restriction orders using company name or ID.
### Method
GET
### Endpoint
jr/consumptionRestriction/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### Making API Requests with Tianyancha SDK
Source: https://github.com/iamsk/tianyancha/blob/main/README.md
Demonstrates two equivalent ways to make API requests: using the generic `get` method with endpoint and parameters, or using a specific method like `ic_changeinfo`.
```python
ret1 = tyc.get('ic/changeinfo/2.0', {'keyword': keyword})
ret2 = tyc.ic_changeinfo(keyword=keyword)
```
--------------------------------
### Get Software Copyrights
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves software copyright registration information for a company. Requires specifying the company name, page number, and page size.
```python
software_copyrights = tyc.ipr_copyReg(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### GET jr/sendAnnouncement/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves service of process announcements for a company.
```APIDOC
## GET jr/sendAnnouncement/2.0
### Description
Retrieves service of process announcement information using company name or ID. Includes announcement name, court name, content, and publication date.
### Method
GET
### Endpoint
jr/sendAnnouncement/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET jr/judicialCase/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves judicial case analysis information.
```APIDOC
## GET jr/judicialCase/2.0
### Description
Retrieves judicial case analysis information using company name or ID.
### Method
GET
### Endpoint
jr/judicialCase/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### Get Bidding Information
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves bidding information for a company. Requires specifying the company name, page number, and page size.
```python
bids = tyc.m_bids(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### GET jr/endCase/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves information about terminated enforcement cases.
```APIDOC
## GET jr/endCase/2.0
### Description
Retrieves information about terminated enforcement cases (including history) using company name or ID.
### Method
GET
### Endpoint
jr/endCase/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### Get Securities Information
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves general securities information for a listed company. Requires specifying the company name.
```python
securities_info = tyc.stock_security(keyword="上市公司名称")
```
--------------------------------
### Get Tianyancha Risk Summary
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves a summary of risk information for a company from Tianyancha.
```python
risk_info = tyc.risk_riskInfo(keyword="公司名称")
```
--------------------------------
### GET jr/zhixinginfo/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves information about persons subject to enforcement.
```APIDOC
## GET jr/zhixinginfo/2.0
### Description
Retrieves information about persons subject to enforcement using company name or ID.
### Method
GET
### Endpoint
jr/zhixinginfo/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET stock/companyInfo/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves comprehensive profile information for listed companies.
```APIDOC
## GET stock/companyInfo/2.0
### Description
Retrieves listed company profile including full name, registration details, industry, and key stakeholders.
### Method
GET
### Endpoint
stock/companyInfo/2.0
### Parameters
#### Query Parameters
- **keyword** (string) - Required - Company name or ID
```
--------------------------------
### GET hi/judicial/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves historical judicial assistance information for a company.
```APIDOC
## GET hi/judicial/2.0
### Description
Retrieves historical judicial assistance information using company name or ID.
### Method
GET
### Endpoint
hi/judicial/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET m/doubleRandomCheck/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves double random check information.
```APIDOC
## GET m/doubleRandomCheck/2.0
### Description
Retrieves double random check information using company name or ID.
### Method
GET
### Endpoint
m/doubleRandomCheck/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### Get Work Copyrights
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves work copyright registration information for a company. Requires specifying the company name, page number, and page size.
```python
work_copyrights = tyc.ipr_copyRegWorks(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Equity Pledge Information
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves equity pledge information for a company. Requires specifying the company name, page number, and page size.
```python
equity_pledge = tyc.mr_equityInfo(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### GET hi/judicial/detail/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves historical judicial assistance details by business ID.
```APIDOC
## GET hi/judicial/detail/2.0
### Description
Retrieves historical judicial assistance details by business ID.
### Method
GET
### Endpoint
hi/judicial/detail/2.0
### Parameters
#### Query Parameters
- **businessId** (string) - Required - The unique business ID
```
--------------------------------
### Get Company Former Names
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves a list of former names for a company. Requires specifying the company name.
```python
former_names = tyc._services_v4_open_historyNames(keyword="公司名称")
```
--------------------------------
### Get Company Annual Reports
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves annual report information for a company. Requires specifying the company name.
```python
annual_reports = tyc.ic_annualreport(keyword="公司名称")
```
--------------------------------
### Get Patents
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves patent information for a company. Requires specifying the company name, page number, and page size.
```python
patents = tyc.ipr_patents_3_0(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Bankruptcy and Reorganization Info
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves information about bankruptcy and reorganization filings for a company. Requires specifying the company name, page number, and page size.
```python
bankruptcy = tyc.jr_bankruptcy(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Chattel Mortgage Information
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves chattel mortgage information for a company. Requires specifying the company name, page number, and page size.
```python
mortgage_info = tyc.mr_mortgageInfo(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### GET hi/zhixing/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves historical information about persons subject to enforcement.
```APIDOC
## GET hi/zhixing/2.0
### Description
Retrieves historical information about persons subject to enforcement using company name or ID.
### Method
GET
### Endpoint
hi/zhixing/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### Perform Direct API Access
Source: https://context7.com/iamsk/tianyancha/llms.txt
Use the generic get method or dynamic method calls to access any API endpoint.
```python
from tianyancha import Tianyancha
tyc = Tianyancha("your-token")
# Direct API call using get method
result1 = tyc.get('ic/changeinfo/2.0', {'keyword': '公司名称'})
# Equivalent dynamic method call
result2 = tyc.ic_changeinfo(keyword='公司名称')
# Both methods return identical results
# Access any API endpoint
custom_result = tyc.get('custom/endpoint/path', {
'param1': 'value1',
'param2': 'value2'
})
```
--------------------------------
### GET cb/development/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves corporate development information including core team, business, financing, and investment events.
```APIDOC
## GET cb/development/2.0
### Description
Retrieves corporate development information including core team, business, financing, and investment events using company name or ID.
### Method
GET
### Endpoint
cb/development/2.0
### Parameters
#### Query Parameters
- **keyword** (string) - Required - Company name or ID
```
--------------------------------
### Get Suppliers
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves supplier information for a company for a specific year. Requires company name, year, page number, and page size.
```python
suppliers = tyc.m_supply(keyword="公司名称", year="2023", pageNum=1, pageSize=20)
```
--------------------------------
### GET /services/v4/open/getJudicialDetail
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves detailed information for a specific judicial assistance record.
```APIDOC
## GET /services/v4/open/getJudicialDetail
### Description
Retrieves detailed judicial assistance information by ID, including types like equity changes, freezes, and releases.
### Method
GET
### Endpoint
/services/v4/open/getJudicialDetail
### Parameters
#### Query Parameters
- **assistanceId** (string) - Required - The unique ID of the judicial assistance record
```
--------------------------------
### Get Historical Business Registration Info
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves historical business registration information for a company. Requires specifying the company name.
```python
historical_ic = tyc.hi_ic(keyword="公司名称")
```
--------------------------------
### Get Balance Sheet
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves the balance sheet for a listed company for a specific year. Requires company name and year.
```python
balance_sheet = tyc.stock_balanceSheet(keyword="上市公司名称", year="2023")
```
--------------------------------
### GET jr/dishonest/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves information about dishonest persons subject to enforcement.
```APIDOC
## GET jr/dishonest/2.0
### Description
Retrieves information about dishonest persons subject to enforcement using company name or ID.
### Method
GET
### Endpoint
jr/dishonest/2.0
### Parameters
#### Query Parameters
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
- **pageSize** (string) - Required - Number of records per page
```
--------------------------------
### Get Listed Company Profile
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves profile information for a listed company. Requires specifying the listed company name.
```python
stock_company_info = tyc.stock_companyInfo(keyword="上市公司名称")
```
--------------------------------
### Get Trademark Details
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves detailed information for a specific trademark using its registration number and international classification.
```python
trademark_detail = tyc.ipr_tm_detail(regNo="注册号", intCls="9")
```
--------------------------------
### Get Shell Company Detection
Source: https://context7.com/iamsk/tianyancha/llms.txt
Performs a check to detect if a company is a shell company. Requires specifying the company name.
```python
shell_company = tyc.shell_company(keyword="公司名称")
```
--------------------------------
### Get Historical Key Personnel
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves historical information about key personnel of a company. Requires specifying the company name.
```python
historical_members = tyc.hi_members(keyword="公司名称")
```
--------------------------------
### GET hi/court/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves historical court announcements for a company using its name or ID.
```APIDOC
## GET hi/court/2.0
### Description
Can retrieve historical court announcements for an enterprise using company name or ID. Includes details like executing court, case content, announcement type, publication date, company name, and parties involved.
### Method
GET
### Endpoint
hi/court/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### GET hi/dishonest/2.0
Source: https://github.com/iamsk/tianyancha/blob/main/API.md
Retrieves historical information about dishonest persons subject to enforcement.
```APIDOC
## GET hi/dishonest/2.0
### Description
Retrieves historical information about dishonest persons subject to enforcement using company name or ID.
### Method
GET
### Endpoint
hi/dishonest/2.0
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - Number of records per page
- **keyword** (string) - Required - Company name or ID
- **pageNum** (string) - Required - Page number
```
--------------------------------
### Get Website ICP Registrations
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves Internet Content Provider (ICP) registration information for a company's websites. Requires specifying the company name, page number, and page size.
```python
icp_records = tyc.ipr_icp_3_0(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Profit Statement
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves the profit statement for a listed company for a specific year. Requires company name and year.
```python
profit_statement = tyc.stock_profit(keyword="上市公司名称", year="2023")
```
--------------------------------
### Get Stock Announcements
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves stock-related announcements for a listed company. Requires specifying the company name, page number, and page size.
```python
stock_announcements = tyc.stock_announcement(keyword="上市公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Directors and Executives
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves information about directors and executives of a listed company. Requires specifying the company name, page number, and page size.
```python
executives = tyc.stock_seniorExecutive(keyword="上市公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Administrative Penalties
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves information on administrative penalties issued to a company. Requires specifying the company name, page number, and page size.
```python
penalties = tyc.mr_punishmentInfo_3_0(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Cash Flow Statement
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves the cash flow statement for a listed company for a specific year. Requires company name and year.
```python
cash_flow = tyc.stock_cashFlow(keyword="上市公司名称", year="2023")
```
--------------------------------
### Get Change Records
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves historical change records for a company. Requires specifying the company name, page number, and page size.
```python
changes = tyc.ic_changeinfo(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Business Anomalies
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves information on business anomalies (经营异常) for a company. Requires specifying the company name, page number, and page size.
```python
anomalies = tyc.mr_abnormal(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Top 10 Shareholders
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves the top 10 shareholders for a listed company as of a specific date. Requires company name, type, and time.
```python
top_shareholders = tyc.stock_shareholder(keyword="上市公司名称", type="1", time="2023-12-31")
```
--------------------------------
### Initialize Client
Source: https://context7.com/iamsk/tianyancha/llms.txt
Create a Tianyancha client instance with your API token for authentication. The client automatically loads all available API methods from the official endpoint list.
```APIDOC
## Initialize Client
Create a Tianyancha client instance with your API token for authentication. The client automatically loads all available API methods from the official endpoint list.
```python
from tianyancha import Tianyancha
import os
# Initialize with API token
token = "your-tianyancha-api-token"
tyc = Tianyancha(token)
# Or load from environment variable
from dotenv import load_dotenv
load_dotenv()
tyc = Tianyancha(os.getenv("TYC_TOKEN"))
# View all available methods
print(tyc.methods)
# ['ic_baseinfo', 'ic_verify', 'ic_staff', 'search', ...]
```
```
--------------------------------
### Initialize and Search with Tianyancha SDK
Source: https://github.com/iamsk/tianyancha/blob/main/README.md
Initialize the Tianyancha client with an API token and search for company information using keyword arguments.
```python
from tianyancha import Tianyancha
token = "TOKEN"
word = "北京百度网讯科技有限公司"
tyc = Tianyancha(token)
ret = tyc.search(word=word) # Limited to use `keyword arguments`
```
--------------------------------
### Get Shareholder Equity Changes
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves historical changes in shareholder equity for a company. Requires specifying the company name, page number, and page size.
```python
equity_changes = tyc.ic_holderChange(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Consumption Restriction Orders
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves information about consumption restriction orders for a given company. Requires specifying the company name, page number, and page size.
```python
consumption_restriction = tyc.jr_consumptionRestriction(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Tax Violations
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves information on tax violations committed by a company. Requires specifying the company name, page number, and page size.
```python
tax_violations = tyc.mr_taxContravention(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get Tax Arrears Announcements
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves announcements related to tax arrears for a company. Requires specifying the company name, page number, and page size.
```python
tax_arrears = tyc.mr_ownTax(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Sync New APIs and Update Documentation
Source: https://github.com/iamsk/tianyancha/blob/main/README.md
Synchronize the latest APIs from the official Tianyancha website and update the API documentation markdown file.
```shell
python tianyancha/sync.py > API.md
```
--------------------------------
### Get Serious Violations
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves information on serious violations recorded for a company. Requires specifying the company name, page number, and page size.
```python
serious_violations = tyc.mr_illegalinfo(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Initialize Tianyancha Client
Source: https://context7.com/iamsk/tianyancha/llms.txt
Instantiate the Tianyancha client with your API token for authentication. The client automatically loads all available API methods. Alternatively, load the token from an environment variable using dotenv.
```python
from tianyancha import Tianyancha
import os
# Initialize with API token
token = "your-tianyancha-api-token"
tyc = Tianyancha(token)
# Or load from environment variable
from dotenv import load_dotenv
load_dotenv()
tyc = Tianyancha(os.getenv("TYC_TOKEN"))
# View all available methods
print(tyc.methods)
# ['ic_baseinfo', 'ic_verify', 'ic_staff', 'search', ...]
```
--------------------------------
### Company Search API
Source: https://context7.com/iamsk/tianyancha/llms.txt
Search for companies by keyword to get basic registration information including company name, registration status, legal representative, and unified social credit code.
```APIDOC
## POST /api/search
### Description
Search for companies by keyword to retrieve basic registration information.
### Method
POST
### Endpoint
/api/search
### Parameters
#### Query Parameters
- **word** (string) - Required - The keyword to search for companies.
- **pageNum** (integer) - Optional - The page number for pagination.
- **pageSize** (integer) - Optional - The number of results per page.
### Request Example
```json
{
"word": "北京百度网讯科技有限公司"
}
```
### Response
#### Success Response (200)
- **error_code** (integer) - Error code, 0 for success.
- **reason** (string) - Reason for the request status.
- **result** (object) - Contains search results.
- **items** (array) - List of company items.
- **regNumber** (string) - Registration number.
- **regStatus** (string) - Registration status.
- **creditCode** (string) - Unified social credit code.
- **estiblishTime** (string) - Establishment time.
- **regCapital** (string) - Registered capital.
- **companyType** (integer) - Company type.
- **name** (string) - Company name.
- **id** (integer) - Company ID.
- **orgNumber** (string) - Organization number.
- **type** (integer) - Type indicator.
- **base** (string) - Location base.
- **legalPersonName** (string) - Legal representative name.
- **total** (integer) - Total number of matching companies.
#### Response Example
```json
{
"error_code": 0,
"reason": "ok",
"result": {
"items": [
{
"regNumber": "110108002734659",
"regStatus": "在业",
"creditCode": "91110000802100433B",
"estiblishTime": "2001-06-05 00:00:00.0",
"regCapital": "1342128万人民币",
"companyType": 1,
"name": "北京百度网讯科技有限公司",
"id": 22822,
"orgNumber": "802100433",
"type": 1,
"base": "北京",
"legalPersonName": "梁志祥"
}
],
"total": 56
}
}
```
```
--------------------------------
### Retrieve Customer and Land Purchase Data
Source: https://context7.com/iamsk/tianyancha/llms.txt
Fetch customer lists and land purchase records using specific keywords and pagination parameters.
```python
customers = tyc.m_customer(keyword="公司名称", year="2023", pageNum=1, pageSize=20)
# Get land purchases
land_purchases = tyc.m_purchaseLand(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Get WeChat Public Accounts
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves information about a company's registered WeChat public accounts. Requires specifying the company name, page number, and page size.
```python
wechat_accounts = tyc.ipr_publicWeChat(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Search Bidding by Criteria
Source: https://context7.com/iamsk/tianyancha/llms.txt
Searches for bidding information based on various criteria such as project name, type, and province. Requires specifying keyword, search type, type, province, page number, and page size.
```python
bid_search = tyc.m_bids_search(
keyword="项目名称",
searchType="1",
type="1", # 1=bid announcement, 2=bid result
province="北京",
pageNum=1,
pageSize=20
)
```
--------------------------------
### Retrieve Company Basic Information
Source: https://context7.com/iamsk/tianyancha/llms.txt
Fetch detailed company information using various `ic_baseinfo` methods. `ic_baseinfoV2` includes contact details, and `ic_baseinfoV3` includes key personnel. The `ic_verify` method checks company details against provided name, legal person, and registration code.
```python
from tianyancha import Tianyancha
tyc = Tianyancha("your-token")
# Get basic company information
company_info = tyc.ic_baseinfo(keyword="北京百度网讯科技有限公司")
# Get basic info with contact details
company_with_contact = tyc.ic_baseinfoV2(keyword="北京百度网讯科技有限公司")
# Get basic info with key personnel
company_with_staff = tyc.ic_baseinfoV3(keyword="北京百度网讯科技有限公司")
# Verify company three elements (name, legal person, registration code)
verification = tyc.ic_verify(
name="北京百度网讯科技有限公司",
legalPersonName="梁志祥",
code="91110000802100433B"
)
```
--------------------------------
### Search Companies by Keyword
Source: https://context7.com/iamsk/tianyancha/llms.txt
Use the search method to find companies by keyword and retrieve basic registration information. The response includes details like registration number, status, legal representative, and unified social credit code.
```python
from tianyancha import Tianyancha
tyc = Tianyancha("your-token")
# Search for companies by keyword
result = tyc.search(word="北京百度网讯科技有限公司")
# Response structure:
# {
# "error_code": 0,
# "reason": "ok",
# "result": {
# "items": [
# {
# "regNumber": "110108002734659",
# "regStatus": "在业",
# "creditCode": "91110000802100433B",
# "estiblishTime": "2001-06-05 00:00:00.0",
# "regCapital": "1342128万人民币",
# "companyType": 1,
# "name": "北京百度网讯科技有限公司",
# "id": 22822,
# "orgNumber": "802100433",
# "type": 1,
# "base": "北京",
# "legalPersonName": "梁志祥"
# }
# ],
# "total": 56
# }
# }
```
--------------------------------
### Explore Corporate Relationships and Graphs
Source: https://context7.com/iamsk/tianyancha/llms.txt
Analyze organizational structures, equity ratios, and shortest paths between entities.
```python
from tianyancha import Tianyancha
tyc = Tianyancha("your-token")
# Get company relationship graph
company_graph = tyc._services_v4_open_oneKey_c(keyword="公司ID")
# Get equity structure diagram
equity_structure = tyc._services_v4_open_equityRatio(keyword="公司ID")
# Get equity penetration diagram
equity_penetration = tyc._services_v3_open_investtree(
keyword="公司ID",
dir="0", # 0=downstream, 1=upstream
flag="0"
)
# Find shortest path between two companies
shortest_path = tyc.rela_shortPath(
nameFrom="公司A名称",
nameTo="公司B名称",
depth=5,
types="1,2,3" # Relationship types
)
# Get person's all company roles
person_roles = tyc._services_v4_open_roles(
name="公司名称",
humanName="人名"
)
# Get person's controlled companies
person_holdings = tyc.human_companyholding(
name="公司名称",
humanName="人名",
pageNum=1,
pageSize=20
)
# Get company's actual control chain
actual_control = tyc._services_v4_open_companyholding(
keyword="公司名称",
pageNum=1,
pageSize=20
)
```
--------------------------------
### Query Shareholder and Investment Information
Source: https://context7.com/iamsk/tianyancha/llms.txt
Access shareholder details, investment relationships, and corporate structure. This includes querying current and historical shareholders, external investments, branch companies, parent companies, ultimate beneficial owners, and suspected actual controllers.
```python
from tianyancha import Tianyancha
tyc = Tianyancha("your-token")
# Get shareholders with pagination
shareholders = tyc.ic_holder(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get historical shareholders
historical_holders = tyc.hi_holder(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get external investments
investments = tyc.ic_inverst(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get branch companies
branches = tyc.ic_branch(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get parent company
parent = tyc.ic_parentCompany(keyword="北京百度网讯科技有限公司")
# Get ultimate beneficial owners
beneficiaries = tyc.ic_humanholding(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get suspected actual controller
actual_controller = tyc.ic_actualControl_3_0(keyword="北京百度网讯科技有限公司")
```
--------------------------------
### Query Trademarks
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieves trademark information for a given company. Requires specifying the company name, page number, and page size.
```python
trademarks = tyc.ipr_tm(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Access Legal and Judicial Information
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieve litigation records, court announcements, and enforcement information. This includes fetching lawsuits, lawsuit details by UUID, court announcements, court session announcements, dishonest persons, and persons subject to enforcement.
```python
from tianyancha import Tianyancha
tyc = Tianyancha("your-token")
# Get legal lawsuits
lawsuits = tyc.jr_lawSuit_3_0(keyword="公司名称", pageNum=1, pageSize=20)
# Get lawsuit details by UUID
lawsuit_detail = tyc.jr_lawSuit_detail(uuid="lawsuit-uuid")
# Get court announcements
court_announcements = tyc.jr_courtAnnouncement(keyword="公司名称", pageNum=1, pageSize=20)
# Get court session announcements
session_announcements = tyc.jr_ktannouncement(keyword="公司名称", pageNum=1, pageSize=20)
# Get dishonest persons (失信人)
dishonest = tyc.jr_dishonest(keyword="公司名称", pageNum=1, pageSize=20)
# Get persons subject to enforcement (被执行人)
enforcement = tyc.jr_zhixinginfo(keyword="公司名称", pageNum=1, pageSize=20)
```
--------------------------------
### Company Basic Information APIs
Source: https://context7.com/iamsk/tianyancha/llms.txt
Retrieve detailed basic information for a company, including registration details, business scope, contact information, and key personnel. Supports different versions for varying data needs.
```APIDOC
## Company Basic Information
Retrieve detailed basic information for a company including registration details, business scope, contact information, and key personnel.
### Method
GET
### Endpoints
- `/api/ic_baseinfo`
- `/api/ic_baseinfoV2`
- `/api/ic_baseinfoV3`
- `/api/ic_verify`
### Parameters
#### Path Parameters
- **keyword** (string) - Required - The company name or identifier to search for.
- **name** (string) - Required (for `ic_verify`) - The company name.
- **legalPersonName** (string) - Required (for `ic_verify`) - The legal representative's name.
- **code** (string) - Required (for `ic_verify`) - The company's registration or credit code.
### Request Example
```python
from tianyancha import Tianyancha
tyc = Tianyancha("your-token")
# Get basic company information
company_info = tyc.ic_baseinfo(keyword="北京百度网讯科技有限公司")
# Get basic info with contact details
company_with_contact = tyc.ic_baseinfoV2(keyword="北京百度网讯科技有限公司")
# Get basic info with key personnel
company_with_staff = tyc.ic_baseinfoV3(keyword="北京百度网讯科技有限公司")
# Verify company three elements (name, legal person, registration code)
verification = tyc.ic_verify(
name="北京百度网讯科技有限公司",
legalPersonName="梁志祥",
code="91110000802100433B"
)
```
### Response
#### Success Response (200)
Responses vary based on the specific endpoint (`ic_baseinfo`, `ic_baseinfoV2`, `ic_baseinfoV3`, `ic_verify`), providing different sets of company details, contact information, personnel, or verification status.
```
--------------------------------
### Shareholder and Investment Information APIs
Source: https://context7.com/iamsk/tianyancha/llms.txt
Query shareholder details, investment relationships, corporate structure, and beneficial ownership information.
```APIDOC
## Shareholder and Investment Information
Query shareholder details, investment relationships, corporate structure information.
### Method
GET
### Endpoints
- `/api/ic_holder`
- `/api/hi_holder`
- `/api/ic_inverst`
- `/api/ic_branch`
- `/api/ic_parentCompany`
- `/api/ic_humanholding`
- `/api/ic_actualControl_3_0`
### Parameters
#### Query Parameters
- **keyword** (string) - Required - The company name or identifier.
- **pageNum** (integer) - Optional - The page number for pagination.
- **pageSize** (integer) - Optional - The number of results per page.
### Request Example
```python
from tianyancha import Tianyancha
tyc = Tianyancha("your-token")
# Get shareholders with pagination
shareholders = tyc.ic_holder(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get historical shareholders
historical_holders = tyc.hi_holder(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get external investments
investments = tyc.ic_inverst(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get branch companies
branches = tyc.ic_branch(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get parent company
parent = tyc.ic_parentCompany(keyword="北京百度网讯科技有限公司")
# Get ultimate beneficial owners
beneficiaries = tyc.ic_humanholding(keyword="北京百度网讯科技有限公司", pageNum=1, pageSize=20)
# Get suspected actual controller
actual_controller = tyc.ic_actualControl_3_0(keyword="北京百度网讯科技有限公司")
```
### Response
#### Success Response (200)
Responses vary based on the specific endpoint, providing details on shareholders, historical shareholders, investments, branches, parent companies, beneficial owners, or actual controllers.
```
--------------------------------
### Legal and Compliance Endpoints
Source: https://context7.com/iamsk/tianyancha/llms.txt
Endpoints for retrieving consumption restrictions, bankruptcy information, and various risk-related data points.
```APIDOC
## GET /jr_consumptionRestriction
### Description
Retrieves consumption restriction orders for a company.
### Parameters
#### Query Parameters
- **keyword** (string) - Required - Company name
- **pageNum** (int) - Optional - Page number
- **pageSize** (int) - Optional - Page size
## GET /mr_punishmentInfo_3_0
### Description
Retrieves administrative penalties for a company.
### Parameters
#### Query Parameters
- **keyword** (string) - Required - Company name
- **pageNum** (int) - Optional - Page number
- **pageSize** (int) - Optional - Page size
```
--------------------------------
### Financial and Stock Market Endpoints
Source: https://context7.com/iamsk/tianyancha/llms.txt
Endpoints for accessing listed company financial statements, stock information, and annual reports.
```APIDOC
## GET /stock_profit
### Description
Retrieves the profit statement for a listed company.
### Parameters
#### Query Parameters
- **keyword** (string) - Required - Listed company name
- **year** (string) - Required - Fiscal year
## GET /stock_balanceSheet
### Description
Retrieves the balance sheet for a listed company.
### Parameters
#### Query Parameters
- **keyword** (string) - Required - Listed company name
- **year** (string) - Required - Fiscal year
```