接口概述
一句话说明
enterprise.report 把企业历年公示的年报一次拉全, 适合做经营趋势判断:收入、负债、净资产、利润、纳税总额逐年对比, 再叠加从业人数变化,能比较直观地看出企业是在扩张还是收缩。 一次调用返回全部年度而非单年,做趋势分析不必多次付费。
| 请求地址 | https://api.xujian.tech/openapi/enterprise/report |
|---|---|
| 请求方式 | GET(keyword 放 Query String) |
| 鉴权方式 | 请求头 X-API-Key |
| 接口编码 | enterprise.report |
| 收费类型 | PER_CALL(按次计费,0.3000 元/次) |
| 计费特殊规则 | 查得计费:关键词非法、上游不可用、查不到任何年报时返回失败且不扣费 |
| 响应格式 | JSON,Content-Type: application/json;charset=UTF-8 |
| 是否需要授权 | 否(无需授权,API Key 有效且余额充足即可调用) |
| 关键词长度 | 2 ~ 50 个字符 |
| 返回内容 | 多年度年报数组(按年份倒序) |
快速开始
curl -s -G "https://api.xujian.tech/openapi/enterprise/report" \
--data-urlencode "keyword=重庆可乐家装饰工程有限公司" \
-H "X-API-Key: 你的APIKey" | python -m json.tool
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
X-API-Key | String | 是 | 开发者 API Key |
| 参数名 | 类型 | 必填 | 示例 | 说明 |
|---|---|---|---|---|
keyword | String | 是 | 91500113MAABRA7D0H | 企业全称 / 注册号 / 统一社会信用代码,长度 2 ~ 50 个字符;为空或超长返回失败且不计费 |
响应参数
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | String | 本次查询关键词 |
total | int | 年报条数(年度数) |
list | Array | 年报数组,按年度倒序;字段见下表 |
apiCode | String | 接口编码 enterprise.report |
apiName | String | 接口名称 |
chargeType | String | 计费类型 |
balance | BigDecimal | 调用完成后(已扣费)的账户余额(元) |
costMs | Long | 本次调用耗时(毫秒) |
list[] 年报字段
| 字段 | 类型 | 说明 |
|---|---|---|
reportYear | String | 年报所属年份 |
reportDate | String | 年报公示日期 |
reportName | String | 报告名称 |
name | String | 企业全称 |
regNo | String | 工商注册号 |
creditNo | String | 统一社会信用代码 |
telephone | String | 联系电话 |
email | String | 邮箱 |
address | String | 企业地址 |
operName | String | 法定代表人 |
zipCode | String | 邮政编码 |
regCapi | String | 注册资本 |
fareScope | String | 经营范围 |
ifInvest | String | 是否有对外投资 |
ifWebsite | String | 是否有网站 |
ifEquity | String | 是否有股权变更 |
ifExternalGuarantee | String | 是否有对外担保 |
colleguesNum | String | 从业人数 |
femaleColleguesNum | String | 女性从业人数 |
enterpriseHoldingSituation | String | 企业控股情况 |
supEname | String | 上级企业名称 |
supCreditNo | String | 上级企业统一社会信用代码 |
status | String | 企业状态(清洗后) |
originStatus | String | 原始状态 |
saleIncome | String | 销售收入 / 营业总收入 |
servFareIncome | String | 服务收入 |
debitAmount | String | 负债总额 |
netAmount | String | 净资产 / 资产总额 |
pracPersonNum | String | 从业人数(另一口径) |
profitReta | String | 销售利润率 |
profitTotal | String | 利润总额 |
taxTotal | String | 纳税总额 |
totalEquity | String | 所有者权益合计 |
partners | Array | 年报股东明细:stockName / stockType / stockPercent / identifyType / identifyNo / shouldCapiItems / realCapiItems |
websites | Array | 网址明细(原样透传) |
stockChanges | Array | 股权变更明细(原样透传) |
investItems | Array | 对外投资明细(原样透传) |
guaranteeItems | Array | 对外担保明细(原样透传) |
响应示例
成功(code = 0)
{
"code": 0,
"msg": "success",
"data": {
"keyword": "91500113MAABRA7D0H",
"total": 2,
"list": [
{
"reportYear": "2024",
"reportDate": "2025-03-18",
"reportName": "2024年度报告",
"name": "重庆可乐家装饰工程有限公司",
"regNo": "500113014353471",
"creditNo": "91500113MAABRA7D0H",
"telephone": "138****8888",
"email": "-",
"address": "重庆市巴南区龙洲湾街道龙洲大道255号17-1",
"operName": "李伦智",
"zipCode": "400055",
"regCapi": "100 万人民币",
"fareScope": "住宅室内装饰装修",
"ifInvest": "-",
"ifWebsite": "-",
"ifEquity": "-",
"ifExternalGuarantee": "-",
"colleguesNum": "5",
"femaleColleguesNum": "2",
"enterpriseHoldingSituation": "-",
"supEname": "-",
"supCreditNo": "-",
"status": "存续",
"originStatus": "存续",
"saleIncome": "320.000000万元",
"servFareIncome": "-",
"debitAmount": "85.000000万元",
"netAmount": "160.000000万元",
"pracPersonNum": "5",
"profitReta": "-",
"profitTotal": "28.000000万元",
"taxTotal": "6.400000万元",
"totalEquity": "160.000000万元",
"partners": [
{
"stockName": "李伦智",
"stockType": "自然人股东",
"stockPercent": "100%",
"identifyType": "-",
"identifyNo": "-",
"shouldCapiItems": [
{"date": "2021-06-02", "capi": "100 万人民币", "type": "货币"}
],
"realCapiItems": []
}
],
"websites": [],
"stockChanges": [],
"investItems": [],
"guaranteeItems": []
}
],
"apiCode": "enterprise.report",
"apiName": "企业工商年报查询",
"chargeType": "PER_CALL",
"balance": 99.7000,
"costMs": 920
}
}
失败(查不到年报)—— 不收费
{
"code": 500,
"msg": "未查询到该企业的工商年报,请核对企业名称或统一社会信用代码后重试;本次调用不计费",
"data": null
}
错误码与常见失败原因
| code | msg(示例) | 处理建议 |
|---|---|---|
| 0 | success | 调用成功 |
| 500 | 缺少请求头 X-API-Key | 补充 X-API-Key |
| 500 | API Key 无效 / API Key 已停用 | 检查 Key 或重新启用 |
| 500 | 客户不存在或已停用 | 联系平台(可联系微信xujian_cq) |
| 500 | 余额不足,请先充值。可联系微信xujian_cq | 充值后重试,余额不足不扣费 |
| 500 | keyword 不能为空 | 补充 keyword;不计费 |
| 500 | keyword 至少需要 2 个字符(建议使用企业全称或统一社会信用代码) | 换更准确的关键词;不计费 |
| 500 | keyword 长度不能超过 50 个字符 | 缩短关键词;不计费 |
| 500 | 未查询到该企业的工商年报…… | 核对名称 / 信用代码;不计费 |
| 500 | 数据服务暂时不可用(请求上游超时或网络异常),本次调用不计费 | 稍后重试;不计费 |
多语言代码示例
Java(Hutool)
String body = HttpRequest.get("https://api.xujian.tech/openapi/enterprise/report")
.form("keyword", "91500113MAABRA7D0H")
.header("X-API-Key", apiKey)
.timeout(15000)
.execute()
.body();
JSONObject json = JSONUtil.parseObj(body);
if (json.getInt("code") != 0) {
System.out.println("查询失败(不收费):" + json.getStr("msg"));
return;
}
JSONArray list = json.getJSONObject("data").getJSONArray("list");
for (int i = 0; i < list.size(); i++) {
JSONObject r = list.getJSONObject(i);
System.out.printf("%s 年:收入 %s,负债 %s,纳税 %s,从业 %s 人%n",
r.getStr("reportYear"), r.getStr("saleIncome"),
r.getStr("debitAmount"), r.getStr("taxTotal"), r.getStr("colleguesNum"));
}
Python
import requests
def query_report(api_key: str, keyword: str):
"""查询多年度工商年报;查不到返回空列表且不扣费"""
resp = requests.get(
"https://api.xujian.tech/openapi/enterprise/report",
params={"keyword": keyword},
headers={"X-API-Key": api_key},
timeout=20,
)
result = resp.json()
if result.get("code") != 0:
print("查询失败(不收费):", result.get("msg"))
return []
return result["data"]["list"]
if __name__ == "__main__":
for r in query_report("你的APIKey", "91500113MAABRA7D0H"):
print(r["reportYear"], r["saleIncome"], r["debitAmount"], r["taxTotal"])
JavaScript(浏览器 / Node 18+)
const resp = await fetch(
"https://api.xujian.tech/openapi/enterprise/report?keyword=" + encodeURIComponent("91500113MAABRA7D0H"),
{ headers: { "X-API-Key": API_KEY } }
);
const { code, msg, data } = await resp.json();
if (code === 0) {
data.list.forEach((r) => console.log(r.reportYear, r.saleIncome, r.taxTotal, r.colleguesNum));
} else {
console.warn("查询失败(不收费):", msg);
}
常见问题(FAQ)
enterprise.report 接口怎么收费?
enterprise.report 的收费类型为 PER_CALL(按次计费),当前单价 0.3000 元/次,调用前校验余额,余额不足返回「余额不足,请先充值。可联系微信xujian_cq」且不扣费;充值可可联系微信xujian_cq。扣费金额、交易前后余额均记录于交易流水中。
为什么有些年份显示「-」或为空?
企业在做年报公示时可以选择「不公示」部分金额字段,工商公示系统原文即为「-」。
接口如实返回,代码里请先判断是否为空再做数值转换,避免出现
NumberFormatException 这类解析异常。
返回了多少年的年报?
以数据源实际公示的年度为准,通常覆盖企业成立至今的多个年度并按年份倒序返回,
具体条数见响应体 total 字段。一次调用即返回全部年度,不需要按年分别查询。
金额字段怎么转数字?
金额字段形如「320.000000万元」,带单位后缀。解析时去掉非数字部分再转
BigDecimal / Decimal,并留意单位一般为万元。
可以直接拿纳税总额做信贷核验吗?
年报数据是企业自主公示口径,未经审计,建议作为辅助参考而非唯一依据。 重要授信决策请结合审计报告、发票数据与银行流水交叉验证。
为什么没有拿到某一年的数据?
部分年份企业未按时公示(这本身就是风控信号,可配合
enterprise.abnormal 经营异常查询一起看)。
调用需要签名或加密吗?
不需要。XAPI 的接口仅校验请求头 X-API-Key,不做签名、时间戳或加密。