• API 功能

    • 按指数类别和基金类型查看指数基金;
    • 提供基金代码、名称与跟踪标的;
    • 提供跟踪方式、指数类别与基金类型;
    • 提供净值日期、单位净值与日增长率;
    • 覆盖近 1 周至近 1 年的多档收益率;
    • 提供近 2 年、近 3 年与今年以来收益率;
    • 提供成立以来收益率;
    • 支持按代码、净值、日期、费率或收益率排序;
    • 提供费率与最低购买金额;
    • 适合指数基金筛选、对比与研究;
    • 默认最大 QPS:5,可在开发者中心自助升级,月付年付订单接口调用次数不限。
    • 接口调用状态与状态监控
  • API 文档

    接口地址: https://api.gugudata.com/fund/basic/index

    返回格式: application/json; charset=utf-8

    请求方式: GET

    请求协议: HTTPS

    请求示例: https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc

    数据预览: https://www.gugudata.com/preview/fundbasicindex

    接口测试:  https://api.gugudata.com/fund/basic/index/demo

    OpenAPI: https://www.gugudata.com/openapi/gugudata.openapi.3.1.json

    请求参数(GET 请求方式可参见下方示例代码)

    参数名 参数类型 是否必须 默认值 备注
    appkey string YOUR_APPKEY 必填。接口调用凭证,请在咕咕数据控制台获取;用于身份鉴权和套餐额度校验,不要在公开页面或客户端日志中暴露
    index string 沪深指数 必填。指数类别,仅支持:全部、沪深指数、行业主题、大盘指数、中盘指数、小盘指数、股票指数、债券指数;必须传完整中文名称
    indicator string 被动指数型 必填。指数基金类型,仅支持:全部、被动指数型、增强指数型;必须传完整中文名称
    pageIndex integer 1 可选。页码,从 1 开始;仅在 pageSize 大于 0 时生效
    pageSize integer 0 可选。每页数量为 1 至 500;传 0 时返回全部数据。
    sortBy string source 可选。排序字段,支持 source、fundCode、timeKey、netAssetValue、fee 及各区间收益字段
    sortOrder string asc 可选。排序方向,仅支持 asc 或 desc;相同值按基金代码稳定排序

    返回参数

    参数名 参数类型 备注
    DataStatus.RequestParameter string 服务端识别并记录的本次业务查询参数摘要,不包含 APPKEY 等鉴权信息
    DataStatus.StatusCode integer 业务状态码;100 表示正常返回,其他值需结合 StatusDescription 判断
    DataStatus.StatusDescription string 业务状态说明;成功时说明请求结果,失败时说明参数、权限或数据依赖问题
    DataStatus.ResponseDateTime string 服务端生成响应的北京时间,格式为 yyyy-MM-dd HH:mm:ss.fff
    DataStatus.DataTotalCount integer 当前查询条件下的数据总量;分页接口通常表示全部匹配数量,而不是当前页条数
    DataStatus.DataFetchedAt string 数据最近更新时间,使用 ISO 8601 格式。
    DataStatus.LatestNetValueDate string 当前筛选结果中最新的净值日期,格式为 yyyy-MM-dd
    DataStatus.EarliestNetValueDate string 当前筛选结果中最早的净值日期,格式为 yyyy-MM-dd
    DataStatus.IsFallbackData boolean 是否使用近期可用数据。
    DataStatus.InvalidRowCount integer 本次结果未采用的记录数量。
    DataStatus.DuplicateRowCount integer 本次结果中合并的重复基金数量。
    DataStatus.Warnings array 数据状态提示;无提示时为空数组。
    Data.FundCode string 指数基金的 6 位代码,保留前导零
    Data.FundName string 指数基金名称,用于识别基金份额和跟踪产品
    Data.NetAssetValue number|null 基金公司最近一次公布的单位净值;暂不可用时为 null
    Data.TimeKey string|null 最近单位净值对应的日期,通常格式为 yyyy-MM-dd;暂不可用时为 null
    Data.DayGrowthRate number|null 最近单位净值相对上一净值日的增长率,单位为百分比;暂不可用时为 null
    Data.WeekGrowthRate number|null 截至 TimeKey 的近 1 周收益率,单位为百分比
    Data.MonthGrowthRate number|null 截至 TimeKey 的近 1 月收益率,单位为百分比
    Data.ThreeMonthGrowthRate number|null 截至 TimeKey 的近 3 月收益率,单位为百分比
    Data.SixMonthGrowthRate number|null 截至 TimeKey 的近 6 月收益率,单位为百分比
    Data.YearGrowthRate number|null 截至 TimeKey 的近 1 年收益率,单位为百分比
    Data.TwoYearGrowthRate number|null 截至 TimeKey 的近 2 年收益率,单位为百分比
    Data.ThreeYearGrowthRate number|null 截至 TimeKey 的近 3 年收益率,单位为百分比
    Data.ThisYearGrowthRate number|null 从本年度首个净值日至 TimeKey 的收益率,单位为百分比
    Data.SinceEstablishmentGrowthRate number|null 从基金成立日至 TimeKey 的累计收益率,单位为百分比
    Data.Fee number|null 基金费率,单位为百分比;例如 0.12 表示 0.12%,暂不可用时为 null
    Data.MinPurchaseAmount string|null 基金最低购买金额说明,可能包含金额单位或文字条件;暂不可用时为 null
    Data.TrackingTarget string 当前 index 筛选范围。
    Data.TrackingMethod string 当前 indicator 筛选范围。
    Data.IndexCategory string 本条记录所属的 index 筛选范围;传全部时可能返回全部
    Data.FundType string 本条记录所属的 indicator 筛选范围;传全部时可能返回全部
  • 鉴权方式

    接口支持以下 AppKey 传递方式,任选一种即可;已有请求示例、Postman 集合和历史代码仍可继续使用原来的 appkey 参数方式。

    传输载体 参数 示例 说明
    HTTP Header X-GUGUDATA-APPKEY X-GUGUDATA-APPKEY: YOUR_APPKEY 推荐方式,适合服务端接入和统一封装。
    HTTP Header X-API-Key X-API-Key: YOUR_APPKEY 通用 API Key Header,便于和常见 API 客户端集成。
    HTTP Header Authorization Authorization: Bearer YOUR_APPKEY 适合 OpenAI 兼容接口或 Bearer Token 风格客户端。
    Query 参数 appkey ?appkey=YOUR_APPKEY 兼容现有示例、Postman 集合、浏览器调试和历史代码。

    部分历史 POST 接口仍兼容表单或 JSON body 中的 appkey;新接入建议优先使用 Header 或 Query 参数。

  • 接口常见 HTTP 响应状态码

    以下为接口调用中常见的 HTTP 传输层状态码,不等同于响应体内的业务状态码;完整状态码注册表以 IANA HTTP Status Code Registry 为准。

    状态码 状态码解释 备注
    200 请求成功 HTTP 请求已成功处理;业务状态请结合响应体中的自定义业务码判断。
    201 资源已创建 创建类接口请求成功,并已生成对应资源。
    202 请求已接受 请求已被接受处理,结果可能异步完成。
    204 无响应内容 请求成功但响应体为空,适用于无需返回数据的操作。
    400 请求参数错误 请求参数缺失、格式错误或参数组合不合法。
    401 认证失败 缺少、无效或未通过认证的访问凭证(如 AppKey)。
    403 无权限访问 订单到期、权限不足或接口额度不可用。
    404 资源不存在 请求路径不存在。
    405 请求方法不允许 当前路径不支持该 HTTP 方法。
    408 请求超时 客户端请求在服务端等待时间内未完成,可稍后重试。
    409 请求冲突 请求与当前资源状态冲突,调整参数或业务状态后重试。
    413 请求内容过大 上传文件或请求体超过接口限制。
    414 请求地址过长 请求 URL 超过服务端可处理长度,建议减少查询参数或改用 POST。
    415 请求内容类型不支持 上传或请求体的内容类型不符合接口要求。
    422 请求语义错误 请求格式正确,但参数取值、语义或业务约束无法处理。
    429 请求频率受限 默认按来源 IP 限速,单 IP 最多 5 QPS,可满足常规业务调用。超出限制时接口会返回 429 请求频率受限;已购买接口订单可加购 10 QPS 扩展。
    431 请求头过大 请求头字段过大或过多,建议精简 Header 后重试。
    500 服务器内部错误 服务端处理异常,请稍后重试。
    502 服务暂时不可用 请稍后重试。
    503 服务暂时不可用 请稍后重试。
    504 请求超时 请稍后重试。
  • 接口自定义业务状态码

    业务状态码 业务状态码解释 备注
    100 正常返回
    101 参数错误
    102 请求频率受限 默认按来源 IP 限速,单 IP 最多 5 QPS,可满足常规业务调用。超出限制时接口会返回 429 请求频率受限;已购买接口订单可加购 10 QPS 扩展。
    103 账号欠费
    104 APPKEY 错误 请检查传递的 APPKEY 是否为开发者中心获取到的值
  • 请求示例代码

    curl --location --request GET 'https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc'
    #include <curl/curl.h>
    
    int main(void) {
      CURL *curl = curl_easy_init();
      if (curl) {
        curl_easy_setopt(curl, CURLOPT_URL, "https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc");
        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
        CURLcode res = curl_easy_perform(curl);
        (void)res;
        curl_easy_cleanup(curl);
      }
      return 0;
    }
    
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Net.Http;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, "https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc");
    var response = client.SendAsync(request).Result;
    Console.WriteLine(response.Content.ReadAsStringAsync().Result);
    
    package main
    
    import (
      "fmt"
      "io"
      "net/http"
    )
    
    func main() {
      url := "https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc"
      req, err := http.NewRequest("GET", url, nil)
      if err != nil {
        fmt.Println(err)
        return
      }
      res, err := http.DefaultClient.Do(req)
      if err != nil {
        fmt.Println(err)
        return
      }
      defer res.Body.Close()
      body, err := io.ReadAll(res.Body)
      if err != nil {
        fmt.Println(err)
        return
      }
      fmt.Println(string(body))
    }
    
    OkHttpClient client = new OkHttpClient().newBuilder().build();
    Request request = new Request.Builder()
      .url("https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc")
      .method("GET", null)
      .build();
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    $.ajax({
      url: "https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc",
      method: "GET",
    }).done(function (response) {
      console.log(response);
    });
    
    const https = require("node:https");
    
    const url = "https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc";
    const request = https.request(url, { method: "GET", headers: {  } }, handleResponse);
    request.on("error", console.error);
    request.end();
    
    function handleResponse(response) {
      const chunks = [];
      response.on("data", function (chunk) {
        chunks.push(chunk);
      });
      response.on("end", function () {
        console.log(Buffer.concat(chunks).toString("utf8"));
      });
    }
    
    #import <Foundation/Foundation.h>
    
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc"]];
    [request setHTTPMethod:@"GET"];
    NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
      if (error) {
        NSLog(@"%@", error);
        return;
      }
      NSLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
    }];
    [task resume];
    
    <?php
    $curl = curl_init();
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_FOLLOWLOCATION => true,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    $response = curl_exec($curl);
    curl_close($curl);
    echo $response;
    
    import requests
    
    url = "https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc"
    response = requests.request("GET", url)
    print(response.text)
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc")
    https = Net::HTTP.new(url.host, url.port)
    https.use_ssl = true
    request = Net::HTTP::Get.new(url)
    response = https.request(request)
    puts response.read_body
    
    import Foundation
    
    let semaphore = DispatchSemaphore(value: 0)
    var request = URLRequest(url: URL(string: "https://api.gugudata.com/fund/basic/index?appkey=YOUR_APPKEY&index=%e6%b2%aa%e6%b7%b1%e6%8c%87%e6%95%b0&indicator=%e8%a2%ab%e5%8a%a8%e6%8c%87%e6%95%b0%e5%9e%8b&pageIndex=1&pageSize=0&sortBy=source&sortOrder=asc")!, timeoutInterval: .infinity)
    request.httpMethod = "GET"
    let task = URLSession.shared.dataTask(with: request) { data, response, error in
      defer { semaphore.signal() }
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
    }
    task.resume()
    semaphore.wait()
    
  • 常见问题 Q&A

    • Q: 如何完成第一次 API 调用?

      A: 先确认当前接口的请求方法、必填参数和成功状态,再使用对应产品的 AppKey 发起请求;以实际响应中的业务状态判断结果。 查看接入指南

    • Q: 如何保证请求时 AppKey 的安全性?

      A: 在开发者中心的 APP KEY 管理页面复制对应产品的 AppKey,并保存在服务端环境变量或密钥管理服务中。不要写入网页、App 客户端、公开仓库或日志。

    • Q: 接口可以用于哪些开发语言?

      A: Java、Python、Node.js、PHP、Go、C#、Swift、Kotlin 等支持 HTTP 请求的语言均可接入;也可以通过 OpenAPI、Postman 或 Apifox 查看和调试接口。

    • Q: 请求失败或超时后可以重试吗?

      A: 先区分 HTTP 状态与业务错误。参数、鉴权和权限错误应修正后再请求;超时并不表示服务端未执行,重试前需确认接口是否会重复计费或产生副作用。 查看接入指南

    • Q: 接口的性能可以保证吗?

      A: 实际响应时间受接口类型、参数和网络环境影响。请按当前套餐的 QPS 控制并发,生产接入前完成联调与容量评估。

  • 服务协议与免责声明

    购买或使用 GuGuData API 服务前,请充分阅读服务协议、免责声明与数据合规声明。相关页面均支持在浏览器中快速导出 PDF,便于内部归档、评审和合规留存。

  • 技术支持

    技术支持邮箱:
    support@gugudata.com
    企业微信客服:
    联系客服
  • 专业软件开发与系统工程服务

    GuGuData 官方认证工程合作伙伴,专注企业级数据接口集成、AI 工程化与大规模数据处理。团队深度理解 GuGuData 数据接口体系,具备海量数据采集、治理、检索与高并发接口服务经验,可围绕业务场景构建 AI Agent、MCP 接入、智能工作流和生产级数据应用,让数据能力稳定进入现有流程、内部平台和核心业务系统。

    了解工程服务