# Get a video

`GET /api/v1/videos/{id}`

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, id | UUIDv4 | shortUUID, required) - The object id, uuid or short uuid
  Type: id | UUIDv4 | shortUUID
  
  oneOf:
    Reference: [id](https://sourcey-peertube.pages.dev/api-rest-reference/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://sourcey-peertube.pages.dev/api-rest-reference/models/uuidv4.md); Type: UUIDv4, uuid
    
    minLength: 36
    
    maxLength: 36
    
    pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    
    Example:
    
    ```json
    "9c9de5e8-0a1e-484a-b099-e80766180a6d"
    ```
  
    Reference: [shortUUID](https://sourcey-peertube.pages.dev/api-rest-reference/models/shortuuid.md); Type: shortUUID
    
    translation of a uuid v4 with a bigger alphabet to have a shorter uuid
    
    Example:
    
    ```json
    "2y84q2MQUMWPbiEcxNXMgC"
    ```

- `x-peertube-video-password` (header, string, optional) - Required on password protected video
  Type: string

Responses:

- 200: successful operation

Content type: application/json

Type: Video & object

Schema: [VideoDetails](https://sourcey-peertube.pages.dev/api-rest-reference/models/videodetails.md)

allOf:
  Reference: [Video](https://sourcey-peertube.pages.dev/api-rest-reference/models/video.md); Type: Video

  Type: object
  
  - `viewers` (optional)
    Type: integer
    
    If the video is a live, you have the amount of current viewers
  
  - `description` (optional)
    Type: string; nullable
    
    full description of the video, written in Markdown.
    
    
    minLength: 3
    
    maxLength: 1000
    
    Example:
    
    ```json
    "\"**[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\\r\\n\\r\\n\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\\r\\n*A decentralized video hosting network,\nbased on free/libre software!*\\r\\n\\r\\n**Animation Produced by:** [LILA](https://libreart.info) - [ZeMarmot Team](https://film.zemarmot.net)\\r\\n\n*Directed by* Aryeom\\r\\n*Assistant* Jehan\\r\\n**Licence**: [CC-By-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)\\r\\n\\r\\n\n**Sponsored by** [Framasoft](https://framasoft.org)\\r\\n\\r\\n**Music**: [Red Step Forward](http://play.dogmazic.net/song.php?song_id=52491) - CC-By Ken Bushima\\r\\n\\r\\n\n**Movie Clip**: [Caminades 3: Llamigos](http://www.caminandes.com/) CC-By Blender Institute\\r\\n\\r\\n**Video sources**: https://gitlab.gnome.org/Jehan/what-is-peertube/\"\n"
    ```
  
  - `support` (optional)
    Type: string; nullable
    
    A text tell the audience how to support the video creator
    
    minLength: 3
    
    maxLength: 1000
    
    Example:
    
    ```json
    "Please support our work on https://soutenir.framasoft.org/en/ <3"
    ```
  
  - `channel` (optional)
    Reference: [VideoChannel](https://sourcey-peertube.pages.dev/api-rest-reference/models/videochannel.md); Type: Actor & object
  
  - `account` (optional)
    Reference: [Account](https://sourcey-peertube.pages.dev/api-rest-reference/models/account.md); Type: Actor & any
  
  - `tags` (optional)
    Type: Array<string>
    
    minItems: 1
    
    maxItems: 5
    
    Example:
    
    ```json
    [
      "flowers",
      "gardening"
    ]
    ```
    
    Items:
      Type: string
      
      minLength: 2
      
      maxLength: 30
  
  - `commentsPolicy` (optional)
    Reference: [VideoCommentsPolicyConstant](https://sourcey-peertube.pages.dev/api-rest-reference/models/videocommentspolicyconstant.md); Type: VideoCommentsPolicyConstant
  
  - `downloadEnabled` (optional)
    Type: boolean
  
  - `inputFileUpdatedAt` (optional)
    Type: string, date-time; nullable
    
    Latest input file update. Null if the file has never been replaced since the original upload
  
  - `trackerUrls` (optional)
    Type: Array<string>
    
    WebTorrent (`ws://` or `wss://`) and BitTorrent (`http://` or `https://`) trackers of the video
    
    
    Example:
    
    ```json
    [
      "https://peertube2.cpy.re/tracker/announce",
      "wss://peertube2.cpy.re/tracker/socket"
    ]
    ```
    
    Items:
      Type: string, url
  
  - `files` (optional)
    Type: Array<VideoFile>
    
    Web compatible video files. If Web Video is disabled on the server:
    
    - field will be empty
    - video files will be found in `streamingPlaylists[].files` field
    
    
    Items:
      Reference: [VideoFile](https://sourcey-peertube.pages.dev/api-rest-reference/models/videofile.md); Type: VideoFile
  
  - `streamingPlaylists` (optional)
    Type: Array<VideoStreamingPlaylists>
    
    HLS playlists/manifest files. If HLS is disabled on the server:
    
    - field will be empty
    - video files will be found in `files` field
    
    
    Items:
      Reference: [VideoStreamingPlaylists](https://sourcey-peertube.pages.dev/api-rest-reference/models/videostreamingplaylists.md); Type: object & VideoStreamingPlaylists-HLS

- 401: Requires authentication or the video requires a password

Content type: application/json

Type: ServerError

Schema: [ServerError](https://sourcey-peertube.pages.dev/api-rest-reference/models/servererror.md)

- `type` (optional)
  Type: string, uri-reference
  
  URI identifying the error type. `about:blank` when the error has no specific type. Otherwise it links to the corresponding section of the [Errors](#section/Errors) documentation; the type name itself is also available in `code`.
  
  
  Example:
  
  ```json
  "/api-rest-reference.html#section/Errors/video_requires_password"
  ```

- `detail` (optional)
  Type: string
  
  Example:
  
  ```json
  "Please provide a password to access this password protected video"
  ```

- `status` (optional)
  Type: integer
  
  Example:
  
  ```json
  403
  ```

- `code` (optional)
  Type: string
  
  Example:
  
  ```json
  "video_requires_password"
  ```

- 403: Invalid authentication or the video requires a password

Content type: application/json

Type: ServerError

Schema: [ServerError](https://sourcey-peertube.pages.dev/api-rest-reference/models/servererror.md)

- `type` (optional)
  Type: string, uri-reference
  
  URI identifying the error type. `about:blank` when the error has no specific type. Otherwise it links to the corresponding section of the [Errors](#section/Errors) documentation; the type name itself is also available in `code`.
  
  
  Example:
  
  ```json
  "/api-rest-reference.html#section/Errors/video_requires_password"
  ```

- `detail` (optional)
  Type: string
  
  Example:
  
  ```json
  "Please provide a password to access this password protected video"
  ```

- `status` (optional)
  Type: integer
  
  Example:
  
  ```json
  403
  ```

- `code` (optional)
  Type: string
  
  Example:
  
  ```json
  "video_requires_password"
  ```

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/videos/42'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/videos/42', {
  method: 'GET',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get('https://peertube2.cpy.re/api/v1/videos/42')
print(response.text)
```
