根据全名或注册号精确查询
请求Header:
| 名称 | 值 | |
|---|---|---|
| Content-Type | application/x-www-form-urlencoded |
请求参数说明:
| 名称 | 必填 | 类型 | 说明 | |
|---|---|---|---|---|
| key | 是 | string | 应该APPKEY | |
| keyword | 是 | string | 企业全名/注册号/统一社会信用代码 |
请求代码示例:
curl -k -i "https://japi.juhe.cn/enterprise/getDetailByName?key=key&keyword=xxx"
<?php
/**
* 1162-根据全名或注册号精确查询 - 代码参考(根据实际业务情况修改)
*/
// 基本参数配置
$apiUrl = "https://japi.juhe.cn/enterprise/getDetailByName"; // 接口请求URL
$method = "GET"; // 接口请求方式
$headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
$apiKey = "您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
$requestParams = [
'key' => $apiKey,
'keyword'=> 'xxx',
];
$requestParamsStr = http_build_query($requestParams);
// 发起接口网络请求
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $apiUrl . '?' . $requestParamsStr);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$" . $apiUrl, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$response = curl_exec($curl);
$httpInfo = curl_getinfo($curl);
curl_close($curl);
// 解析响应结果
$responseResult = json_decode($response, true);
if ($responseResult) {
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
var_dump($responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
// var_dump($httpInfo);
var_dump("请求异常");
}
import requests
# 1162-根据全名或注册号精确查询 - 代码参考(根据实际业务情况修改)
# 基本参数配置
apiUrl = 'https://japi.juhe.cn/enterprise/getDetailByName' # 接口请求URL
apiKey = '您申请的调用APIkey' # 在个人中心->我的数据,接口名称上方查看
# 接口请求入参配置
requestParams = {
'key': apiKey,
'keyword': 'xxx',
}
# 发起接口网络请求
response = requests.get(apiUrl, params=requestParams)
# 解析响应结果
if response.status_code == 200:
responseResult = response.json()
# 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
print(responseResult)
else:
# 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
print('请求异常')
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
// 基本参数配置
apiUrl := "https://japi.juhe.cn/enterprise/getDetailByName"
apiKey := "您申请的调用APIkey"
// 接口请求入参配置
requestParams := url.Values{}
requestParams.Set("key", apiKey)
requestParams.Set("keyword", "xxx")
// 发起接口网络请求
resp, err := http.Get(apiUrl + "?" + requestParams.Encode())
if err != nil {
fmt.Println("网络请求异常:", err)
return
}
defer resp.Body.Close()
var responseResult map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&responseResult)
if err != nil {
fmt.Println("解析响应结果异常:", err)
return
}
fmt.Println(responseResult)
}
using System;
using System.Net;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
namespace Common_API_Test.Test_Demo
{
class Csharp_get
{
static void Main(string[] args)
{
string url = "https://japi.juhe.cn/enterprise/getDetailByName";
string apiKey = "您申请的调用APIkey";
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("key", apiKey);
data.Add( "keyword", "xxx");
using (WebClient client = new WebClient())
{
string fullUrl = url + "?" + string.Join("&", data.Select(x => x.Key + "=" + x.Value));
try
{
string responseContent = client.DownloadString(fullUrl);
dynamic responseData = JsonConvert.DeserializeObject(responseContent);
if (responseData != null)
{
Console.WriteLine("Return Code: " + responseData["error_code"]);
Console.WriteLine("Return Message: " + responseData["reason"]);
}
else
{
Console.WriteLine("json解析异常!");
}
}
catch (Exception)
{
Console.WriteLine("请检查其它错误");
}
}
}
}
}
const axios = require('axios'); // npm install axios
// 基本参数配置
const apiUrl = 'https://japi.juhe.cn/enterprise/getDetailByName'; // 接口请求URL
const apiKey = '您申请的调用APIkey'; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
const requestParams = {
key: apiKey,
keyword: 'xxx',
};
// 发起接口网络请求
axios.get(apiUrl, {params: requestParams})
.then(response => {
// 解析响应结果
if (response.status === 200) {
const responseResult = response.data;
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
console.log(responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
console.log('请求异常');
}
})
.catch(error => {
// 网络请求失败,可以根据实际情况进行处理
console.log('网络请求失败:', error);
});
package cn.juhe.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class JavaGet {
public static void main(String[] args) throws Exception {
String apiKey = "你申请的key";
String apiUrl = "https://japi.juhe.cn/enterprise/getDetailByName";
HashMap<String, String> map = new HashMap<>();
map.put("key", apiKey);
map.put("keyword", "xxx");
URL url = new URL(String.format("%s?%s", apiUrl, params(map)));
BufferedReader in = new BufferedReader(new InputStreamReader((url.openConnection()).getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response);
}
public static String params(Map<String, String> map) {
return map.entrySet().stream()
.map(entry -> {
try {
return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString());
} catch (Exception e) {
e.printStackTrace();
return entry.getKey() + "=" + entry.getValue();
}
})
.collect(Collectors.joining("&"));
}
}
// 基本参数配置
NSString *apiUrl = @"https://japi.juhe.cn/enterprise/getDetailByName"; // 接口请求URL
NSString *apiKey = @"您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
NSDictionary *requestParams = @{
@"key": apiKey,
@"keyword": @"xxx",
};
// 发起接口网络请求
NSURLComponents *components = [NSURLComponents componentsWithString:apiUrl];
NSMutableArray *queryItems = [NSMutableArray array];
[requestParams enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
[queryItems addObject:[NSURLQueryItem queryItemWithName:key value:value]];
}];
components.queryItems = queryItems;
NSURL *url = components.URL;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
// 网络请求异常处理
NSLog(@"请求异常");
} else {
NSError *jsonError;
NSDictionary *responseResult = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
if (!jsonError) {
// 网络请求成功处理
// NSLog(@"%@", [responseResult objectForKey:@"error_code"]);
NSLog(@"%@", responseResult);
} else {
// 解析结果异常处理
NSLog(@"解析结果异常");
}
}
}];
[task resume];
返回参数说明:
| 名称 | 类型 | 说明 | |
|---|---|---|---|
| name | string | 公司名称 | |
| econ_kind | string | 企业类型 | |
| addresses | string | 地址 | |
| reg_no | string | 企业注册号 | |
| scope | string | 经营范围 | |
| term_start | string | 营业开始日期 | |
| term_end | string | 营业结束日期 | |
| belong_org | string | 所属工商局 | |
| oper_name | string | 法人 | |
| start_date | string | 成立日期 | |
| end_date | string | 注销日期 | |
| status | string | 在业 | |
| org_no | string | 组织机构号 | |
| credit_no | string | 统一社会信用代码 | |
| province | string | 省份缩写 | |
| employees.job_title | string | 主要人员职位 | |
| employees.name | string | 主要人员姓名 | |
| brances.name | string | 分支机构名称 | |
| changerecords.change_item | string | 变更项目 | |
| changerecords.change_date | string | 变更日期 | |
| changerecords.before_content | string | 变更前内容 | |
| changerecords.after_content | string | 变更后内容 | |
| partners.name | string | 股东姓名 | |
| partners.stock_type | string | 股东类型 | |
| partners.identify_type | string | 证照/证件类型(返回固定"非公示项") | |
| partners.identify_no | string | 证照/证件号码(非公示项,返回"-") | |
| partners.should_capi_items.shoud_capi | string | 认缴出资额 | |
| partners.should_capi_items.invest_type | string | 出资方式 | |
| partners.should_capi_items.should_capi_date | string | 出资时间 | |
| partners.real_capi_items.real_capi | string | 实缴出资额 | |
| partners.real_capi_items.invest_type | string | 出资方式 | |
| partners.real_capi_items.real_capi_date | string | 实缴时间 | |
| abnormal_items.in_reason | string | 经营异常列入原因 | |
| abnormal_items.in_date | string | 列入日期 | |
| abnormal_items.out_reason | string | 移出原因 | |
| abnormal_items.out_date | string | 移出时间 | |
| regist_capi_new | string | 注册资本(新),默认万元 | |
| currency_unit | string | 货币单位 |
JSON返回示例:JSON在线格式化工具 >
{
"error_code":0,
"reason":"操作成功",
"result":{
"sign":"95964acf21ee4503be0deb37b283f21c",
"data":{
"name":"天聚地合(苏州)数据股份有限公司北京分公司",
"econ_kind":"股份有限公司分公司(非上市、自然人投资或控股)",
"regist_capi":"-",
"scope":"网络技术服务;会议服务;设计、制作、代理、发布广告;承办展览展示活动。(企业依法自主选择经营项目,开展经营活动;依法须经批准的项目,经相关部门批准后依批准的内容开展经营活动;不得从事本市产业政策禁止和限制类项目的经营活动。)",
"term_start":"2016-05-10",
"term_end":"-",
"belong_org":"海淀分局",
"oper_name":"左磊",
"check_date":"2017-11-29",
"start_date":"2016-05-10",
"end_date":"-",
"status":"在业",
"org_no":"MA005BCA2",
"credit_no":"91110108MA005BCA25",
"province":"BJ",
"id":"2d79de67-481c-402f-9eac-2a6e6a4afc5a",
"abnormal_items":[
],
"reg_no":"-",
"address":"北京市海淀区永澄北路2号院1号楼A座四层405-200",
"employees":[
{
"name":"左磊",
"job_title":"负责人"
}
],
"branches":[
],
"changerecords":[
{
"change_item":"企业名称",
"change_date":"2017-11-29",
"before_content":"苏州新科兰德科技有限公司北京分公司",
"after_content":"天聚地合(苏州)数据股份有限公司北京分公司"
}
],
"partners":[
],
"regist_capi_new":"-",
"currency_unit":"-"
}
}
}
服务级错误码参照(error_code):
| 错误码 | 说明 | |
|---|---|---|
| 231901 | 查询无结果 | |
| 231907 | 查询错误,请联系技术人员 | |
| 231908 | 参数名错误或参数为空 | |
| 231909 | 接口查询异常,请联系技术人员 |
系统级错误码参照:
| 错误码 | 说明 | 旧版本(resultcode) | |
|---|---|---|---|
| 10001 | 错误的请求KEY | 101 | |
| 10002 | 该KEY无请求权限 | 102 | |
| 10003 | KEY过期 | 103 | |
| 10004 | 错误的OPENID | 104 | |
| 10005 | 应用未审核超时,请提交认证 | 105 | |
| 10007 | 未知的请求源 | 107 | |
| 10008 | 被禁止的IP | 108 | |
| 10009 | 被禁止的KEY | 109 | |
| 10011 | 当前IP请求超过限制 | 111 | |
| 10012 | 请求超过次数限制 | 112 | |
| 10013 | 测试KEY超过请求限制 | 113 | |
| 10014 | 系统内部异常(调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失) | 114 | |
| 10020 | 接口维护 | 120 | |
| 10021 | 接口停用 | 121 |
错误码格式说明(示例:200201):
| 2 | 002 | 01 | |
|---|---|---|---|
| 服务级错误(1为系统级错误) | 服务模块代码(即数据ID) | 具体错误代码 |
接口文档下载
苏公网安备 32059002001776号