---
title: "列出新闻来源及当前设置"
canonical_url: "https://tweetstream.io/zh-cn/docs/api/list-news-sources"
last_updated: 2026-11-05
---

# 列出新闻来源及当前设置

GET /api/news/sources 列出所有新闻来源，每个来源包含名称、图标、当前是否可用，以及是否已为你的实时流启用。修改设置前先读取这份列表，就能拿到每个来源的 sourceId，再用 PATCH 开启或关闭。

Canonical URL: https://tweetstream.io/zh-cn/docs/api/list-news-sources

## `GET /api/news/sources`

`https://api.tweetstream.io/api/news/sources`

## 授权

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `Authorization` | `string`, 必填 | 使用 TweetStream API 密钥进行 Bearer 认证：`Bearer <key>`。 |

## 响应字段

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `sources` | `object[]`, 必填 |  |
| `sources.available` | `boolean`, 必填 |  |
| `sources.enabled` | `boolean`, 必填 |  |
| `sources.icon` | `string`, 必填 |  |
| `sources.id` | `string`, 必填 |  |
| `sources.name` | `string`, 必填 |  |

## 响应

| 状态 | 说明 | 请求头 |
| --- | --- | --- |
| `200` | 成功 |  |
| `401` | API key 缺失或无效 |  |
| `403` | 已认证的账号无法使用此功能 |  |
| `500` | 请求未能完成 |  |

### 200

```json
{
  "sources": [
    {
      "id": "bbc-news",
      "name": "BBC News",
      "icon": "/news-sources/bbc.png",
      "available": true,
      "enabled": true
    },
    {
      "id": "dexerto",
      "name": "Dexerto",
      "icon": "/news-sources/dexerto.png",
      "available": true,
      "enabled": false
    }
  ]
}
```

### 401

```json
{
  "error": "<string>"
}
```

### 403

```json
{
  "error": "<string>"
}
```

### 500

```json
{
  "error": "<string>"
}
```

## 代码示例

### cURL

```bash
curl --request GET \
  --url https://api.tweetstream.io/api/news/sources \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY"
```

### JavaScript

```javascript
const response = await fetch("https://api.tweetstream.io/api/news/sources", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.TWEETSTREAM_API_KEY}`,
  },
});

console.log(response.status, await response.json());
```

### Python

```python
import os
import requests

response = requests.get(
    "https://api.tweetstream.io/api/news/sources",
    headers={"Authorization": f"Bearer {os.environ['TWEETSTREAM_API_KEY']}"},
)

print(response.status_code, response.json())
```
