

| Header名称 | 默认值 | 必填 | 说明 |
|---|---|---|---|
X-API-Key | 你的API密钥 | 是 | 逗号APIKEY,用户后台首页获取 |
Content-Type | application/json | 是 | 请求内容类型 |
| 参数名 | 默认值 | 必填 | 说明 |
|---|---|---|---|
api_id | 76 | 是 | API接口ID,系统默认 |
endpoint_id | ep_fc141a3be4e7ef0e515222eb6f6661cb | 是 | 端点ID,系统默认 |
method | POST | 是 | 请求方式,可选值:POST |
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
legalName | string | 是 | 法人姓名,长度 ≤ 20 字符 | |
gender | string | 是 | 法人性别:1=男,0=女 | |
birthday | string | 是 | 法人生日,格式 YYYY-MM-DD | |
wordCount | string | 是 | 公司名字字数,可选 2 / 3 / 4 / 5 | |
city | string | 是 | 公司所在城市,长度 ≤ 40 字符 | |
industry | string | 是 | 所属行业,长度 ≤ 40 字符 | |
num | integer | 否 | 生成方案数量,默认 6,范围 1~10,超出则取默认 6 | |
| 参数名 | 类型 | 说明 | 示例 |
|---|---|---|---|
chinese | string | | |
english | string | | |
pinyin | string | | |
rating | string | | |
meaning | string | | |
features | string | | |
advantage | string | | |
element | string | | |
compatibility | string | |
{
"code": 0,
"message": "success",
"data": {
"request": {
"legalName": "张三",
"gender": "1",
"birthday": "1990-05-18",
"wordCount": "3",
"city": "广州",
"industry": "网络科技",
"num": 6
},
"total": 6,
"names": [
{
"chinese": "鸿图世纪",
"english": "GrandVision",
"pinyin": "Hóng Tú Shì Jì",
"rating": 5,
"meaning": "鸿图:宏大而卓越的发展蓝图;世纪:象征长远的战略眼光和时代影响力。寓意公司拥有宏伟的发展蓝图,立志成为行业世纪标杆。",
"features": ["寓意宏伟", "战略格局", "品牌高度"],
"advantage": "名称气势恢宏,展现公司远大的发展愿景和领导力,易于建立高端信任感,适用于咨询、金融、地产等行业。",
"element": "土(吉)",
"compatibility": "此名称五行属土,与您八字中的金相生(土生金),代表财富积累和事业稳如磐石,基业长青。"
}
// … 其余 5 个方案,结构同上
]
},
"time": "2026-11-10 12:34:56"
}{"code":1001,"message":"参数错误:legalName(法人姓名)不能为空","data":null,"time":"2026-11-10 12:34:56"}| 错误代码 | HTTP状态 | 错误信息 | 详细说明 |
|---|---|---|---|
400 | 400 | legalName 缺失或超长(>20 字符) | 传入合法法人姓名 |
400 | 400 | gender 缺失或取值非法 | 仅支持 "1" 或 "0" |
400 | 400 | birthday 缺失、格式错误或日期非法 | 格式 YYYY-MM-DD,且为有效日期 |
400 | 400 | wordCount 缺失或取值非法 | 仅支持 2/3/4/5 |
400 | 400 | city 缺失或超长(>40 字符) | 传入合法城市名 |
| 400 | industry 缺失或超长(>40 字符) | 传入合法行业名 |
| 错误代码 | HTTP状态 | 错误信息 | 详细说明 |
|---|---|---|---|
401 | HTTP 401 | 认证失败 | 请求头中缺少 X-API-Key 或 API Key 无效 |
400 | HTTP 400 | 参数错误 | 缺少必要参数(api_id、endpoint_id、method)或必填业务参数缺失 |
404 | HTTP 404 | 资源不存在 | API不存在、已下架或端点不存在 |
403 | HTTP 403 | 未开通 | 您尚未开通此API,请先开通 |
405 | HTTP 405 | 方法不允许 | 请求方法不在端点允许列表中 |
402 | HTTP 402 | 积分不足 | 账户积分不足以调用该API |
500 | HTTP 500 | 服务器内部错误 | 系统异常 |
<?php
// 以 公司起名(AI版)(ID:76) 为例,以下为PHP请求示例:
$gateway_url = "https://api.douhao.com/gateway";
// 系统参数
$gatewayData = array(
'api_id' => 76,
'endpoint_id' => 'ep_fc141a3be4e7ef0e515222eb6f6661cb',
'method' => 'POST'
);
// 业务参数(请填写实际值)
$bizParams = array(
'legalName' => '', // 请填写实际值,
'gender' => '', // 请填写实际值,
'birthday' => '', // 请填写实际值,
'wordCount' => '', // 请填写实际值,
'city' => '', // 请填写实际值,
'industry' => '', // 请填写实际值,
'num' => '', // 请填写实际值
);
// 合并请求数据
$requestData = array_merge($gatewayData, $bizParams);
// 请求头(请替换为您的API密钥)
$headers = array(
'Content-Type: application/json',
'X-API-Key: 您的API密钥'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $gateway_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($requestData, JSON_UNESCAPED_UNICODE));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
$error = curl_error($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($error) {
echo "请求错误: " . $error;
} else {
echo "HTTP状态码: " . $httpCode . "\n";
echo "响应数据: " . $response;
}
?>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
import json
# API网关地址
gateway_url = "https://api.douhao.com/gateway"
# 系统参数
gateway_data = {
'api_id': 76,
'endpoint_id': 'ep_fc141a3be4e7ef0e515222eb6f6661cb',
'method': 'POST'
}
# 业务参数(请填写实际值)
biz_params = {
'legalName': '', # 请填写实际值,
'gender': '', # 请填写实际值,
'birthday': '', # 请填写实际值,
'wordCount': '', # 请填写实际值,
'city': '', # 请填写实际值,
'industry': '', # 请填写实际值,
'num': '', # 请填写实际值
}
# 合并请求参数
request_data = {**gateway_data, **biz_params}
# 请求头(请替换为您的API密钥)
headers = {
'Content-Type': 'application/json',
'X-API-Key': '您的API密钥'
}
try:
response = requests.post(
gateway_url,
json=request_data,
headers=headers,
timeout=180,
verify=False # 生产环境建议设为True
)
print(f"HTTP状态码: {response.status_code}")
print("响应数据:")
print(json.dumps(response.json(), indent=2, ensure_ascii=False))
except requests.exceptions.RequestException as e:
print(f"请求错误: {e}")// 以 公司起名(AI版)(ID:76) 为例,以下为Node.js请求示例
// 需要先安装 axios: npm install axios
const axios = require('axios');
// API网关地址
const gatewayUrl = 'https://api.douhao.com/gateway';
// 系统参数
const gatewayData = {
api_id: 76,
endpoint_id: 'ep_fc141a3be4e7ef0e515222eb6f6661cb',
method: 'POST'
};
// 业务参数(请填写实际值)
const bizParams = {
"legalName": "", // 请填写实际值,
"gender": "", // 请填写实际值,
"birthday": "", // 请填写实际值,
"wordCount": "", // 请填写实际值,
"city": "", // 请填写实际值,
"industry": "", // 请填写实际值,
"num": "", // 请填写实际值
};
// 合并请求参数
const requestData = { ...gatewayData, ...bizParams };
// 请求头(请替换为您的API密钥)
const headers = {
'Content-Type': 'application/json',
'X-API-Key': '您的API密钥'
};
async function callApi() {
try {
const response = await axios.post(gatewayUrl, requestData, {
headers: headers,
timeout: 180000
});
console.log('HTTP状态码:', response.status);
console.log('响应数据:');
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
if (error.response) {
console.log('HTTP状态码:', error.response.status);
console.log('错误响应:', error.response.data);
} else {
console.log('请求错误:', error.message);
}
}
}
callApi();// 以 公司起名(AI版)(ID:76) 为例,以下为Java请求示例
// 需要依赖:okhttp 和 gson
import okhttp3.*;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
public class ApiDemo {
private static final String GATEWAY_URL = "https://api.douhao.com/gateway";
private static final Gson gson = new GsonBuilder().setPrettyPrinting().create();
public static void main(String[] args) throws Exception {
// 系统参数
Map<String, Object> gatewayData = new HashMap<>();
gatewayData.put("api_id", 76);
gatewayData.put("endpoint_id", "ep_fc141a3be4e7ef0e515222eb6f6661cb");
gatewayData.put("method", "POST");
// 业务参数(请填写实际值)
Map<String, Object> bizParams = new HashMap<>();
map.put("legalName", ""); // 请填写实际值
map.put("gender", ""); // 请填写实际值
map.put("birthday", ""); // 请填写实际值
map.put("wordCount", ""); // 请填写实际值
map.put("city", ""); // 请填写实际值
map.put("industry", ""); // 请填写实际值
map.put("num", ""); // 请填写实际值
// 合并请求数据
Map<String, Object> requestData = new HashMap<>(gatewayData);
requestData.putAll(bizParams);
// 请求体JSON
String jsonBody = gson.toJson(requestData);
// 创建请求
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(180, TimeUnit.SECONDS)
.readTimeout(180, TimeUnit.SECONDS)
.build();
RequestBody body = RequestBody.create(
jsonBody,
MediaType.parse("application/json; charset=utf-8")
);
Request request = new Request.Builder()
.url(GATEWAY_URL)
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "您的API密钥") // 请替换为您的API密钥
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println("HTTP状态码: " + response.code());
String responseBody = response.body().string();
System.out.println("响应数据:");
System.out.println(gson.toJson(gson.fromJson(responseBody, Object.class)));
}
}
}# 以 公司起名(AI版)(ID:76) 为例,以下为cURL请求示例
curl -X POST "https://api.douhao.com/gateway" \
-H "Content-Type: application/json" \
-H "X-API-Key: 您的API密钥" \
-d '{
"api_id": 76,
"endpoint_id": "ep_fc141a3be4e7ef0e515222eb6f6661cb",
"method": "POST",
"legalName": "" // 请填写实际值,
"gender": "" // 请填写实际值,
"birthday": "" // 请填写实际值,
"wordCount": "" // 请填写实际值,
"city": "" // 请填写实际值,
"industry": "" // 请填写实际值,
"num": "" // 请填写实际值
}'
浙公网安备 33059102000262号