> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tickdb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 個股新聞

> 獲取個股新聞列表、發布時間和正文可用狀態。

## 套餐權限

| 套餐 | 可用 |
| - | :-: |
| 免費版 | ❌ |
| 基礎版 | ❌ |
| 專業版 | ✅ |
| 全量套餐（A 股、港股、美股） | ✅ |
| 企業版 | ✅ |

## 注意事項

* 新聞列表不包含正文；使用 `news_id` 查詢詳情。`from` 和 `to` 必須同時提供或同時省略。

## 支持的市場

| 市場 | 示例 |
| - | - |
| 美股 | AAPL.US |
| 港股 | 700.HK |
| A股 | 600519.SH |

## 請求參數

| 參數 | 是否必須 | 說明 |
| - | :-: | - |
| `symbol` | 是 | 股票代碼 |
| `type` | 否 | 產品類型，當前支持 `stock` |
| `limit` | 否 | 返回數量，默認 50，范圍 `1–200` |
| `from` | 否 | 起始日期，格式 `YYYY-MM-DD` |
| `to` | 否 | 結束日期，格式 `YYYY-MM-DD` |

<Note>`from` 和 `to` 必須同時提供或同時省略。</Note>

## 請求示例

```bash theme={null}
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.tickdb.ai/v1/fundamentals/news?symbol=AAPL&type=stock&limit=20"
```

## 返回字段說明

以下列出 `data` 中的字段；外層 `code=0` 表示成功。

| 字段 | 說明 |
| - | - |
| symbol | 股票代碼。 |
| limit | 本次請求的返回條數上限。 |
| news | 新聞列表。 |
| └─ news\_id | 新聞 ID，可用於查詢詳情。 |
| └─ title | 新聞標題。 |
| └─ description | 新聞摘要。 |
| └─ published\_at | 發布時間，RFC 3339 日期時間字符串（UTC）。 |
| └─ has\_body | 是否有可用正文。 |

新聞列表返回 `news_id`、標題、摘要、發布時間和正文可用狀態，不直接內嵌正文。使用 `news_id` 查詢新聞詳情。


## OpenAPI

````yaml openapi.zh-Hant.yaml GET /v1/fundamentals/news
openapi: 3.1.0
info:
  title: TickDB API
  description: TickDB 統一即時行情數據 API，提供 REST 和 WebSocket 接入。
  version: 1.0.3
  contact:
    email: support@tickdb.ai
servers:
  - url: https://api.tickdb.ai
    description: 正式環境
security:
  - ApiKeyAuth: []
paths:
  /v1/fundamentals/news:
    get:
      tags:
        - fundamentals-events
      summary: 個股新聞
      description: 獲取個股新聞列表、發布時間和正文可用狀態。
      operationId: getFundamentalsNews
      parameters:
        - $ref: '#/components/parameters/SymbolQuery'
        - $ref: '#/components/parameters/TypeQuery'
        - $ref: '#/components/parameters/NewsLimitQuery'
        - $ref: '#/components/parameters/FromQuery'
        - $ref: '#/components/parameters/ToQuery'
      responses:
        '200':
          $ref: '#/components/responses/NewsResponse'
        default:
          $ref: '#/components/responses/NewsErrorResponse'
components:
  parameters:
    SymbolQuery:
      name: symbol
      in: query
      required: true
      schema:
        type: string
        examples:
          - AAPL
          - '700'
          - '600519'
          - AAPL.US
          - 700.HK
          - 600519.SH
      description: 股票代碼
    TypeQuery:
      name: type
      in: query
      required: false
      schema:
        type: string
        enum:
          - stock
      description: 產品類型，當前支援 `stock`
    NewsLimitQuery:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 50
      description: 返回數量，默認 50，范圍 `1–200`
    FromQuery:
      name: from
      in: query
      required: false
      schema:
        type: string
        format: date
        examples:
          - '2024-01-01T00:00:00.000Z'
      description: 開始日期，格式 `YYYY-MM-DD`
    ToQuery:
      name: to
      in: query
      required: false
      schema:
        type: string
        format: date
        examples:
          - '2026-12-31T00:00:00.000Z'
      description: 結束日期，格式 `YYYY-MM-DD`
  responses:
    NewsResponse:
      description: 個股新聞回應。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NewsEnvelope'
    NewsErrorResponse:
      description: >-
        錯誤回應。常見 HTTP 狀態包括
        400（參數錯誤）、401（驗證失敗）、403（權限或配額限制）、404（無符合條件的數據）、429（請求頻率限制）及 503（服務暫不可用）。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NewsErrorEnvelope'
  schemas:
    NewsEnvelope:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          const: 0
        data:
          $ref: '#/components/schemas/NewsData'
      additionalProperties: false
    NewsErrorEnvelope:
      type: object
      required:
        - code
        - message
      properties:
        code:
          description: TickDB API 業務錯誤碼；可能是整數或字串。
          oneOf:
            - type: integer
            - type: string
        message:
          type: string
          description: 錯誤說明。
        error:
          type: string
          description: 相容錯誤標識；僅部分錯誤回應返回。
        data:
          description: 可選的錯誤上下文。
          oneOf:
            - type: 'null'
            - type: object
              additionalProperties: true
            - type: array
              items: {}
      additionalProperties: true
    NewsData:
      type: object
      required:
        - symbol
        - limit
        - news
      properties:
        symbol:
          type: string
          description: 股票代碼。
        limit:
          type: integer
          description: 本次請求的返回條數上限。
        news:
          type: array
          description: 新聞列表。
          items:
            $ref: '#/components/schemas/NewsItem'
      additionalProperties: false
    NewsItem:
      type: object
      required:
        - news_id
        - title
        - description
        - published_at
        - has_body
      properties:
        news_id:
          type: string
          pattern: ^[1-9][0-9]*$
          description: 新聞 ID，可用於查詢詳情。
        title:
          type: string
          description: 新聞標題。
        description:
          type:
            - string
            - 'null'
          description: 新聞摘要。
        published_at:
          type: string
          format: date-time
          description: 發布時間，RFC 3339 日期時間字符串（UTC）。
        has_body:
          type: boolean
          description: 是否有可用正文。
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.