Video Insights: Summaries/Transcription/Vision

Video Insights: Summaries/Transcription/Vision · Acciones GPT

Video Insights

The Video Insights API endpoint

  • DELETE /api/media/file/{file_id}media_delete

    Deletes a file

  • GET /api/media/file/listmedia_list

    Lists all files

  • GET /api/media/file/transcriptmedia_file_transcript

    Gets the transcript for a media file uploaded on the VideoInsights Platform.

  • POST /api/media/file/visual_analysismedia_file_visual_analysis

    Executes a visual analysis of the media file given a query about it.

  • GET /api/user/informationuser_information

    Gets information about the user making the request

  • POST /api/v1/query/media_filemedia_file_query_v1

    Answers a query about an uploaded video

  • POST /api/v1/query/youtubeyt_query_v1

    Answers a query about a youtube video

  • GET /api/youtube/commentscomments

    Get the top 10 comments for a youtube video

  • GET /api/youtube/metadatametadata

    Get the metadata for a youtube video

  • GET /api/youtube/transcripttranscript

    Get the transcript for a youtube video including the metadata and statistics.

Esquema original API
{
  "openapi": "3.1.0",
  "info": {
    "title": "Video Insights",
    "version": "0.9.0",
    "description": "The Video Insights API endpoint"
  },
  "paths": {
    "/api/media/file/{file_id}": {
      "delete": {
        "operationId": "media_delete",
        "description": "Deletes a file",
        "parameters": [
          {
            "in": "path",
            "name": "file_id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "tags": [
          "media"
        ],
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaDelete"
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/media/file/list": {
      "get": {
        "operationId": "media_list",
        "description": "Lists all files",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            },
            "description": "The media file list page number to get. Defaults to 0 and increments by 1 for longer lists"
          }
        ],
        "tags": [
          "media"
        ],
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFileList"
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/media/file/transcript": {
      "get": {
        "operationId": "media_file_transcript",
        "description": "Gets the transcript for a media file uploaded on the VideoInsights Platform.",
        "parameters": [
          {
            "in": "query",
            "name": "media_file_id",
            "schema": {
              "type": "string"
            },
            "description": "The video ID of the video to get transcript for",
            "required": true
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            },
            "description": "The transcript page number to get. Defaults to 0 and increments by 1 for long transcripts"
          },
          {
            "in": "query",
            "name": "timestamped",
            "schema": {
              "type": "boolean"
            },
            "description": "Whether or not the transcript should include the timestamp values. Defaults to false"
          }
        ],
        "tags": [
          "media"
        ],
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFileList"
                }
              }
            },
            "description": ""
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/media/file/visual_analysis": {
      "post": {
        "operationId": "media_file_visual_analysis",
        "description": "Executes a visual analysis of the media file given a query about it.",
        "tags": [
          "media"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaVisualAnalyzerDeserializer"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/MediaVisualAnalyzerDeserializer"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MediaVisualAnalyzerDeserializer"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaVisualAnalyzer"
                }
              }
            },
            "description": ""
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          }
        },
        "x-openai-isConsequential": true
      }
    },
    "/api/user/information": {
      "get": {
        "operationId": "user_information",
        "description": "Gets information about the user making the request",
        "tags": [
          "user"
        ],
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInformation"
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/v1/query/media_file": {
      "post": {
        "operationId": "media_file_query_v1",
        "description": "Answers a query about an uploaded video",
        "tags": [
          "query"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaFileQuery"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/MediaFileQuery"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MediaFileQuery"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFileQueryResponse"
                }
              }
            },
            "description": ""
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/v1/query/youtube": {
      "post": {
        "operationId": "yt_query_v1",
        "description": "Answers a query about a youtube video",
        "tags": [
          "query"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YTQuery"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/YTQuery"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/YTQuery"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YTQueryResponse"
                }
              }
            },
            "description": ""
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/youtube/comments": {
      "get": {
        "operationId": "comments",
        "description": "Get the top 10 comments for a youtube video",
        "parameters": [
          {
            "in": "query",
            "name": "video_id",
            "schema": {
              "type": "string"
            },
            "description": "The video ID of the video to get comments for",
            "required": true
          }
        ],
        "tags": [
          "youtube"
        ],
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/YoutubeTranscript"
                  }
                }
              }
            },
            "description": ""
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/youtube/metadata": {
      "get": {
        "operationId": "metadata",
        "description": "Get the metadata for a youtube video",
        "parameters": [
          {
            "in": "query",
            "name": "video_id",
            "schema": {
              "type": "string"
            },
            "description": "The video ID of the video to get metadata for",
            "required": true
          }
        ],
        "tags": [
          "youtube"
        ],
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YoutubeMetadata"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/youtube/transcript": {
      "get": {
        "operationId": "transcript",
        "description": "Get the transcript for a youtube video including the metadata and statistics. ",
        "parameters": [
          {
            "in": "query",
            "name": "language",
            "schema": {
              "type": "string"
            },
            "description": "[Optional] Language code for the transcript being requested (e.g., 'en', 'es', 'fr'). Defaults to 'en'."
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            },
            "description": "The transcript page number to get. Defaults to 0 and increments by 1 for long transcripts"
          },
          {
            "in": "query",
            "name": "timestamped",
            "schema": {
              "type": "boolean"
            },
            "description": "Whether or not the transcript should include the timestamp values. Defaults to false"
          },
          {
            "in": "query",
            "name": "video_id",
            "schema": {
              "type": "string"
            },
            "description": "The video ID of the video to get transcript for",
            "required": true
          }
        ],
        "tags": [
          "youtube"
        ],
        "security": [
          {
            "VideoInsightsAuthentication": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YoutubeTranscript"
                }
              }
            },
            "description": ""
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericError"
                }
              }
            },
            "description": ""
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GenericError": {
        "type": "object",
        "properties": {
          "error": {}
        },
        "required": [
          "error"
        ]
      },
      "MediaDelete": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "file_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "file_id",
          "status"
        ]
      },
      "MediaFile": {
        "type": "object",
        "properties": {
          "uploaded_at": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "size": {
            "type": "number",
            "format": "double"
          },
          "md5": {
            "type": "string"
          },
          "audio_parsed": {
            "type": "boolean"
          },
          "runtime_seconds": {
            "type": "integer"
          }
        },
        "required": [
          "audio_parsed",
          "id",
          "md5",
          "name",
          "runtime_seconds",
          "size",
          "type",
          "uploaded_at"
        ]
      },
      "MediaFileList": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaFile"
            }
          },
          "page": {
            "type": "integer"
          },
          "max_pages": {
            "type": "integer"
          },
          "has_more_pages": {
            "type": "boolean"
          },
          "user": {
            "type": "string"
          }
        },
        "required": [
          "files",
          "has_more_pages",
          "max_pages",
          "page",
          "user"
        ]
      },
      "MediaFileQuery": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "The question about the video"
          },
          "media_id": {
            "type": "string",
            "description": "The media id of the video"
          },
          "visual_query": {
            "type": "boolean",
            "nullable": true,
            "default": false,
            "description": "If true, the query is a visual analysis, incurring more cost"
          },
          "mode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ModeEnum"
              }
            ],
            "default": "NORMAL",
            "description": "The only analysis mode is 'normal'"
          }
        },
        "required": [
          "media_id",
          "query"
        ]
      },
      "MediaFileQueryResponse": {
        "type": "object",
        "properties": {
          "response": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "media_id": {
            "type": "string"
          },
          "completed": {
            "type": "boolean",
            "default": false
          },
          "vi_tokens_used": {
            "nullable": true
          }
        },
        "required": [
          "media_id",
          "query",
          "response",
          "vi_tokens_used"
        ]
      },
      "MediaVisualAnalyzer": {
        "type": "object",
        "properties": {
          "query_response": {
            "type": "string"
          },
          "returned_page": {
            "type": "integer"
          },
          "has_more_pages": {
            "type": "boolean"
          },
          "total_num_pages": {
            "type": "integer"
          },
          "in_progress": {
            "type": "boolean"
          }
        },
        "required": [
          "has_more_pages",
          "in_progress",
          "query_response",
          "returned_page",
          "total_num_pages"
        ]
      },
      "MediaVisualAnalyzerDeserializer": {
        "type": "object",
        "properties": {
          "file_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "query": {
            "type": "string"
          },
          "page": {
            "type": "integer"
          }
        },
        "required": [
          "file_uuid",
          "page",
          "query"
        ]
      },
      "ModeEnum": {
        "enum": [
          "NORMAL",
          "FRAME_BY_FRAME",
          "THIRTY_SECONDS"
        ],
        "type": "string",
        "description": "* `NORMAL` - NORMAL\n* `FRAME_BY_FRAME` - FRAME_BY_FRAME\n* `THIRTY_SECONDS` - THIRTY_SECONDS"
      },
      "UserInformation": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "joined": {
            "type": "string",
            "format": "date-time"
          },
          "current_plan": {
            "type": "string"
          },
          "vi_tokens_unused": {
            "type": "integer"
          },
          "vi_tokens_used": {
            "type": "integer"
          },
          "token_reset_date": {
            "type": "string"
          },
          "token_reset_timestamp": {
            "type": "integer"
          }
        },
        "required": [
          "current_plan",
          "email",
          "joined",
          "token_reset_date",
          "token_reset_timestamp",
          "vi_tokens_unused",
          "vi_tokens_used"
        ]
      },
      "YTQuery": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "video_id": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "default": "en"
          }
        },
        "required": [
          "query",
          "video_id"
        ]
      },
      "YTQueryResponse": {
        "type": "object",
        "properties": {
          "response": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "video_id": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "completed": {
            "type": "boolean",
            "default": false
          },
          "vi_tokens_used": {
            "nullable": true
          }
        },
        "required": [
          "language",
          "query",
          "response",
          "vi_tokens_used",
          "video_id"
        ]
      },
      "YoutubeMetadata": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "license": {
            "type": "string"
          },
          "madeForKids": {
            "type": "boolean"
          },
          "duration": {
            "type": "string"
          },
          "statistics": {
            "$ref": "#/components/schemas/YoutubeStatistics"
          }
        },
        "required": [
          "description",
          "duration",
          "license",
          "madeForKids",
          "publishedAt",
          "statistics",
          "tags",
          "title"
        ]
      },
      "YoutubeStatistics": {
        "type": "object",
        "properties": {
          "viewCount": {
            "type": "integer"
          },
          "likeCount": {
            "type": "integer"
          },
          "favoriteCount": {
            "type": "integer"
          },
          "commentCount": {
            "type": "integer"
          }
        },
        "required": [
          "commentCount",
          "favoriteCount",
          "likeCount",
          "viewCount"
        ]
      },
      "YoutubeTranscript": {
        "type": "object",
        "properties": {
          "timestamped": {
            "type": "boolean"
          },
          "transcript": {},
          "returned_page": {
            "type": "integer"
          },
          "has_more_pages": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/YoutubeMetadata"
          }
        },
        "required": [
          "has_more_pages",
          "metadata",
          "returned_page",
          "timestamped",
          "transcript"
        ]
      }
    },
    "securitySchemes": {
      "VideoInsightsAuthentication": {
        "type": "Bearer",
        "in": "header",
        "name": "Authorization",
        "description": "Bearer-based authentication with required prefix 'Bearer'"
      }
    }
  },
  "servers": [
    {
      "url": "https://action.videoinsights.ai"
    }
  ]
}