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

# 获取作品数据

> 接口说明：获取指定作品的分析数据



## OpenAPI

````yaml /openapi/zh/aitoearn.openapi.json get /api/v2/channels/works/{platform}/{platformWorkId}/analytics
openapi: 3.0.1
info:
  title: AiToEarn 开放平台 API
  description: AiToEarn 开放平台 API，支持在中国站与国际站之间切换调试。业务是否成功以响应体 code === 0 为准。
  version: 1.0.0
  contact: {}
servers:
  - url: https://aitoearn.cn
    description: 中国站
  - url: https://aitoearn.ai
    description: 国际站
security: []
tags:
  - name: AI 服务
  - name: AI 服务/视频生成
  - name: AI 服务/图像生成
  - name: AI 服务/模型中转
  - name: 渠道管理
  - name: 渠道管理/账号
  - name: 渠道管理/内容发布
  - name: 渠道管理/平台
  - name: 渠道管理/互动
  - name: 渠道管理/作品
  - name: 渠道管理/账号分组
  - name: 渠道管理/授权
  - name: 资源管理
paths:
  /api/v2/channels/works/{platform}/{platformWorkId}/analytics:
    get:
      tags:
        - 渠道管理/作品
      summary: 获取作品数据
      description: 接口说明：获取指定作品的分析数据
      operationId: WorksController_getAnalytics_v2
      parameters:
        - name: platform
          in: path
          description: 平台标识
          required: true
          example: ''
          schema:
            type: string
        - name: platformWorkId
          in: path
          description: 平台作品 ID
          required: true
          example: ''
          schema:
            type: string
        - name: accountId
          in: query
          description: 账号 ID
          required: false
          example: ''
          schema:
            description: 账号 ID
            type: string
            minLength: 1
        - name: since
          in: query
          description: 开始时间
          required: false
          example: ''
          schema:
            description: 开始时间
            type: string
            format: date-time
        - name: until
          in: query
          description: 结束时间
          required: false
          example: ''
          schema:
            description: 结束时间
            type: string
            format: date-time
      responses:
        '200':
          description: 请求已被服务处理。业务是否成功以响应体 code === 0 为准。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ChannelWorkAnalyticsVo'
                  code:
                    type: integer
                    description: 业务状态码。0 表示成功，非 0 表示业务错误。
                  message:
                    type: string
                    description: 响应消息。
                  requestId:
                    type: string
                    description: 请求 ID。
                  timestamp:
                    type: integer
                    description: 错误响应时间戳，Unix 毫秒。
                required:
                  - code
                  - message
              examples:
                success:
                  summary: 成功
                  value:
                    code: 0
                    message: 请求成功
                    data:
                      platform: douyin
                      platformWorkId: string
                      accountId: string
                      work:
                        id: string
                        url: string
                        title: string
                        description: string
                        mediaType: string
                        coverUrl: string
                        publishedAt: '2026-07-02T12:00:00.000Z'
                        status: string
                        author: string
                      metrics:
                        viewCount: 1
                        playCount: 1
                        impressionCount: 1
                        reachCount: 1
                        likeCount: 1
                        collectCount: 1
                        commentCount: 1
                        shareCount: 1
                        saveCount: 1
                        clickCount: 1
                        engagementCount: 1
                        watchTimeSeconds: 1
                      snapshots: []
                      extra: {}
                      snapshotId: string
                      fetchedAt: '2026-07-02T12:00:00.000Z'
                      message: string
                validationFailed10002:
                  summary: ValidationFailed (10002)
                  value:
                    code: 10002
                    message: 参数验证失败
                    data: {}
                    timestamp: 1772099056662
                unauthorized401:
                  summary: 未认证或 API Key 无效
                  value:
                    code: 401
                    message: Unauthorized
                    data: {}
                    timestamp: 1772099056662
      deprecated: false
      security:
        - apikey-header-X-Api-Key: []
