8
0
youtubekids-api-design/.insomnia/ApiSpec/spc_2b420b2bed1d4d868807303a581fb8c1.yml

438 lines
12 KiB
YAML
Raw Normal View History

2023-03-27 11:48:41 +00:00
_id: spc_2b420b2bed1d4d868807303a581fb8c1
type: ApiSpec
parentId: wrk_cd1160cf39f5497fa4711fe4fd6567de
2023-03-28 15:36:33 +00:00
modified: 1680017776645
2023-03-27 11:48:41 +00:00
created: 1679916396495
fileName: youtubekids.yaml
contents: >+
2023-03-27 11:48:41 +00:00
openapi: 3.0.3
2023-03-27 12:15:51 +00:00
2023-03-27 11:48:41 +00:00
info:
title: YouTube Kids Public API
2023-03-27 11:51:54 +00:00
description: For generate API REST clients for Feelter UGC
2023-03-27 11:48:41 +00:00
contact:
2023-03-27 11:51:54 +00:00
email: garin1221@yandex.ru
2023-03-27 11:48:41 +00:00
version: 1.0.0
2023-03-27 12:15:51 +00:00
2023-03-27 11:48:41 +00:00
servers:
- url: https://www.youtubekids.com/youtubei/v1
2023-03-27 12:15:51 +00:00
2023-03-27 11:48:41 +00:00
tags:
- name: browse
description: Browse resource content
2023-03-27 12:15:51 +00:00
2023-03-27 11:48:41 +00:00
paths:
2023-03-27 12:15:51 +00:00
# Получение контента определенного ресурса, {browseId}
2023-03-27 11:48:41 +00:00
/browse:
post:
tags:
- browse
summary: Browse resource content
description: Get content for resource
operationId: browse
requestBody:
2023-03-28 14:27:34 +00:00
required: true
2023-03-27 11:48:41 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/BrowseRequestPayload'
2023-03-27 11:48:41 +00:00
responses:
'200':
2023-03-28 14:27:34 +00:00
description: OK
2023-03-28 14:17:25 +00:00
content:
'application/json':
"schema":
2023-03-28 14:27:34 +00:00
$ref: '#/components/schemas/BrowseResponsePayload'
'400':
description: Bad Request
content:
'application/json':
"schema":
$ref: '#/components/schemas/ErrorResponsePayload'
2023-03-27 12:15:51 +00:00
# Компоненты
2023-03-27 11:48:41 +00:00
components:
2023-03-27 12:15:51 +00:00
# Схемы данных
2023-03-27 11:48:41 +00:00
schemas:
2023-03-27 12:15:51 +00:00
2023-03-28 14:27:34 +00:00
# Ошибка
Error:
type: object
properties:
message:
type: string
domain:
type: string
reason:
type: string
2023-03-28 14:17:25 +00:00
# Доступность данных
AccessibilityData:
type: object
properties:
label:
type: string
# Доступность
Accessibility:
type: object
properties:
accessibilityData:
$ref: '#/components/schemas/AccessibilityData'
# WatchEndpoint
WatchEndpoint:
type: object
properties:
videoId:
type: string
# BrowseEndpoint
BrowseEndpoint:
type: object
properties:
browseId:
type: string
canonicalBaseUrl:
type: string
# Конечная точка навигации
NavigationEndpoint:
type: object
properties:
clickTrackingParams:
type: string
watchEndpoint:
$ref: '#/components/schemas/WatchEndpoint'
browseEndpoint:
$ref: '#/components/schemas/BrowseEndpoint'
# Текст -> Runs
TextRun:
type: object
properties:
text:
type: string
navigationEndpoint:
$ref: '#/components/schemas/NavigationEndpoint'
# Текст
Text:
type: object
properties:
runs:
type: array
items:
$ref: '#/components/schemas/TextRun'
accessibility:
$ref: '#/components/schemas/Accessibility'
# Строковый параметр ключ-зачение
KeyStringValue:
type: object
properties:
key:
type: string
value:
type: string
# Ассеты категории
CategoryAssets:
type: object
properties:
assetKey:
type: string
backgroundColor:
type: string
# Расширение для владельцев детских видео
KidsVideoOwnerExtension:
type: object
properties:
externalChannelId:
type: string
2023-03-28 15:36:33 +00:00
# Thumbnail
Thumbnail:
type: object
properties:
url:
type: string
width:
type: number
height:
type: number
2023-03-28 14:17:25 +00:00
# Компактный видеорендерер
CompactVideoRenderer:
type: object
properties:
videoId:
type: string
2023-03-28 15:36:33 +00:00
thumbnail:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
2023-03-28 14:17:25 +00:00
title:
$ref: '#/components/schemas/Text'
longBylineText:
$ref: '#/components/schemas/Text'
publishedTimeText:
$ref: '#/components/schemas/Text'
viewCountText:
$ref: '#/components/schemas/Text'
lengthText:
$ref: '#/components/schemas/Text'
navigationEndpoint:
$ref: '#/components/schemas/NavigationEndpoint'
shortBylineText:
$ref: '#/components/schemas/Text'
2023-03-28 15:36:33 +00:00
channelThumbnail:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
2023-03-28 14:17:25 +00:00
trackingParams:
type: string
shortViewCountText:
$ref: '#/components/schemas/Text'
accessibility:
$ref: '#/components/schemas/Accessibility'
kidsVideoOwnerExtension:
$ref: '#/components/schemas/KidsVideoOwnerExtension'
# Средство визуализации раздела элемента
ItemSectionRenderer:
type: object
properties:
contents:
type: array
items:
type: object
properties:
compactVideoRenderer:
$ref: '#/components/schemas/CompactVideoRenderer'
trackingParams:
type: string
# Рендер списка разделов
SectionListRenderer:
type: object
properties:
contents:
type: array
items:
type: object
properties:
itemSectionRenderer:
$ref: '#/components/schemas/ItemSectionRenderer'
trackingParams:
type: string
# Визуализатор закрепленных сечений
AnchoredSectionRenderer:
type: object
properties:
title:
type: string
content:
type: object
properties:
sectionListRenderer:
$ref: '#/components/schemas/SectionListRenderer'
trackingParams:
type: string
2023-03-28 15:36:33 +00:00
navigationEndpoint:
$ref: '#/components/schemas/NavigationEndpoint'
2023-03-28 14:17:25 +00:00
categoryAssets:
2023-03-28 15:36:33 +00:00
$ref: '#/components/schemas/CategoryAssets'
2023-03-28 14:17:25 +00:00
categoryType:
type: string
# Якорь экрана
ScreenAnchor:
type: object
properties:
anchoredSectionRenderer:
$ref: '#/components/schemas/AnchoredSectionRenderer'
# Рендерер экрана
ScreenRenderer:
type: object
properties:
anchors:
type: array
items:
$ref: '#/components/schemas/ScreenAnchor'
2023-03-28 15:36:33 +00:00
# Средство визуализации заголовка категории
CategoriesHeaderRenderer:
type: object
properties:
trackingParams:
type: string
# TODO
2023-03-28 14:17:25 +00:00
2023-03-27 12:15:51 +00:00
# Параметры контента
KidsAppContentSettings:
type: object
properties:
corpusPreference:
type: string
example: KIDS_CORPUS_PREFERENCE_TWEEN
kidsNoSearchMode:
type: string
example: YT_KIDS_NO_SEARCH_MODE_OFF
2023-03-27 12:15:51 +00:00
# Конфигурация категорий
KidsAppCategorySettings:
type: object
properties:
enabledCategories:
type: array
example: ["approved_for_you", "black_joy", "camp", "collections", "earth", "explore", "favorites", "gaming", "halloween", "hero", "learning", "making", "move", "music", "reading", "shared_by_parents", "shows", "soccer", "sports", "spotlight", "winter"]
items:
type: string
2023-03-27 12:15:51 +00:00
# Параметры приложения
KidsAppInfo:
type: object
description: Kids application configuration
properties:
contentSettings:
$ref: '#/components/schemas/KidsAppContentSettings'
categorySettings:
$ref: '#/components/schemas/KidsAppCategorySettings'
2023-03-27 12:15:51 +00:00
# Информация о клиенте в запросе
2023-03-27 11:48:41 +00:00
RequestClient:
type: object
description: Client information
properties:
clientName:
type: string
example: WEB_KIDS
clientVersion:
type: string
example: 2.20230202.00.00
hl:
type: string
example: ru
gl:
type: string
example: RU
experimentsToken:
type: string
browserName:
type: string
example: Safari
deviceMake:
type: string
example: apple
browserVersion:
type: string
example: '16.2'
osName:
type: string
example: Macintosh
osVersion:
type: string
example: 10_15_7
platform:
type: string
example: DESKTOP
kidsAppInfo:
$ref: '#/components/schemas/KidsAppInfo'
2023-03-27 12:15:51 +00:00
# Контекст запроса
2023-03-27 11:48:41 +00:00
RequestContext:
type: object
description: Request context
2023-03-27 11:48:41 +00:00
properties:
client:
$ref: '#/components/schemas/RequestClient'
2023-03-27 12:15:51 +00:00
2023-03-28 14:17:25 +00:00
# Контекст ответа
ResponseContext:
type: object
description: Response context
properties:
visitorData:
type: string
maxAgeSeconds:
type: number
serviceTrackingParams:
type: array
items:
type: object
properties:
service:
type: string
params:
type: array
items:
$ref: '#/components/schemas/KeyStringValue'
2023-03-27 12:15:51 +00:00
# Данные для запроса на получение контента определенного ресурса
BrowseRequestPayload:
2023-03-27 11:48:41 +00:00
type: object
properties:
context:
$ref: '#/components/schemas/RequestContext'
browseId:
type: string
example: FEkids_home
2023-03-28 14:17:25 +00:00
# Ответ на запрос получения контента определенного ресурса
2023-03-28 14:27:34 +00:00
BrowseResponsePayload:
2023-03-28 14:17:25 +00:00
type: object
properties:
responseContext:
$ref: '#/components/schemas/ResponseContext'
2023-03-28 15:36:33 +00:00
header:
type: object
properties:
kidsCategoriesHeaderRenderer:
$ref: '#/components/schemas/CategoriesHeaderRenderer'
2023-03-28 14:17:25 +00:00
contents:
type: object
properties:
kidsHomeScreenRenderer:
$ref: '#/components/schemas/ScreenRenderer'
trackingParams:
type: string
2023-03-28 14:27:34 +00:00
# Ответ с ошибкой
ErrorResponsePayload:
type: object
properties:
error:
type: object
properties:
code:
type: number
example: 400
message:
type: string
errors:
type: array
items:
$ref: '#/components/schemas/Error'
status:
type: string
example: FAILED_PRECONDITION
2023-03-27 11:48:41 +00:00
contentType: yaml