• API 功能

    • 输入考生省份、科类和成绩,整理同类考试条件下的高校志愿参考;
    • 按目标高校名称名单评估,便于核对关注院校的机会分;
    • 支持使用高校唯一 ID 关联院校基础信息与评估对象;
    • 按高校所在地省份筛选,整理目标地区的院校候选;
    • 可启用本省优先,调整符合条件院校的推荐顺序;
    • 使用 Top-N 控制返回院校数量,整理不同长度的志愿候选清单;
    • 按自定义概率区间和每档数量整理多档志愿梯度;
    • 提供概率、院校排名和综合策略三种档内排序方式;
    • 支持专业级参考,资料不足时标明采用院校整体资料的参考结果;
    • 提供录取参考概率、机会分与梯度解释,辅助人工比较院校;
    • 展示实际使用的历史年份、分差及可用的招生计划覆盖依据;
    • 返回证据一致性状态,帮助核对解释与结构化结果是否对应;
    • 默认最大 QPS:5,可在开发者中心自助升级,年付订单接口调用次数不限。
    • 接口调用状态与状态监控
  • API 文档

    接口地址: https://api.gugudata.com/ai/admission/predict

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

    请求方式: POST

    请求协议: HTTPS

    请求示例: https://api.gugudata.com/ai/admission/predict

    数据预览: https://www.gugudata.com/preview/admission-predict

    接口测试:  https://api.gugudata.com/ai/admission/predict/demo

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

    请求参数(POST 请求参数以 application/json 格式传递;推荐通过 AppKey Header 鉴权,具体可参见下方示例代码)

    参数名 参数类型 是否必须 默认值 备注
    appkey string 是 无 付费后获取的 APPKEY。新接入推荐通过 AppKey Header 传递;历史 Query 或 JSON body 中的 appkey 继续兼容。
    province string 是 无 考生所在省份,与历年分数线数据保持一致
    subject_type string 是 无 科类/选科:理科、文科、物理类、历史类、综合等
    score number 否 无 考生裸分,与 rank 至少提供一项;一般省份 0–750,海南最高 900。仅位次请求是否可评估取决于当前模型与分段位次资料,无法换算时返回明确无数据原因。
    rank integer 否 无 考生全省位次,与 score 至少提供一项。保留该历史参数;当前模型未采用位次时以 meta.rank_source、effective_rank 说明,不将传入位次视为已参与计算。
    batch string 否 本科批 报考批次,目前支持普通本科批次
    top_n integer 否 50 返回院校数量上限,范围 1-200;传入 probability_tiers 时按各档位数量返回
    probability_tiers array 否 无,不传时使用 top_n 概率分层配置,仅支持 JSON Body 传入。示例:[{"name":"safe","label":"保","min_probability":0.98,"limit":3},{"name":"stable","label":"稳","min_probability":0.8,"limit":3},{"name":"reach","label":"冲","min_probability":0.75,"limit":3}]。每项包含 name、label、min_probability、limit;min_probability 必须严格递减,相邻档位自动形成概率区间;可配合 tier_sort 控制每档内部取数顺序,用于一次返回保、稳、冲等多档志愿结果;不传时继续按 top_n 返回。
    tier_sort string 否 probability 概率分层每档内部排序策略,仅在 probability_tiers 生效时使用;可选 probability、college_rank、balanced。probability 按录取概率排序,college_rank 按院校排名优先,balanced 综合院校层次、排名和概率。
    include_explanation boolean 否 false 是否返回补充影响因素说明,默认关闭以控制响应时延,开启后仅对部分结果返回解释信息
    prefer_local boolean 否 false 是否在排序时优先本省院校
    college_provinces array 否 无 按院校所在省份过滤,留空则不过滤;Query 方式可多次传值,格式 ["江苏", "上海"]
    target_colleges array 否 无 指定院校名单,仅对名单内院校预测
    uuid string 否 无 指定一个院校唯一 ID,仅对该院校预测;可使用全国大学高校基础信息接口返回的 SchoolUUID
    target_college_uuids array 否 无 指定院校唯一 ID 列表,仅对名单内院校预测;多个值可使用数组或逗号分隔字符串
    year integer 否 当前配置预测周期 目标招生年份,当前配置预测周期为 2026;兼容保留传入值,实际预测周期以 meta.prediction_year 和 requested_year/effective_year 为准,不提供历史回测语义。
    major_name string 否 无 专业名称(用于专业级预测),命中专业样本时优先返回该专业结果;若样本不足,系统可能切换到院校层或其他兼容预测路径
    local_batch_name string 否 无 本地批次名称(用于过滤),不提供时默认使用 batch 参数的值

    返回参数

    参数名 参数类型 备注
    DataStatus.StatusCode integer 接口状态码,100 表示成功
    DataStatus.StatusDescription string 接口返回状态说明
    DataStatus.ResponseDateTime string 返回时间
    DataStatus.DataTotalCount integer 本次返回院校数量
    Data.predictions array 预测结果列表
    Data.predictions[].college_name string 院校名称
    Data.predictions[].admission_probability number 兼容字段:历史条件下的录取参考概率(0-1),永久保留以兼容现有客户
    Data.predictions[].chance_score number 推荐使用字段:历史条件机会分(0-1),与 admission_probability 数值完全相同
    Data.predictions[].recommendation string 兼容字段:保留现有摘要文案和值,现有客户无需修改;新应用建议使用 interpretation
    Data.predictions[].long_recommendation string 兼容字段:保留现有长文案和值;新应用建议使用可复算的 long_interpretation
    Data.predictions[].interpretation string 推荐使用字段:按固定机会区间返回的志愿梯度解释
    Data.predictions[].long_interpretation string 推荐使用字段:只使用同一响应中的结构化证据拼装;证据不足时省略对应句子,证据冲突时停止输出详细数字
    Data.predictions[].historical_years array 该结果实际使用的历史招生年份;不会根据截至年份和数量推测连续年份
    Data.predictions[].data_through_year integer 该结果实际使用的最新历史招生年份
    Data.predictions[].plan_coverage object 招生计划覆盖信息;AVAILABLE 时 ratio 可由 covered_plan_total / school_plan_total 复算,未知不会用 0 表示
    Data.predictions[].fallback_path object 请求层级、实际数据层级、兼容策略和原因码
    Data.predictions[].evidence_consistency_status string 证据复算状态:VERIFIED、PARTIAL 或 FAILED
    Data.predictions[].evidence object 关键证据对象;保留 recent_3y_min_score,并新增具名 historical_score_summary 供年份、最低线、输入分数和分差复算
    Data.predictions[].evidence.historical_score_summary object 具名历史分数摘要,包含 years、latest_min_score、recent_min_score_average、student_score、gap_to_latest_min 和 gap_to_recent_min_average
    Data.predictions[].shap_explanation object 补充影响因素说明,仅在 include_explanation=true 且当前结果可解释时返回
    Data.predictions[].major_name string 命中专业级预测时返回对应专业名称;若结果回退到院校层,则该字段可能为空
    Data.predictions[].tier_name string 命中的概率档位标识,仅在请求 probability_tiers 时返回
    Data.predictions[].tier_label string 命中的概率档位展示名称,仅在请求 probability_tiers 时返回
    Data.predictions[].tier_min_probability number 命中档位的录取概率下限,仅在请求 probability_tiers 时返回;下一档会自动以上一档下限作为概率上界
    Data.meta.total_colleges integer 返回院校数量
    Data.meta.student_score number 考生分数
    Data.meta.student_province string 考生省份
    Data.meta.local_colleges integer 结果中同省院校数量,无 is_local 字段时为 null
    Data.meta.score_diff_min number 分差绝对值最小值
    Data.meta.score_diff_median number 分差绝对值中位数,用于梯度判断
    Data.meta.prefer_local boolean 是否启用本省优先排序
    Data.meta.college_provinces array 请求中用于过滤院校省份的列表
    Data.meta.model_version string 模型版本号
    Data.meta.data_through_year integer 本次返回结果实际使用的最新历史招生年份
    Data.meta.historical_years array 本次返回结果实际使用的历史招生年份并集
    Data.meta.coverage_level string 本次结果的历史数据覆盖等级;结果层级不一致时为 mixed
    Data.meta.interpretation_policy_version string 机会与梯度解释策略版本
    Data.meta.policy_constraints object 请求级政策评估边界,列出已评估项、未评估项及核对提示
    Data.meta.probability_tiers array 概率分层返回统计,仅在请求 probability_tiers 时返回;每项包含 name、label、min_probability、limit、returned_count,下一档会自动以上一档下限作为概率上界
    Data.meta.tier_sort string 本次概率分层每档内部排序策略,仅在请求 probability_tiers 时返回
    Data.meta.fallback.applied boolean 是否启用了 fallback 或补充预测策略
    Data.meta.fallback.strategy string fallback 策略标识,用于说明当前结果采用的兼容预测路径
    Data.meta.fallback.requested_year integer 请求中传入的目标预测年份
    Data.meta.fallback.effective_year integer 实际用于匹配分数线或历史样本的有效年份
    Data.meta.fallback.requested_major_name string 请求中传入的专业名称
    Data.meta.fallback.effective_major_name string 实际命中的参考专业名称;若未命中稳定专业样本则为空
    Data.meta.fallback.reason string 采用兼容预测路径时返回稳定原因码;未采用时为空
    Data.disclaimer string 免责声明
    DataStatus.RequestParameter string 实际业务参数,不包含凭据。
    DataStatus.RequestId string 本次请求的关联标识。
    DataStatus.NoDataReason string 有效请求无可评估结果时返回稳定原因;有结果时省略。
    Data.meta.requested_year integer 请求中传入的年份。
    Data.meta.prediction_year integer 当前实际模型预测周期。
    Data.meta.rank_source string 实际位次来源;missing 表示本次模型没有采用可用位次。
    Data.meta.effective_rank integer 实际参与评估的位次;未采用时为 null。

    响应示例(真实数据节选)

    接口数据预览

    仅展示部分示例数据,数组最多展示 3 项,长内容已省略;完整数据请调用接口获取。

    {
      "DataStatus": {
        "RequestParameter": "{\"province\": \"江苏\", \"subject_type\": \"物理类\", \"score\": 635, \"rank\": 12000, \"batch\": \"本科批\", \"top_n\": 10, \"include_explanation\": false, \"prefer_local\": false, \"college_provinces\": [\"江苏\", \"上海\"], \"target_colleges\": [\"南京大学\", \"东南大学\", \"南京航空航天大学\", \"南京理工大学\", \"苏州大学\", \"南京邮电大学\", \"河海大学\", \"江南大学\", \"上海大学\", \"华东理工大学\"], \"year\": 2026, \"local_batch_name\": \"本科批\"}",
        "StatusCode": 100,
        "StatusDescription": "预测成功",
        "ResponseDateTime": "2026-10-15 11:40:31.437",
        "DataTotalCount": 10,
        "RequestId": "4c034183-8a67-4b2e-b2fe-730f49b66c54"
      },
      "Data": {
        "predictions": [
          {
            "college_name": "苏州大学",
            "admission_probability": 0.98900462962962965,
            "evidence": {
              "recent_3y_min_score": [
                600.0,
                598.0
              ],
              "score_gap": 36.400000000000091,
              "score_gap_original": 35.0,
              "province_line_gap": 172.0,
              "is_985": false,
              "is_211": true,
              "is_dual_class": true,
              "college_rank": 42,
              "plan_enrollment": 3111,
              "plan_coverage_ratio": 1.0,
              "student_rank": null,
              "historical_min_rank": 34888.0,
              "rank_gap": 0.0,
              "rank_ratio": 0.0,
              "rank_missing": true,
              "rank_source": "missing",
              "rank_data_year": null,
              "score_source": "request",
              "score_data_year": null,
              "is_local": true,
              "history_year_count": 3,
              "control_line_source": "historical_admission_line",
              "control_line_year": null,
              "recent_min_trend": 3.0,
              "probability_source": "binary_college_fallback",
              "aggregation_mode": "college_fallback",
              "historical_score_summary": {
                "years": [
                  2023,
                  2024,
                  2025
                ],
                "latest_min_score": 600.0,
                "recent_min_score_average": 598.0,
                "student_score": 635.0,
                "gap_to_latest_min": 35.0,
                "gap_to_recent_min_average": 37.0
              }
            },
            "shap_explanation": null,
            "recommendation": "录取概率高",
            "long_recommendation": "当前录取参考概率较高,按近年录取情况看,你的分数处于相对安全区间。你的分数高于近三年最低线35分,也高于近三年均值线37分。本次按院校层历史录取数据估算。",
            "major_name": null,
            "tier_name": null,
            "tier_label": null,
            "tier_min_probability": null,
            "education_level": "bachelor",
            "coverage_level": "full",
            "data_through_year": 2025,
            "risk_label": "保",
            "risk_policy_version": "legacy-v1",
            "chance_score": 0.98900462962962965,
            "interpretation": "历史条件下机会较高,建议作为稳妥梯度参考。",
            "long_interpretation": "在江苏、物理类、本科批和院校历史数据范围内,模型给出 0.99 的历史条件机会估计。历史数据覆盖 2023 至 2025 年。输入分数高于最新可用最低线 35 分,高于近年最低线均值 37 分。仍需核对当年专业组、选科、体检、校区和调剂要求。",
            "historical_years": [
              2023,
              2024,
              2025
            ],
            "plan_coverage": {
              "status": "NOT_APPLICABLE",
              "ratio": null,
              "matched_plan_rows": null,
              "covered_plan_total": null,
              "school_plan_total": null
            },
            "fallback_path": {
              "applied": false,
              "requested_level": "college",
              "effective_level": "college",
              "strategy": "college_fallback",
              "reason": null
            },
            "evidence_consistency_status": "VERIFIED"
          },
          {
            "college_name": "江南大学",
            "admission_probability": 0.98656898656898662,
            "evidence": {
              "recent_3y_min_score": [
                604.0,
                601.0
              ],
              "score_gap": 33.100000000000023,
              "score_gap_original": 31.0,
              "province_line_gap": 172.0,
              "is_985": false,
              "is_211": true,
              "is_dual_class": true,
              "college_rank": 57,
              "plan_enrollment": 837,
              "plan_coverage_ratio": 1.0,
              "student_rank": null,
              "historical_min_rank": 31362.0,
              "rank_gap": 0.0,
              "rank_ratio": 0.0,
              "rank_missing": true,
              "rank_source": "missing",
              "rank_data_year": null,
              "score_source": "request",
              "score_data_year": null,
              "is_local": true,
              "history_year_count": 3,
              "control_line_source": "historical_admission_line",
              "control_line_year": null,
              "recent_min_trend": 3.0,
              "probability_source": "binary_college_fallback",
              "aggregation_mode": "college_fallback",
              "historical_score_summary": {
                "years": [
                  2023,
                  2024,
                  2025
                ],
                "latest_min_score": 604.0,
                "recent_min_score_average": 601.0,
                "student_score": 635.0,
                "gap_to_latest_min": 31.0,
                "gap_to_recent_min_average": 34.0
              }
            },
            "shap_explanation": null,
            "recommendation": "录取概率高",
            "long_recommendation": "当前录取参考概率较高,按近年录取情况看,你的分数处于相对安全区间。你的分数高于近三年最低线31分,也高于近三年均值线34分。本次按院校层历史录取数据估算。",
            "major_name": null,
            "tier_name": null,
            "tier_label": null,
            "tier_min_probability": null,
            "education_level": "bachelor",
            "coverage_level": "full",
            "data_through_year": 2025,
            "risk_label": "保",
            "risk_policy_version": "legacy-v1",
            "chance_score": 0.98656898656898662,
            "interpretation": "历史条件下机会较高,建议作为稳妥梯度参考。",
            "long_interpretation": "在江苏、物理类、本科批和院校历史数据范围内,模型给出 0.99 的历史条件机会估计。历史数据覆盖 2023 至 2025 年。输入分数高于最新可用最低线 31 分,高于近年最低线均值 34 分。仍需核对当年专业组、选科、体检、校区和调剂要求。",
            "historical_years": [
              2023,
              2024,
              2025
            ],
            "plan_coverage": {
              "status": "NOT_APPLICABLE",
              "ratio": null,
              "matched_plan_rows": null,
              "covered_plan_total": null,
              "school_plan_total": null
            },
            "fallback_path": {
              "applied": false,
              "requested_level": "college",
              "effective_level": "college",
              "strategy": "college_fallback",
              "reason": null
            },
            "evidence_consistency_status": "VERIFIED"
          },
          {
            "college_name": "南京邮电大学",
            "admission_probability": 0.96408839779005528,
            "evidence": {
              "recent_3y_min_score": [
                608.0,
                608.33333333333337
              ],
              "score_gap": 26.766666666666652,
              "score_gap_original": 27.0,
              "province_line_gap": 172.0,
              "is_985": false,
              "is_211": false,
              "is_dual_class": true,
              "college_rank": 122,
              "plan_enrollment": 3368,
              "plan_coverage_ratio": 1.0,
              "student_rank": null,
              "historical_min_rank": 27965.0,
              "rank_gap": 0.0,
              "rank_ratio": 0.0,
              "rank_missing": true,
              "rank_source": "missing",
              "rank_data_year": null,
              "score_source": "request",
              "score_data_year": null,
              "is_local": true,
              "history_year_count": 3,
              "control_line_source": "historical_admission_line",
              "control_line_year": null,
              "recent_min_trend": -5.0,
              "probability_source": "binary_college_fallback",
              "aggregation_mode": "college_fallback",
              "historical_score_summary": {
                "years": [
                  2023,
                  2024,
                  2025
                ],
                "latest_min_score": 608.0,
                "recent_min_score_average": 608.33333333333337,
                "student_score": 635.0,
                "gap_to_latest_min": 27.0,
                "gap_to_recent_min_average": 26.666666666666629
              }
            },
            "shap_explanation": null,
            "recommendation": "录取概率高",
            "long_recommendation": "当前录取参考概率较高,按近年录取情况看,你的分数处于相对安全区间。你的分数高于近三年最低线27分,也高于近三年均值线26.7分。本次按院校层历史录取数据估算。",
            "major_name": null,
            "tier_name": null,
            "tier_label": null,
            "tier_min_probability": null,
            "education_level": "bachelor",
            "coverage_level": "full",
            "data_through_year": 2025,
            "risk_label": "保",
            "risk_policy_version": "legacy-v1",
            "chance_score": 0.96408839779005528,
            "interpretation": "历史条件下机会较高,建议作为稳妥梯度参考。",
            "long_interpretation": "在江苏、物理类、本科批和院校历史数据范围内,模型给出 0.96 的历史条件机会估计。历史数据覆盖 2023 至 2025 年。输入分数高于最新可用最低线 27 分,高于近年最低线均值 26.7 分。仍需核对当年专业组、选科、体检、校区和调剂要求。",
            "historical_years": [
              2023,
              2024,
              2025
            ],
            "plan_coverage": {
              "status": "NOT_APPLICABLE",
              "ratio": null,
              "matched_plan_rows": null,
              "covered_plan_total": null,
              "school_plan_total": null
            },
            "fallback_path": {
              "applied": false,
              "requested_level": "college",
              "effective_level": "college",
              "strategy": "college_fallback",
              "reason": null
            },
            "evidence_consistency_status": "VERIFIED"
          }
        ],
        "meta": {
          "total_colleges": 10,
          "student_score": 635.0,
          "student_province": "江苏",
          "local_colleges": 8,
          "score_diff_min": 4.0,
          "score_diff_median": 12.5,
          "prefer_local": false,
          "college_provinces": [
            "江苏",
            "上海"
          ],
          "model_version": "v1.1.0",
          "prediction_year": 2026,
          "requested_year": 2026,
          "history_through_year": 2025,
          "data_through_year": 2025,
          "historical_years": [
            2023,
            2024,
            2025
          ],
          "interpretation_policy_version": "2026-08",
          "policy_constraints": {
            "status": "PARTIALLY_EVALUATED",
            "evaluated": [
              "province",
              "subject_type",
              "batch"
            ],
            "not_evaluated": [
              "subject_selection",
              "physical_exam",
              "single_subject_score"
            ],
            "notice": "未评估项需以当年省级考试院和院校招生章程为准。"
          },
          "education_level": "bachelor",
          "coverage_level": "full",
          "risk_policy_version": "legacy-v1",
          "candidate_pool": {
            "total_colleges": 10,
            "feature_rows": 10
          },
          "rank_source": "missing",
          "rank_missing": true,
          "effective_rank": null,
          "student_rank": null,
          "score_source": "request",
          "score_data_year": null,
          "effective_score": 635.0,
          "score_segments_through_year": null,
          "control_line_source": "historical_admission_line",
          "control_lines_through_year": null,
          "data_sources_through_year": {
            "admission_lines": 2025,
            "major_admission_lines": null,
            "enrollment_plans": 2026,
            "province_control_lines": null,
            "score_segments": null
          },
          "fallback": {
            "applied": false,
            "strategy": null,
            "requested_year": 2026,
            "effective_year": 2026,
            "requested_major_name": null,
            "effective_major_name": null,
            "reason": null
          }
        },
        "disclaimer": "本预测结果综合历年真实招生数据、院校录取趋势与机器学习模型推算而成,仅供志愿填报参考。建议结合当年政策、院校最新官方信息及个人实际情况综合判断,最终录取结果以各省考试院和院校官方公布为准。"
      }
    }
  • 鉴权方式

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

    传输载体 参数 示例 说明
    HTTP Header AppKey AppKey: YOUR_APPKEY 推荐方式,适合服务端接入和统一封装。
    HTTP Header X-GUGUDATA-APPKEY X-GUGUDATA-APPKEY: YOUR_APPKEY 兼容已有客户端的 Header 名称。
    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 正常返回
    501 参数错误 缺少省份、科类、appkey,或成绩与位次均缺失,以及重复、冲突、类型或范围无效时返回;HTTP 422。
    502 请求频率受限 请降低请求频率
    503 APPKEY 过期或订单失效 请前往开发者中心确认订单有效期
    504 APPKEY 错误 请检查传递的 APPKEY 是否正确
    505 超出调用次数 当前 APPKEY 已达到订单调用上限
    -9 预测失败或服务处理异常 预测依赖失败使用 HTTP 503,超时或不可达使用 HTTP 504,内部错误使用 HTTP 500;机器状态说明具体类别。
  • 请求示例代码

    curl --location --request POST 'https://api.gugudata.com/ai/admission/predict' \
    --header 'AppKey: YOUR_APPKEY' \
    --header 'Content-Type: application/json' \
    --data '{"province":"江苏","subject_type":"物理类","score":635,"rank":12000,"batch":"本科批","top_n":10,"include_explanation":false,"prefer_local":false,"college_provinces":["江苏","上海"],"target_colleges":["南京大学","东南大学","南京航空航天大学","南京理工大学","苏州大学","南京邮电大学","河海大学","江南大学","上海大学","华东理工大学"],"year":2026,"local_batch_name":"本科批"}'
    #include <curl/curl.h>
    
    int main(void) {
      CURL *curl = curl_easy_init();
      if (curl) {
        curl_easy_setopt(curl, CURLOPT_URL, "https://api.gugudata.com/ai/admission/predict");
        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
        struct curl_slist *headers = NULL;
        headers = curl_slist_append(headers, "Content-Type: application/json");
        headers = curl_slist_append(headers, "AppKey: YOUR_APPKEY");
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"province\":\"江苏\",\"subject_type\":\"物理类\",\"score\":635,\"rank\":12000,\"batch\":\"本科批\",\"top_n\":10,\"include_explanation\":false,\"prefer_local\":false,\"college_provinces\":[\"江苏\",\"上海\"],\"target_colleges\":[\"南京大学\",\"东南大学\",\"南京航空航天大学\",\"南京理工大学\",\"苏州大学\",\"南京邮电大学\",\"河海大学\",\"江南大学\",\"上海大学\",\"华东理工大学\"],\"year\":2026,\"local_batch_name\":\"本科批\"}");
        CURLcode res = curl_easy_perform(curl);
        (void)res;
        curl_slist_free_all(headers);
        curl_easy_cleanup(curl);
      }
      return 0;
    }
    
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Net.Http;
    using System.Text;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Post, "https://api.gugudata.com/ai/admission/predict");
    request.Headers.Add("AppKey", "YOUR_APPKEY");
    request.Content = new StringContent("{\"province\":\"江苏\",\"subject_type\":\"物理类\",\"score\":635,\"rank\":12000,\"batch\":\"本科批\",\"top_n\":10,\"include_explanation\":false,\"prefer_local\":false,\"college_provinces\":[\"江苏\",\"上海\"],\"target_colleges\":[\"南京大学\",\"东南大学\",\"南京航空航天大学\",\"南京理工大学\",\"苏州大学\",\"南京邮电大学\",\"河海大学\",\"江南大学\",\"上海大学\",\"华东理工大学\"],\"year\":2026,\"local_batch_name\":\"本科批\"}", Encoding.UTF8, "application/json");
    var response = client.SendAsync(request).Result;
    Console.WriteLine(response.Content.ReadAsStringAsync().Result);
    
    package main
    
    import (
      "strings"
      "fmt"
      "io"
      "net/http"
    )
    
    func main() {
      url := "https://api.gugudata.com/ai/admission/predict"
      payload := strings.NewReader("{\"province\":\"江苏\",\"subject_type\":\"物理类\",\"score\":635,\"rank\":12000,\"batch\":\"本科批\",\"top_n\":10,\"include_explanation\":false,\"prefer_local\":false,\"college_provinces\":[\"江苏\",\"上海\"],\"target_colleges\":[\"南京大学\",\"东南大学\",\"南京航空航天大学\",\"南京理工大学\",\"苏州大学\",\"南京邮电大学\",\"河海大学\",\"江南大学\",\"上海大学\",\"华东理工大学\"],\"year\":2026,\"local_batch_name\":\"本科批\"}")
      req, err := http.NewRequest("POST", url, payload)
      if err != nil {
        fmt.Println(err)
        return
      }
      req.Header.Set("AppKey", "YOUR_APPKEY")
      req.Header.Add("Content-Type", "application/json")
      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();
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"province\":\"江苏\",\"subject_type\":\"物理类\",\"score\":635,\"rank\":12000,\"batch\":\"本科批\",\"top_n\":10,\"include_explanation\":false,\"prefer_local\":false,\"college_provinces\":[\"江苏\",\"上海\"],\"target_colleges\":[\"南京大学\",\"东南大学\",\"南京航空航天大学\",\"南京理工大学\",\"苏州大学\",\"南京邮电大学\",\"河海大学\",\"江南大学\",\"上海大学\",\"华东理工大学\"],\"year\":2026,\"local_batch_name\":\"本科批\"}");
    Request request = new Request.Builder()
      .url("https://api.gugudata.com/ai/admission/predict")
      .addHeader("AppKey", "YOUR_APPKEY")
      .method("POST", body)
      .build();
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
    
    $.ajax({
      url: "https://api.gugudata.com/ai/admission/predict",
      method: "POST",
      headers: { "AppKey": "YOUR_APPKEY" },
      contentType: "application/json",
      data: JSON.stringify({"province":"江苏","subject_type":"物理类","score":635,"rank":12000,"batch":"本科批","top_n":10,"include_explanation":false,"prefer_local":false,"college_provinces":["江苏","上海"],"target_colleges":["南京大学","东南大学","南京航空航天大学","南京理工大学","苏州大学","南京邮电大学","河海大学","江南大学","上海大学","华东理工大学"],"year":2026,"local_batch_name":"本科批"}),
    }).done(function (response) {
      console.log(response);
    });
    
    const https = require("node:https");
    const url = "https://api.gugudata.com/ai/admission/predict";
    const body = JSON.stringify({"province":"江苏","subject_type":"物理类","score":635,"rank":12000,"batch":"本科批","top_n":10,"include_explanation":false,"prefer_local":false,"college_provinces":["江苏","上海"],"target_colleges":["南京大学","东南大学","南京航空航天大学","南京理工大学","苏州大学","南京邮电大学","河海大学","江南大学","上海大学","华东理工大学"],"year":2026,"local_batch_name":"本科批"});
    
    const request = https.request(url, {
      method: "POST",
      headers: {
        "AppKey": "YOUR_APPKEY",
        "Content-Type": "application/json",
        "Content-Length": Buffer.byteLength(body)
      }
    }, handleResponse);
    request.on("error", console.error);
    request.write(body);
    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/ai/admission/predict"]];
    [request setHTTPMethod:@"POST"];
    [request setValue:@"YOUR_APPKEY" forHTTPHeaderField:@"AppKey"];
    NSString *body = @"{\"province\":\"江苏\",\"subject_type\":\"物理类\",\"score\":635,\"rank\":12000,\"batch\":\"本科批\",\"top_n\":10,\"include_explanation\":false,\"prefer_local\":false,\"college_provinces\":[\"江苏\",\"上海\"],\"target_colleges\":[\"南京大学\",\"东南大学\",\"南京航空航天大学\",\"南京理工大学\",\"苏州大学\",\"南京邮电大学\",\"河海大学\",\"江南大学\",\"上海大学\",\"华东理工大学\"],\"year\":2026,\"local_batch_name\":\"本科批\"}";
    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
    [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
    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/ai/admission/predict",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_FOLLOWLOCATION => true,
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_POSTFIELDS => "{\"province\":\"江苏\",\"subject_type\":\"物理类\",\"score\":635,\"rank\":12000,\"batch\":\"本科批\",\"top_n\":10,\"include_explanation\":false,\"prefer_local\":false,\"college_provinces\":[\"江苏\",\"上海\"],\"target_colleges\":[\"南京大学\",\"东南大学\",\"南京航空航天大学\",\"南京理工大学\",\"苏州大学\",\"南京邮电大学\",\"河海大学\",\"江南大学\",\"上海大学\",\"华东理工大学\"],\"year\":2026,\"local_batch_name\":\"本科批\"}",
      CURLOPT_HTTPHEADER => array(
        "Content-Type: application/json",
        "AppKey: YOUR_APPKEY",
      ),
    ));
    $response = curl_exec($curl);
    curl_close($curl);
    echo $response;
    
    import requests
    import json
    
    url = "https://api.gugudata.com/ai/admission/predict"
    headers = { "AppKey": "YOUR_APPKEY" }
    payload = json.loads('{"province":"江苏","subject_type":"物理类","score":635,"rank":12000,"batch":"本科批","top_n":10,"include_explanation":false,"prefer_local":false,"college_provinces":["江苏","上海"],"target_colleges":["南京大学","东南大学","南京航空航天大学","南京理工大学","苏州大学","南京邮电大学","河海大学","江南大学","上海大学","华东理工大学"],"year":2026,"local_batch_name":"本科批"}')
    response = requests.post(url, json=payload, headers=headers)
    print(response.text)
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.gugudata.com/ai/admission/predict")
    https = Net::HTTP.new(url.host, url.port)
    https.use_ssl = true
    request = Net::HTTP::Post.new(url)
    request["AppKey"] = "YOUR_APPKEY"
    request["Content-Type"] = "application/json"
    request.body = "{\"province\":\"江苏\",\"subject_type\":\"物理类\",\"score\":635,\"rank\":12000,\"batch\":\"本科批\",\"top_n\":10,\"include_explanation\":false,\"prefer_local\":false,\"college_provinces\":[\"江苏\",\"上海\"],\"target_colleges\":[\"南京大学\",\"东南大学\",\"南京航空航天大学\",\"南京理工大学\",\"苏州大学\",\"南京邮电大学\",\"河海大学\",\"江南大学\",\"上海大学\",\"华东理工大学\"],\"year\":2026,\"local_batch_name\":\"本科批\"}"
    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/ai/admission/predict")!, timeoutInterval: .infinity)
    request.httpMethod = "POST"
    request.addValue("YOUR_APPKEY", forHTTPHeaderField: "AppKey")
    request.addValue("application/json", forHTTPHeaderField: "Content-Type")
    request.httpBody = "{\"province\":\"江苏\",\"subject_type\":\"物理类\",\"score\":635,\"rank\":12000,\"batch\":\"本科批\",\"top_n\":10,\"include_explanation\":false,\"prefer_local\":false,\"college_provinces\":[\"江苏\",\"上海\"],\"target_colleges\":[\"南京大学\",\"东南大学\",\"南京航空航天大学\",\"南京理工大学\",\"苏州大学\",\"南京邮电大学\",\"河海大学\",\"江南大学\",\"上海大学\",\"华东理工大学\"],\"year\":2026,\"local_batch_name\":\"本科批\"}".data(using: .utf8)
    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 控制并发,生产接入前完成联调与容量评估。

    • Q: 数据多久更新?

      A: 不同接口按各自的数据周期更新,请以当前详情页的更新时间、更新频率及字段说明为准;不要将一次请求时间视为数据更新时间。

  • 服务协议与免责声明

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

  • 技术支持

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

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

    了解工程服务