components:
  schemas:
    ChannelWorkAnalyticsVo:
      type: object
      properties:
        platform:
          type: string
          enum:
            - douyin
            - xhs
            - wxSph
            - KWAI
            - youtube
            - wxGzh
            - bilibili
            - twitter
            - tiktok
            - facebook
            - instagram
            - threads
            - pinterest
            - linkedin
            - google_business
          description: 平台
        accountId:
          type: string
          description: 账号 ID
        platformWorkId:
          description: 平台作品 ID
          type: string
        work:
          description: 作品资料
          type: object
          properties:
            id:
              description: 平台作品 ID
              type: string
            url:
              description: 作品链接
              type: string
            title:
              description: 作品标题
              type: string
            description:
              description: 作品描述
              type: string
            mediaType:
              description: 作品媒体类型
              type: string
            coverUrl:
              description: 封面 URL
              type: string
            publishedAt:
              description: 发布时间
              type: string
              format: date-time
            status:
              description: 作品状态
              type: string
            author:
              description: 作者
              type: string
          required:
            - id
        metrics:
          description: 作品指标
          type: object
          properties:
            viewCount:
              description: 浏览数
              type: number
            playCount:
              description: 播放数
              type: number
            impressionCount:
              description: 曝光数
              type: number
            reachCount:
              description: 触达数
              type: number
            likeCount:
              description: 点赞数
              type: number
            collectCount:
              description: 收藏数
              type: number
            commentCount:
              description: 评论数
              type: number
            shareCount:
              description: 分享数
              type: number
            saveCount:
              description: 保存数
              type: number
            clickCount:
              description: 点击数
              type: number
            engagementCount:
              description: 互动数
              type: number
            watchTimeSeconds:
              description: 观看时长秒数
              type: number
        snapshots:
          default: []
          description: 本次保存的作品数据快照
          type: array
          items:
            type: object
            properties:
              id:
                description: 快照 ID
                type: string
              platformWorkId:
                description: 平台作品 ID
                type: string
              snapshotAt:
                description: 快照对应时间
                type: string
                format: date-time
              fetchedAt:
                description: 平台数据获取时间
                type: string
                format: date-time
              periodStartAt:
                description: 区间开始时间
                type: string
                format: date-time
              periodEndAt:
                description: 区间结束时间
                type: string
                format: date-time
              work:
                description: 作品资料
                type: object
                properties:
                  id:
                    description: 平台作品 ID
                    type: string
                  url:
                    description: 作品链接
                    type: string
                  title:
                    description: 作品标题
                    type: string
                  description:
                    description: 作品描述
                    type: string
                  mediaType:
                    description: 作品媒体类型
                    type: string
                  coverUrl:
                    description: 封面 URL
                    type: string
                  publishedAt:
                    description: 发布时间
                    type: string
                    format: date-time
                  status:
                    description: 作品状态
                    type: string
                  author:
                    description: 作者
                    type: string
                required:
                  - id
              metrics:
                description: 作品指标
                type: object
                properties:
                  viewCount:
                    description: 浏览数
                    type: number
                  playCount:
                    description: 播放数
                    type: number
                  impressionCount:
                    description: 曝光数
                    type: number
                  reachCount:
                    description: 触达数
                    type: number
                  likeCount:
                    description: 点赞数
                    type: number
                  collectCount:
                    description: 收藏数
                    type: number
                  commentCount:
                    description: 评论数
                    type: number
                  shareCount:
                    description: 分享数
                    type: number
                  saveCount:
                    description: 保存数
                    type: number
                  clickCount:
                    description: 点击数
                    type: number
                  engagementCount:
                    description: 互动数
                    type: number
                  watchTimeSeconds:
                    description: 观看时长秒数
                    type: number
              extra:
                description: 平台特殊字段
                type: object
                additionalProperties: true
                properties: {}
            required:
              - snapshotAt
              - fetchedAt
              - work
        extra:
          description: 平台特殊字段
          type: object
          additionalProperties: true
          properties: {}
        snapshotId:
          description: 本次主快照 ID
          type: string
        fetchedAt:
          description: 平台数据获取时间
          type: string
          format: date-time
        message:
          description: 提示信息
          type: string
      required:
        - platform
        - platformWorkId
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: AiToEarn Open Platform API Key。

````