Bitzsoft.Integrations.EnterpriseInfo.Tianyancha 1.0.1

dotnet add package Bitzsoft.Integrations.EnterpriseInfo.Tianyancha --version 1.0.1
                    
NuGet\Install-Package Bitzsoft.Integrations.EnterpriseInfo.Tianyancha -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bitzsoft.Integrations.EnterpriseInfo.Tianyancha" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.EnterpriseInfo.Tianyancha" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.EnterpriseInfo.Tianyancha" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitzsoft.Integrations.EnterpriseInfo.Tianyancha --version 1.0.1
                    
#r "nuget: Bitzsoft.Integrations.EnterpriseInfo.Tianyancha, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bitzsoft.Integrations.EnterpriseInfo.Tianyancha@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitzsoft.Integrations.EnterpriseInfo.Tianyancha&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.EnterpriseInfo.Tianyancha&version=1.0.1
                    
Install as a Cake Tool

Bitzsoft.Integrations.EnterpriseInfo.Tianyancha

天眼查企业信息查询实现,从天眼查开放平台获取工商、司法、经营等企业全维度数据。

功能特性

  • 完整实现 IEnterpriseInfoProvider 接口:覆盖搜索、工商基本信息、详情、核验、风险、股东、司法案件、实际控制人全部 8 个核心方法
  • 225 个 API 端点:按业务领域分 10 个部分类文件组织,涵盖工商信息、法律、经营、风险、知识产权、历史、人员、股权、发展、增值服务
  • Token 鉴权:通过 Authorization: {token} Header 传递认证令牌
  • IHttpClientFactory 集成:通过 Microsoft.Extensions.Http 管理 HTTP 连接
  • 配置提供器模式:通过 ITianyanchaConfigProvider 抽象配置获取
  • 部分类架构:主 Provider + 10 个按业务领域拆分的部分类文件

安装

.NET CLI

dotnet add package Bitzsoft.Integrations.EnterpriseInfo.Tianyancha

PackageReference

<PackageReference Include="Bitzsoft.Integrations.EnterpriseInfo.Tianyancha" Version="1.0.0" />

配置

appsettings.json

{
  "Tianyancha": {
    "Token": "your-api-token",
    "BaseUrl": "http://open.api.tianyancha.com",
    "HttpClientName": "Tianyancha"
  }
}
配置项 说明 默认值
Token 天眼查开放平台 API Token
BaseUrl API 基础地址 http://open.api.tianyancha.com
HttpClientName IHttpClientFactory 中注册的客户端名称 TianyanchaEnterpriseInfoProvider

注册服务

使用委托配置(推荐)

using Bitzsoft.Integrations.EnterpriseInfo.Tianyancha;

services.AddBitzsoftTianyanchaEnterpriseInfo(options =>
{
    options.Token = "your-api-token";
});

从 IConfiguration 绑定

using Bitzsoft.Integrations.EnterpriseInfo.Tianyancha;

services.AddBitzsoftTianyanchaEnterpriseInfo(configuration, "Tianyancha");

第三方请求日志

内置 Bitzsoft.Integrations.RequestLogging 出站请求记录管道,默认 NullRequestLogStore 不持久化。

// ① 默认:启用记录管道但不持久化(日志丢弃)
services.AddBitzsoftTianyanchaEnterpriseInfo(options => { /* ... */ });

// ② 持久化:宿主注册 IRequestLogStore 实现后,所有出站请求自动落库
services.AddRequestLogging<MyRequestLogStore>(opts =>
{
    opts.MaxInMemoryBodyBytes = 64 * 1024; // 仅控制内存/加密临时文件切换,不截断正文
    opts.SensitiveFields.Add("mySecret");
});
services.AddBitzsoftTianyanchaEnterpriseInfo(options => { /* ... */ });

使用示例

using Bitzsoft.Integrations.EnterpriseInfo;
using Bitzsoft.Integrations.EnterpriseInfo.Tianyancha;

public class TianyanchaEnterpriseService
{
    private readonly TianyanchaEnterpriseInfoProvider _provider;

    public TianyanchaEnterpriseService(TianyanchaEnterpriseInfoProvider provider)
    {
        _provider = provider;
    }

    public async Task DemoAsync()
    {
        // 模糊搜索企业
        var searchResult = await _provider.SearchAsync("阿里巴巴");

        // 获取企业详情(含股东、主要人员、变更记录)
        var detail = await _provider.GetDetailInfoAsync("阿里巴巴(中国)有限公司");

        // 查询司法案件
        var cases = await _provider.GetLegalCasesAsync("阿里巴巴(中国)有限公司");

        // 调用天眼查特有 API(非接口方法,返回原始 JSON)
        var result = await _provider.GetBasicInfoNormalAsync("阿里巴巴");
        var data = result.Data; // JsonElement,按需解析
    }
}

核心类型一览

类型 说明
TianyanchaEnterpriseInfoProvider 天眼查企业信息查询实现(partial class,含 10 个扩展文件)
TianyanchaOptions 天眼查连接配置(Token / BaseUrl / HttpClientName)
ITianyanchaConfigProvider 配置提供器接口
TianyanchaConfigProvider 默认配置提供器(基于 IOptions<TianyanchaOptions>
TianyanchaQueryResult 天眼查通用查询结果(Data / IsSuccess / ErrorCode / TotalCount 等)
TianyanchaApi 天眼查 API 端点定义(Path)
ServiceCollectionExtensions DI 扩展方法 AddBitzsoftTianyanchaEnterpriseInfo

依赖

相关包

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.EnterpriseInfo.Tianyancha:

Package Downloads
Bitzsoft.Integrations.EnterpriseInfo.All

企业信息查询聚合包 — 一键集成企查查、天眼查、启信宝

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 133 8/3/2026
1.0.0 126 8/2/2026
1.0.0-alpha.10 52 7/26/2026
1.0.0-alpha.9 57 7/12/2026
1.0.0-alpha.8 68 7/1/2026
1.0.0-alpha.7 80 6/16/2026
1.0.0-alpha.6 70 6/16/2026
1.0.0-alpha.5 66 6/14/2026
1.0.0-alpha.3 135 6/7/2026