106 lines
3.4 KiB
YAML
106 lines
3.4 KiB
YAML
openapi: 3.0.0
|
||
info:
|
||
title: CVSA API
|
||
version: v1
|
||
|
||
servers:
|
||
- url: https://api.projectcvsa.com
|
||
|
||
paths:
|
||
/video/{id}/snapshots:
|
||
get:
|
||
summary: 获取视频快照列表
|
||
description: 根据视频 ID 获取视频的快照列表。视频 ID 可以是以 "av" 开头的数字,以 "BV" 开头的 12 位字母数字,或者一个正整数。
|
||
parameters:
|
||
- in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: "视频 ID (如: av78977256, BV1KJ411C7CW, 78977256)"
|
||
- in: query
|
||
name: ps
|
||
schema:
|
||
type: integer
|
||
minimum: 1
|
||
description: 每页返回的快照数量 (pageSize),默认为 1000。
|
||
- in: query
|
||
name: pn
|
||
schema:
|
||
type: integer
|
||
minimum: 1
|
||
description: 页码 (pageNumber),用于分页查询。offset 与 pn 只能选择一个。
|
||
- in: query
|
||
name: offset
|
||
schema:
|
||
type: integer
|
||
minimum: 1
|
||
description: 偏移量,用于基于偏移量的查询。offset 与 pn 只能选择一个。
|
||
- in: query
|
||
name: reverse
|
||
schema:
|
||
type: boolean
|
||
description: 是否反向排序(从旧到新),默认为 false。
|
||
responses:
|
||
'200':
|
||
description: 成功获取快照列表
|
||
content:
|
||
application/json:
|
||
schema:
|
||
type: array
|
||
items:
|
||
type: object
|
||
properties:
|
||
id:
|
||
type: integer
|
||
description: 快照 ID
|
||
aid:
|
||
type: integer
|
||
description: 视频的 av 号
|
||
views:
|
||
type: integer
|
||
description: 视频播放量
|
||
coins:
|
||
type: integer
|
||
description: 视频投币数
|
||
likes:
|
||
type: integer
|
||
description: 视频点赞数
|
||
favorites:
|
||
type: integer
|
||
description: 视频收藏数
|
||
shares:
|
||
type: integer
|
||
description: 视频分享数
|
||
danmakus:
|
||
type: integer
|
||
description: 视频弹幕数
|
||
replies:
|
||
type: integer
|
||
description: 视频评论数
|
||
'400':
|
||
description: 无效的查询参数
|
||
content:
|
||
application/json:
|
||
schema:
|
||
type: object
|
||
properties:
|
||
message:
|
||
type: string
|
||
description: 错误消息
|
||
errors:
|
||
type: object
|
||
description: 详细的错误信息
|
||
'500':
|
||
description: 服务器内部错误
|
||
content:
|
||
application/json:
|
||
schema:
|
||
type: object
|
||
properties:
|
||
message:
|
||
type: string
|
||
description: 错误消息
|
||
error:
|
||
type: object
|
||
description: 详细的错误信息 |