Skip to content

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

MethodPathDescription
GET/channel/{channel_id}Gets archived videos from a particular channel
GET/channel_nameGets archived videos from a particular channel
GET/daily_featured_videosGet today's daily features videos
GET/database/statusGet the status of the database
GET/database/video_data/{video_id}Get detailed information about the video if available
GET/discover_videosGet multiple random videos
GET/random_videoGet a singular random video
GET/recently_archivedGet the 6 most recently archived videos
GET/search/resultsGet paginated search results for some keyword
GET/storage/statusGet the status of the database
GET/video/{video_id}Get basic information regarding a specific video

Reference Table

NamePathDescription
Channel#/components/schemas/Channel
Video#/components/schemas/Video

Path Details


[GET]/channel/

  • 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
}

  • 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/

  • 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/

  • 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
}