H H5栗子 API Gateway
H5栗子
GET 免费 正常运行

随机用户资料生成

批量生成姓名、邮箱、头像、地址等测试用户数据,适合填充演示环境。

无需鉴权 · 超时 15s
GET https://demo.gsx.hk/wp-json/apihub/v1/call/273
i
免费接口:在线调试与程序调用均须填写/携带站点 Key 后使用,不提供匿名试用。Key 在「我的控制台」获取。

接口说明

– 该接口每次返回随机数据,因此不启用缓存。
– 数据为虚构内容,可直接用于开发测试。

调用统计

0 累计调用
0 今日调用
0% 成功率
0ms 平均耗时

近 30 天调用趋势

10/16 · 010/17 · 010/18 · 010/19 · 010/20 · 010/21 · 010/22 · 010/23 · 010/24 · 010/25 · 010/26 · 010/27 · 010/28 · 010/29 · 010/30 · 010/31 · 011/01 · 011/02 · 011/03 · 011/04 · 011/05 · 011/06 · 011/07 · 011/08 · 011/09 · 011/10 · 011/11 · 011/12 · 011/13 · 011/14 · 0
10/1610/3111/14

请求参数 共 2 个

参数名 必填 默认值 说明
results QUERY · integer — 3 生成条数,建议 1-20
nat QUERY · string — — 国籍代码,如 cn / us / gb
鉴权参数: 在线调试与程序调用均必须携带站点 Key,以 key 参数传入(Query 或 POST 字段均可),例如 ?key=ah_xxxxxxxx。 Key 在「我的控制台」获取,切勿写进前端代码或提交到公开仓库。

调用示例

BASH
curl -X GET "https://demo.gsx.hk/wp-json/apihub/v1/call/273?key=YOUR_SITE_KEY&results=3&nat=YOUR_NAT" \
  -H "Accept: application/json"
PHP
<?php
$url = 'https://demo.gsx.hk/wp-json/apihub/v1/call/273?key=YOUR_SITE_KEY&results=3&nat=YOUR_NAT';

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 20,
    CURLOPT_HTTPHEADER     => ['Accept: application/json'],
]);
$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);
JAVASCRIPT
const params = {"key":"YOUR_SITE_KEY","results":"3","nat":"YOUR_NAT"};
const url = 'https://demo.gsx.hk/wp-json/apihub/v1/call/273?' + new URLSearchParams(params);

const res = await fetch(url, {
  method: 'GET',
  headers: { 'Accept': 'application/json' }
});

const data = await res.json();
console.log(data);
PYTHON
import requests

url = "https://demo.gsx.hk/wp-json/apihub/v1/call/273"
params = {
    "key": "YOUR_SITE_KEY",
    "results": "3",
    "nat": "YOUR_NAT",
}

resp = requests.get(url, params=params, timeout=20)
print(resp.json())

返回示例

网关会统一包装返回结果,业务数据在 data 字段内:

JSON
{
  "ok": true,
  "http_code": 200,
  "cost_ms": 186,
  "credits": 0,
  "currency": "points",
  "cached": false,
  "data": {
  "results": [
    {
      "gender": "female",
      "name": { "title": "Ms", "first": "Lily", "last": "Wang" },
      "email": "lily.wang@example.com",
      "picture": { "thumbnail": "https://randomuser.me/api/portraits/thumb/women/12.jpg" }
    }
  ]
}
}

补充说明

  • 该接口每次返回随机数据,因此不启用缓存。
  • 数据为虚构内容,可直接用于开发测试。

网关错误码

HTTP code 说明
400missing_param缺少必填参数,message 中会给出参数名
401invalid_key / need_login站点 Key 无效或未登录
402no_balance余额或积分不足,请充值后再调用
404api_not_found接口不存在或已下线
429rate_limited超出今日调用频率上限
502upstream_error接口服务不可达或响应异常,本次不扣费

相关接口