FetchPI
登入

YouTube post API

一次 REST 呼叫取得 YouTube post 資料——以 FetchPI 全平台共用的穩定 JSON 結構標準化輸出。

  • 1 個已發布端點
  • GET /v1/youtube/posts/{id}

契約摘要(英文): Get a normalized YouTube video (capability youtube.post)

標準化回應實體
youtube/post
capability
youtube.post

每個回應都附帶新鮮度(cache / default / live)與計費中繼資料。

使用場景

  • 為內容分析管線提供結構化的 {{platform}} 貼文:內文、指標、時間戳記與媒體引用。
  • 支撐需要原始內容與互動數據的審核、研究與監測流程。
  • 以穩定的標準化 JSON 歸檔 {{platform}} 內容,告別脆弱的網頁爬取。

回應欄位

YouTube Video Post (normalized)

Normalized YouTube video. Provider-private fields MUST NOT appear. Metric names are frozen (views/likes/comments — 观播放/赞/评); hidden counts normalize to 0. `title` is the platform extension field (the video headline — text carries the description). author and created_at are nullable: search/list cards may omit the channel block and the web surface sometimes ships only relative publish-time text ("2 weeks ago" — lossy, never fabricated into an instant; a present-but-unparsable timestamp still fails).

欄位類型必填說明
idstring必填Video id.
platform"youtube"必填—
type"post"必填—
author.idstring必填Channel id (UC…).
author.usernamestring必填Channel @handle; the channel id when no handle exists.
author.display_namestring | null可選Channel title.
author.verifiedboolean可選—
titlestring | null可選The video headline.
textstring | null可選The video description.
created_atstring | null必填Publish time, UTC RFC3339; null when the card ships only relative text.
metrics.viewsinteger必填View (play) count.
metrics.likesinteger必填Like count; 0 when hidden.
metrics.commentsinteger必填—
attachmentsobject[]可選The video attachment (thumbnail preview + duration when exposed).
fetched_atstring必填—

欄位備註為契約英文原文。

回應中繼資料

欄位類型必填說明
modecache | default | live必填Effective mode after merging param > max_age > source policy (D-004).
age_secondsinteger | null可選Age of served data; null when unknown.
source_layercache | db | upstream必填Which layer served the response (PRD §10).
staleboolean可選True when stale data was served under stale_if_error / SWR (D-004).
billing.amount_creditsinteger必填Micro-USD (1e-6 USD) actually charged for this request.
billing.cache_hitboolean必填—

欄位備註為契約英文原文。

請求與回應範例

GET/v1/youtube/posts/{id}
curl -H "Authorization: Bearer $MESHDATA_API_KEY" \
  "https://api.fetchpi.com/v1/youtube/posts/1842951234567890123"
{
  "data": {
    "id": "wSimVideo0001",
    "platform": "youtube",
    "type": "post",
    "author": {
      "id": "UCsim0000000000000000777",
      "username": "creatordev",
      "display_name": "Creator Dev",
      "verified": true
    },
    "title": "One API for every platform.",
    "text": "One API for every platform.",
    "created_at": "2026-09-17T12:34:56Z",
    "metrics": {
      "views": 154203,
      "likes": 864,
      "comments": 42
    },
    "attachments": [
      {
        "type": "video",
        "preview_image_url": "https://cdn.example.com/thumb.jpg",
        "duration_ms": 212000
      }
    ],
    "fetched_at": "2026-09-18T07:30:00Z"
  },
  "meta": {
    "request_id": "req_01HTXQ8Z9HTQ",
    "freshness": {
      "mode": "default",
      "age_seconds": 3600,
      "source_layer": "cache",
      "stale": false
    },
    "billing": {
      "amount_credits": 0,
      "cache_hit": true
    }
  }
}

免費試用

註冊免費帳號、取得 API Key,即可在瀏覽器版 Playground 直接呼叫該端點。

在 Playground 試用

該端點的參數表、錯誤碼與回應語義見 API 文件。

查看端點參考

常見問題

回應包含哪些內容欄位?

回應攜帶標準化的內容實體(內文、作者、時間戳記、互動指標與媒體引用),欄位見下方欄位表,並附帶新鮮度與計費中繼資料。

可以免費試用該端點嗎?

可以——註冊帳號、取得 API Key 後,即可在主控台的 Playground 呼叫該端點。

post 能力怎麼計費?

Data API 按請求以點數計費,cache/live 新鮮度有不同倍率。目前各能力的價格以價格頁為準。

價格

按請求以點數計費,支援 cache/live 新鮮度選項——最新價格以價格頁為準。