📖 API文档
北京时间: 2026-05-07 17:06:33基础信息
| 基础URL | https://nvgpu.ltzy.top/api |
| 请求方式 | GET / POST |
| 返回格式 | JSON / XML / JSONP |
| 认证 | 无需认证 |
| 总GPU数量 | 118款 |
返回格式参数
| format=json | JSON格式(默认) |
| format=xml | XML格式 |
| format=jsonp | JSONP格式(需callback参数) |
| callback=func | JSONP回调函数名 |
统一API接口
推荐使用:所有功能通过一个接口完成,参数决定返回内容
GET/POST /api 或 /api/gpus
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
q | string | 否 | 搜索关键词(型号、架构、显存类型等) |
id | string | 否 | GPU ID,获取单个GPU详情 |
family | string | 否 | 产品家族筛选:GeForce/GeForce RTX/Quadro/Tesla/TITAN/RTX A系列 |
architecture | string | 否 | 架构筛选:Blackwell/Ada Lovelace/Ampere/Turing等 |
memory_type | string | 否 | 显存类型筛选:GDDR7/GDDR6X/GDDR6/HBM3e等 |
page | int | 否 | 页码,默认1 |
per_page | int | 否 | 每页数量,默认20,最大100 |
format | string | 否 | 返回格式:json/xml/jsonp |
callback | string | 否 | JSONP回调函数名 |
使用示例
搜索GPU
GET /api?q=RTX 4090
POST /api {"q": "RTX 4090"}
获取单个GPU
GET /api?id=nvidia-01000
POST /api {"id": "nvidia-01000"}
按家族筛选
GET /api?family=GeForce RTX&page=1
GET /api?family=Tesla&per_page=50
按架构筛选
GET /api?architecture=Blackwell
GET /api?architecture=Ada Lovelace
按显存类型筛选
GET /api?memory_type=GDDR7
GET /api?memory_type=HBM3e
不同返回格式
GET /api?q=RTX 5090&format=xml
GET /api?q=RTX 5090&format=jsonp&callback=myFunc
返回示例
{
"success": true,
"data": {
"list": [...],
"page": 1,
"per_page": 20,
"total": 118,
"pages": 6
},
"message": "成功",
"error": null,
"time": "2026-05-05 12:00:00"
}
其他API接口
GET /api/search?q={keyword}
搜索GPU,返回匹配结果列表
GET /api/search?q=RTX 5090
GET /api/search?q=Blackwell
GET /api/statistics
获取统计数据,包括架构分布、显存类型分布、年代分布等
GET /api/statistics
GET /api/filter-options
获取筛选选项,包括所有可用的家族、架构、显存类型等
GET /api/filter-options
GET /api/compare?ids={id1,id2,id3,id4}
GPU对比,最多支持4个GPU同时对比
GET /api/compare?ids=nvidia-01000,nvidia-01001,nvidia-01002
GET /api/compare?ids=nvidia-01000,nvidia-01001&format=xml
代码示例
// 搜索GPU
fetch('https://nvgpu.ltzy.top/api?q=RTX 4090')
.then(r => r.json())
.then(d => console.log(d.data.list));
// 获取单个GPU
fetch('https://nvgpu.ltzy.top/api?id=nvidia-01000')
.then(r => r.json())
.then(d => console.log(d.data));
// 按架构筛选
fetch('https://nvgpu.ltzy.top/api?architecture=Blackwell')
.then(r => r.json())
.then(d => console.log(d.data.list));
// POST请求
fetch('https://nvgpu.ltzy.top/api', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({q: 'RTX 5090'})
}).then(r => r.json()).then(console.log);
// GPU对比
fetch('https://nvgpu.ltzy.top/api/compare?ids=nvidia-01000,nvidia-01001')
.then(r => r.json())
.then(d => console.log(d.data));
// JSONP跨域请求
const script = document.createElement('script');
script.src = 'https://nvgpu.ltzy.top/api?q=RTX&format=jsonp&callback=handleData';
document.body.appendChild(script);
function handleData(data) {
console.log(data);
}
import requests
# 搜索GPU
r = requests.get('https://nvgpu.ltzy.top/api', params={'q': 'RTX 4090'})
data = r.json()
for gpu in data['data']['list']:
print(gpu['model'])
# 获取单个GPU
r = requests.get('https://nvgpu.ltzy.top/api', params={'id': 'nvidia-01000'})
print(r.json()['data'])
# 按架构筛选
r = requests.get('https://nvgpu.ltzy.top/api', params={'architecture': 'Blackwell'})
print(r.json()['data']['list'])
# POST请求
r = requests.post('https://nvgpu.ltzy.top/api', json={'q': 'RTX 5090'})
print(r.json())
# GPU对比
r = requests.get('https://nvgpu.ltzy.top/api/compare', params={'ids': 'nvidia-01000,nvidia-01001'})
print(r.json()['data'])
# 获取统计数据
r = requests.get('https://nvgpu.ltzy.top/api/statistics')
stats = r.json()['data']
print(f"总GPU数: {stats['total']}")
print(f"架构数: {len(stats['architectures'])}")
# 搜索GPU
curl "https://nvgpu.ltzy.top/api?q=RTX 4090"
# 获取单个GPU
curl "https://nvgpu.ltzy.top/api?id=nvidia-01000"
# 按架构筛选
curl "https://nvgpu.ltzy.top/api?architecture=Blackwell"
# 按显存类型筛选
curl "https://nvgpu.ltzy.top/api?memory_type=GDDR7"
# POST请求
curl -X POST "https://nvgpu.ltzy.top/api" -H "Content-Type: application/json" -d '{"q":"RTX 5090"}'
# XML格式
curl "https://nvgpu.ltzy.top/api?q=RTX 5090&format=xml"
# JSONP格式
curl "https://nvgpu.ltzy.top/api?q=RTX 5090&format=jsonp&callback=myFunc"
# GPU对比
curl "https://nvgpu.ltzy.top/api/compare?ids=nvidia-01000,nvidia-01001"
# 获取统计数据
curl "https://nvgpu.ltzy.top/api/statistics"
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class NvidiaGPUApi {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
// 搜索GPU
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://nvgpu.ltzy.top/api?q=RTX 4090"))
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
// POST请求
String json = "{\"q\":\"RTX 5090\"}";
HttpRequest postRequest = HttpRequest.newBuilder()
.uri(URI.create("https://nvgpu.ltzy.top/api"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse postResponse = client.send(postRequest, HttpResponse.BodyHandlers.ofString());
System.out.println(postResponse.body());
}
}
GPU数据字段
| 字段 | 类型 | 说明 | 示例 |
|---|---|---|---|
| id | string | 唯一标识 | nvidia-01000 |
| model | string | 型号 | GeForce RTX 5090 |
| full_name | string | 完整名称 | NVIDIA GeForce RTX 5090 |
| family | string | 产品家族 | GeForce RTX |
| series | string | 系列 | GeForce RTX 50 Series |
| architecture | string | 架构 | Blackwell |
| codename | string | 核心代号 | GB202 |
| process | string | 制程工艺 | 3nm |
| cuda_cores | int | CUDA核心数 | 21760 |
| tensor_cores | int | Tensor核心数 | 680 |
| rt_cores | int | RT核心数 | 170 |
| sm_units | int | SM单元数 | 170 |
| base_clock | int | 基础频率(MHz) | 2017 |
| boost_clock | int | 加速频率(MHz) | 2417 |
| memory_type | string | 显存类型 | GDDR7 |
| memory_size | int | 显存容量(GB) | 32 |
| memory_bus | int | 显存位宽 | 512 |
| memory_bandwidth | string | 显存带宽 | 1792 GB/s |
| tdp | int | 功耗(W) | 575 |
| pcie_version | string | PCIe版本 | PCIe 5.0 x16 |
| display_outputs | string | 显示输出 | 3x DP 2.1, 1x HDMI 2.1 |
| nvenc | string | NVENC编解码器 | 3x NVENC (9th Gen) |
| nvdec | string | NVDEC解码器 | 3x NVDEC (6th Gen) |
| dlss_version | string | DLSS版本 | DLSS 4.0 |
| release_date | string | 发布日期 | 2025-01-30 |
| url_slug | string | URL别名 | geforce-rtx-5090 |
错误码说明
| HTTP状态码 | 错误码 | 说明 |
|---|---|---|
| 200 | - | 请求成功 |
| 400 | EMPTY_QUERY | 搜索关键词为空 |
| 400 | MISSING_IDS | 对比接口缺少GPU ID |
| 400 | NEED_2_CPUS | 对比至少需要2个GPU |
| 400 | TOO_MANY_CPUS | 对比最多支持4个GPU |
| 404 | NOT_FOUND | GPU不存在 |
| 404 | INVALID_IDS | 部分GPU ID无效 |
| 500 | INTERNAL_ERROR | 服务器内部错误 |
使用限制与建议
限制说明
- 无需认证,直接调用
- 建议请求频率:≤ 10次/秒
- 单次最多返回100条数据
- 对比功能最多4个GPU
最佳实践
- 使用分页参数减少单次数据量
- 客户端缓存常用数据
- 错误处理要完善
- 建议使用HTTPS