aboutsummaryrefslogtreecommitdiffstats
path: root/repos/patchwork-archive-api.md
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2024-04-07 01:25:07 -0700
committerPinapelz <yukais@pinapelz.com>2024-04-07 01:25:07 -0700
commit3e02c262c7147fc6242c0ad061da0b7a7078c110 (patch)
tree9036047b318df0e9c9c15421d81f6edfa8c0091a /repos/patchwork-archive-api.md
parentc95c0a56cd994ff09c3aee767949a88752642409 (diff)
remove example md files
Diffstat (limited to 'repos/patchwork-archive-api.md')
-rw-r--r--repos/patchwork-archive-api.md366
1 files changed, 366 insertions, 0 deletions
diff --git a/repos/patchwork-archive-api.md b/repos/patchwork-archive-api.md
new file mode 100644
index 0000000..4ccff24
--- /dev/null
+++ b/repos/patchwork-archive-api.md
@@ -0,0 +1,366 @@
+---
+title: Patchwork Archive API Docs
+lang: en-US
+outline: deep
+---
+# Patchwork Archive API
+
+> Version MIT
+
+API data from Patchwork Archive is public and **no API key** is required to access it (subject to change)
+## Path Table
+
+| Method | Path | Description |
+| --- | --- | --- |
+| GET | [/channel/{channel_id}](#get-channel) | Gets archived videos from a particular channel |
+| GET | [/channel_name](#get-channel-name) | Gets archived videos from a particular channel |
+| GET | [/daily_featured_videos](#getdaily_featured_videos) | Get today's daily features videos |
+| GET | [/database/status](#getdatabasestatus) | Get the status of the database |
+| GET | [/database/video_data/{video_id}](#getdatabasevideo_datavideo_id) | Get detailed information about the video if available |
+| GET | [/discover_videos](#getdiscover_videos) | Get multiple random videos |
+| GET | [/random_video](#getrandom_video) | Get a singular random video |
+| GET | [/recently_archived](#getrecently_archived) | Get the 6 most recently archived videos |
+| GET | [/search/results](#getsearchresults) | Get paginated search results for some keyword |
+| GET | [/storage/status](#getstoragestatus) | Get the status of the database |
+| GET | [/video/{video_id}](#getvideovideo_id) | Get basic information regarding a specific video |
+
+## Reference Table
+
+| Name | Path | Description |
+| --- | --- | --- |
+| Channel | [#/components/schemas/Channel](#componentsschemaschannel) | |
+| Video | [#/components/schemas/Video](#componentsschemasvideo) | |
+
+## Path Details
+
+***
+
+### [GET]/channel/{channel_id}
+
+- Summary
+Gets archived videos from a particular channel as a paginated result
+
+- Description
+Gets a paginated result of archived videos matching a channel id. Returns 12 videos per page. Pages is the number of pages available
+
+#### Parameters(Query)
+
+```ts
+page: integer
+```
+
+#### Responses
+
+- 200 successful operation
+
+`application/json`
+
+```ts
+pages: int
+{
+ channel_id: string
+ channel_name: string
+ description: string
+ title: string
+ upload_date: string
+ video_id: string
+}[]
+```
+
+***
+
+### [GET]/channel_name
+
+- Summary
+Gets the name of a particular channel by channel id
+
+- Description
+Returns an alternative JSON if the look up fails or the channel id doesn't exist in the database
+
+#### Parameters(Query)
+
+```ts
+channel_id: string
+```
+
+#### Responses
+
+- 200 successful operation
+
+`application/json`
+
+```ts
+{
+ channel_name?: string
+}
+```
+
+- 200 successful operation but failed look up
+```ts
+{
+ error?: string
+}
+```
+***
+
+### [GET]/daily_featured_videos
+
+- Summary
+Get today's daily featured videos
+
+- Description
+Either 1 or 2 video objects in an array depending on calculated hash
+
+#### Responses
+
+- 200 successful operation
+
+`application/json`
+
+```ts
+{
+ channel_id: string
+ channel_name: string
+ description: string
+ title: string
+ upload_date: string
+ video_id: string
+}[]
+```
+
+***
+
+### [GET]/database/status
+
+- Summary
+Get the status of the database
+
+#### Responses
+
+- 200 successful operation.
+
+`text/plain`
+
+```ts
+{
+ "properties": {
+ "OK": {
+ "type": "string",
+ "example": "OK"
+ }
+ }
+}
+```
+
+- 500 database is down
+
+`application/json`
+
+```ts
+{
+ "properties": {
+ "FAIL": {
+ "type": "string",
+ "example": "500"
+ }
+ }
+}
+```
+
+***
+
+### [GET]/database/video_data/{video_id}
+
+- Summary
+Get detailed information about the video if available
+
+- Description
+If info.json generated by yt-dlp is available it will be directly delivered here, if not, fallback video data from the database is used instead
+
+#### Responses
+
+- 200 successful operation.
+
+`application/json`
+
+```ts
+{
+ channel_id: string
+ channel_name: string
+ description: string
+ title: string
+ upload_date: string
+ video_id: string
+}
+```
+
+***
+
+### [GET]/discover_videos
+
+- Summary
+Gets randomly chosen videos from the database
+
+#### Parameters(Query)
+
+```ts
+count?: integer
+```
+
+#### Responses
+
+- 200 successful operation
+
+`application/json`
+
+```ts
+{
+ channel_id: string
+ channel_name: string
+ description: string
+ title: string
+ upload_date: string
+ video_id: string
+}[]
+```
+
+***
+
+### [GET]/random_video
+
+- Summary
+Get a singular random video
+
+#### Responses
+
+- 200 successful operation
+
+`application/json`
+
+```ts
+{
+ channel_id: string
+ channel_name: string
+ description: string
+ title: string
+ upload_date: string
+ video_id: string
+}
+```
+
+***
+
+### [GET]/recently_archived
+
+- Summary
+Get the 6 most recently archived videos
+
+#### Responses
+
+- 200 successful operation
+
+`application/json`
+
+```ts
+{
+ channel_id: string
+ channel_name: string
+ description: string
+ title: string
+ upload_date: string
+ video_id: string
+}[]
+```
+
+***
+
+### [GET]/search/results
+
+- Summary
+Get paginated search results for some keyword
+
+#### Parameters(Query)
+
+```ts
+q: string
+```
+
+```ts
+page?: integer
+```
+
+#### Responses
+
+- 200 successful operation
+
+`application/json`
+
+```ts
+page: integer
+{
+ channel_id: string
+ channel_name: string
+ description: string
+ title: string
+ upload_date: string
+ video_id: string
+}[]
+```
+
+***
+
+### [GET]/storage/status
+
+- Summary
+Get the status of the database
+
+- Description
+Gets the number of videos archived and space used in GB
+
+#### Responses
+
+- 200 successful operation.
+
+`application/json`
+
+```ts
+number_of_files: integer
+storage_size: string
+```
+
+***
+
+### [GET]/video/{video_id}
+
+- Summary
+Get basic information regarding a specific video
+
+- Description
+Pulls basic information about a video from fallback database only
+
+#### Responses
+
+- 200 successful operation
+
+`application/json`
+
+```ts
+{
+ channel_id?: string
+ channel_name?: string
+ description?: string
+ title?: string
+ upload_date?: string
+ video_id?: string
+}
+```
+
+- 404 Video not found
+
+`application/json`
+
+```ts
+{
+ error?: string
+}
+``` \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage