输出腾讯新闻排名前10的头条新闻。
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 | |
| page | string | 否 | 整数(可选,默认返回全部),限制返回数据的条数,取值范围1-10 | 10 |
| type | string | 否 | 字符串(可选,默认json),指定返回数据的格式,有效值json、text | json |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
},
{
"name": "page",
"type": "string",
"required": false,
"description": "整数(可选,默认返回全部),限制返回数据的条数,取值范围1-10",
"example": "10"
},
{
"name": "type",
"type": "string",
"required": false,
"description": "字符串(可选,默认json),指定返回数据的格式,有效值json、text",
"example": "json"
}
]
{
"openapi": "3.1.1",
"info": {
"title": "腾讯新闻头条",
"description": "输出腾讯新闻排名前10的头条新闻。",
"version": "1.0.0"
},
"paths": {
"/api/yljk/txxw/api.php": {
"get": {
"summary": "腾讯新闻头条",
"description": "输出腾讯新闻排名前10的头条新闻。",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "10"
},
"description": "整数(可选,默认返回全部),限制返回数据的条数,取值范围1-10"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "字符串(可选,默认json),指定返回数据的格式,有效值json、text"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "腾讯新闻头条",
"description": "输出腾讯新闻排名前10的头条新闻。",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "10"
},
"description": "整数(可选,默认返回全部),限制返回数据的条数,取值范围1-10"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "字符串(可选,默认json),指定返回数据的格式,有效值json、text"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api.317ak.com",
"description": "当前访问入口(https)"
}
]
}
{
"status": "success",
"code": 200,
"message": "获取成功(返回前10条)",
"data": [
{
"sort": 1,
"entity_id": "70040925",
"id": "20261001A05ZND00",
"url": "https://new.qq.com/rain/a/20261001A05ZND00",
"title": "时政新闻眼丨国庆前夕两场活动,习近平总书记指引我们鉴往知来"
},
{
"sort": 2,
"entity_id": "70041085",
"id": "LNK2026100128876100",
"url": "https://new.qq.com/rain/a/LNK2026100128876100",
"title": "追光的你|争做英雄才能英雄辈出"
},
{
"sort": 3,
"entity_id": "70041085",
"id": "20260930A0AIE900",
"url": "https://new.qq.com/rain/a/20260930A0AIE900",
"title": "搭建友好桥梁 促进民心相通"
},
{
"sort": 4,
"entity_id": "70041094",
"id": "20261001A06KRB00",
"url": "https://new.qq.com/rain/a/20261001A06KRB00",
"title": "视频丨今天,让我们共同向祖国告白“我爱你,中国!”"
},
{
"sort": 5,
"entity_id": "70041097",
"id": "20261001A03VEU00",
"url": "https://new.qq.com/rain/a/20261001A03VEU00",
"title": "声动中国丨77载山河壮阔 清澈的爱只为中国"
},
{
"sort": 6,
"entity_id": "70041107",
"id": "LNK2026100128088200",
"url": "https://new.qq.com/rain/a/LNK2026100128088200",
"title": "最动人“中国红”是永不褪色的信仰之旗"
},
{
"sort": 7,
"entity_id": "70041127",
"id": "20261001A08CNT00",
"url": "https://new.qq.com/rain/a/20261001A08CNT00",
"title": "新华视点丨新职业破土生长 老手艺焕发新生"
},
{
"sort": 8,
"entity_id": "70041135",
"id": "LNK2026100128384100",
"url": "https://new.qq.com/rain/a/LNK2026100128384100",
"title": "【理响中国】奋力谱写强国建设、民族复兴新篇章"
},
{
"sort": 9,
"entity_id": "70041148",
"id": "20261001A06Y5R00",
"url": "https://new.qq.com/rain/a/20261001A06Y5R00",
"title": "祝贺新中国成立77周年 多国人士盛赞中国发展成就"
},
{
"sort": 10,
"entity_id": "70041154",
"id": "20261001A043I100",
"url": "https://new.qq.com/rain/a/20261001A043I100",
"title": "共促全球人工智能健康有序发展"
}
],
"timestamp": 1790856770
}
提供腾讯新闻头条数据查询服务,返回当前排名靠前的新闻内容。
适用于需要获取腾讯新闻热点资讯的应用或开发者使用。
https://api-v2.317ak.com/api/yljk/txxw/api.php
GET、POST
接口调用需要进行鉴权,请在请求参数中通过 Query 方式传递密钥:
key=接口调用密钥
密钥校验通过后即可调用接口获取腾讯新闻头条数据。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥 |
| page | string | 否 | 整数,默认返回全部数据。限制返回数据的条数,取值范围 1-10 |
| type | string | 否 | 指定返回数据的格式,默认 json。有效值:json、text |
{
"status": "success",
"code": 200,
"message": "获取成功(返回前10条)",
"data": [
{
"sort": 1,
"entity_id": "70040925",
"id": "20261001A05ZND00",
"url": "https://new.qq.com/rain/a/20261001A05ZND00",
"title": "时政新闻眼丨国庆前夕两场活动,习近平总书记指引我们鉴往知来"
}
],
"timestamp": 1790856770
}
| 字段 | 类型 | 说明 |
|---|---|---|
| status | string | 请求状态,成功时返回 success |
| code | integer | 响应状态码,成功时返回 200 |
| message | string | 响应提示信息 |
| data | array | 新闻列表数据 |
| data[].sort | integer | 新闻排序序号 |
| data[].entity_id | string | 新闻实体标识 |
| data[].id | string | 新闻唯一标识 |
| data[].url | string | 新闻链接地址 |
| data[].title | string | 新闻标题 |
| timestamp | integer | 响应时间戳 |
{
"code":0,
"msg":"未提供调用密钥",
"errcode":11001
}
| errcode | 含义 |
|---|---|
| 11001 | 未提供调用密钥 |
| 11002 | 密钥错误 |
| 11003 | 密钥已禁用 |
| 11004 | 积分余额不足 |
| 11005 | 请求过于频繁(QPM 限制) |
| 11006 | 接口维护中 |
| 11007 | 接口已禁用 |
| 11008 | 接口不可用 |
| 11009 | 密钥校验暂不可用 |
| 11010 | 积分系统暂不可用 |
| 11011 | 收费接口须提供有效密钥 |
| 11012 | 鉴权方式错误 |
| 11013 | 接口不存在 |
| 11014 | ***地址无效 |
| 11015 | ***地址不允许 |
| 11016 | ***请求失败 |
| 11017 | 服务暂不可用 |
| 11018 | 请求方式不允许 |
| 11019 | 当前IP不在白名单内 |
| 11020 | 启用出口代理须提供有效密钥 |
| 11021 | 未配置可用出口代理 |
| 11022 | 出口代理不可用 |
| 11023 | 密钥已过期 |
| 11024 | 令牌分配积分不足 |
curl -G "https://api-v2.317ak.com/api/yljk/txxw/api.php" \
--data-urlencode "key=你的接口密钥" \
--data-urlencode "page=10" \
--data-urlencode "type=json"
## 注意事项
- 调用接口前需妥善保管接口密钥,避免将密钥直接暴露在公开代码、网页前端或客户端程序中,防止被他人获取后造成非预期调用。
- 本接口要求使用密钥鉴权,请通过 Query 参数 `key` 传递有效接口调用密钥。
- 接口调用请使用 HTTPS 请求方式,确保请求过程中的数据传输安全。
- `page` 参数用于限制返回新闻条数,可选取值范围为 1-10;未传入时默认返回全部可用数据。
- `type` 参数用于指定返回格式,可选值为 `json` 或 `text`;未传入时默认返回 `json` 格式,建议根据业务解析方式选择合适格式。
- 请求参数需按照接口定义传递,参数名称及类型请保持一致,避免因参数错误导致调用失败。
- 返回内容中的新闻列表按照排名顺序提供,`sort` 字段表示新闻排序位置,实际展示时建议结合返回数据结构进行处理。
- 请根据业务需求合理控制调用频率,避免短时间内大量重复请求影响接口稳定性。
- 如需长期运行调用程序,建议增加异常处理机制,对网络异常、参数错误及接口返回状态进行判断。curl "https://api-v2.317ak.com/api/yljk/txxw/api.php?key=YOUR_API_KEY&page=10&type=json" \
-X GET