# List videos of an account

`GET /api/v1/accounts/{name}/videos`

Authentication: no security requirement declared for this operation.

Parameters:

- `name` (path, string, required) - The username or handle of the account
  Type: string
  
  Example:
  
  ```json
  "chocobozzz | chocobozzz@example.org"
  ```

- `start` (query, integer, optional) - Offset used to paginate results
  Type: integer
  
  minimum: 0

- `count` (query, integer, optional) - Number of items to return
  Type: integer
  
  default: 15
  
  minimum: 1
  
  maximum: 100

- `skipCount` (query, string, optional) - if you don't need the `total` in the response
  Type: string
  
  default: "false"
  
  enum: ["true","false"]

- `sort` (query, string, optional)
  Type: string
  
  Sort videos by criteria (prefixing with `-` means `DESC` order):
    * `hot` - Adaptation of Reddit "hot" algorithm taking into account video views, likes, dislikes and comments and publication date
    * `best` - Same than `hot`, but also takes into account user video history
    * `trending` - Sort videos by recent views ("recent" is defined by the admin)
    * `views` - Sort videos using their `views` counter
    * `publishedAt` - Sort by video publication date (when it became publicly available)
  
  
  enum: ["name","-duration","-createdAt","-publishedAt","-views","-likes","-comments","-trending","-hot","-best"]

- `nsfw` (query, string, optional) - whether to include nsfw videos, if any
  Type: string
  
  enum: ["true","false"]

- `nsfwFlagsIncluded` (query, NSFWFlag, optional)
  Type: NSFWFlag
  
  
  NSFW flags (can be combined using bitwise or operator)
  - `0` NONE
  - `1` VIOLENT
  - `2` EXPLICIT_SEX
  
  
  Schema: [NSFWFlag](https://sourcey-peertube.pages.dev/api-rest-reference/models/nsfwflag.md)
  
  enum: [0,1,2,4]

- `nsfwFlagsExcluded` (query, NSFWFlag, optional)
  Type: NSFWFlag
  
  
  NSFW flags (can be combined using bitwise or operator)
  - `0` NONE
  - `1` VIOLENT
  - `2` EXPLICIT_SEX
  
  
  Schema: [NSFWFlag](https://sourcey-peertube.pages.dev/api-rest-reference/models/nsfwflag.md)
  
  enum: [0,1,2,4]

- `aiUsageOneOf` (query, VideoAIUsageSet | Array<VideoAIUsageSet>, optional) - **PeerTube >= 9.0** Only list videos with one of these AI usages, declared by video creators.
If not provided, the preference of the authenticated user (`aiUsagesHidden`) is used

  Type: VideoAIUsageSet | Array<VideoAIUsageSet>
  
  oneOf:
    Reference: [VideoAIUsageSet](https://sourcey-peertube.pages.dev/api-rest-reference/models/videoaiusageset.md); Type: VideoAIUsageSet
    
    **PeerTube >= 9.0** Use of AI in the video, declared by the video creator:
      - `1` Not specified
      - `2` No AI-generated content: nothing seen or heard in the video has been generated by AI
      - `3` Contains AI-generated content: some parts of the video have been generated by AI
      - `4` AI-generated: the whole video, or most of it, has been generated by AI
    
    
    enum: [1,2,3,4]
  
    Type: Array<VideoAIUsageSet>
    
    Items:
      Reference: [VideoAIUsageSet](https://sourcey-peertube.pages.dev/api-rest-reference/models/videoaiusageset.md); Type: VideoAIUsageSet
      
      **PeerTube >= 9.0** Use of AI in the video, declared by the video creator:
        - `1` Not specified
        - `2` No AI-generated content: nothing seen or heard in the video has been generated by AI
        - `3` Contains AI-generated content: some parts of the video have been generated by AI
        - `4` AI-generated: the whole video, or most of it, has been generated by AI
      
      
      enum: [1,2,3,4]

- `isLive` (query, boolean, optional) - whether or not the video is a live
  Type: boolean

- `includeScheduledLive` (query, boolean, optional) - whether or not include live that are scheduled for later
  Type: boolean

- `categoryOneOf` (query, VideoCategorySet | Array<VideoCategorySet>, optional) - category id of the video (see [/videos/categories](#operation/getCategories))
  Type: VideoCategorySet | Array<VideoCategorySet>
  
  oneOf:
    Reference: [VideoCategorySet](https://sourcey-peertube.pages.dev/api-rest-reference/models/videocategoryset.md); Type: VideoCategorySet
    
    category id of the video (see [/videos/categories](#operation/getCategories))
    
    Example:
    
    ```json
    15
    ```
  
    Type: Array<VideoCategorySet>
    
    Items:
      Reference: [VideoCategorySet](https://sourcey-peertube.pages.dev/api-rest-reference/models/videocategoryset.md); Type: VideoCategorySet
      
      category id of the video (see [/videos/categories](#operation/getCategories))
      
      Example:
      
      ```json
      15
      ```

- `licenceOneOf` (query, VideoLicenceSet | Array<VideoLicenceSet>, optional) - licence id of the video (see [/videos/licences](#operation/getLicences))
  Type: VideoLicenceSet | Array<VideoLicenceSet>
  
  oneOf:
    Reference: [VideoLicenceSet](https://sourcey-peertube.pages.dev/api-rest-reference/models/videolicenceset.md); Type: VideoLicenceSet
    
    licence id of the video (see [/videos/licences](#operation/getLicences))
    
    Example:
    
    ```json
    2
    ```
  
    Type: Array<VideoLicenceSet>
    
    Items:
      Reference: [VideoLicenceSet](https://sourcey-peertube.pages.dev/api-rest-reference/models/videolicenceset.md); Type: VideoLicenceSet
      
      licence id of the video (see [/videos/licences](#operation/getLicences))
      
      Example:
      
      ```json
      2
      ```

- `languageOneOf` (query, VideoLanguageSet | Array<VideoLanguageSet>, optional) - language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language
  Type: VideoLanguageSet | Array<VideoLanguageSet>
  
  oneOf:
    Reference: [VideoLanguageSet](https://sourcey-peertube.pages.dev/api-rest-reference/models/videolanguageset.md); Type: VideoLanguageSet
    
    language id of the video (see [/videos/languages](#operation/getLanguages))
    
    Example:
    
    ```json
    "en"
    ```
  
    Type: Array<VideoLanguageSet>
    
    Items:
      Reference: [VideoLanguageSet](https://sourcey-peertube.pages.dev/api-rest-reference/models/videolanguageset.md); Type: VideoLanguageSet
      
      language id of the video (see [/videos/languages](#operation/getLanguages))
      
      Example:
      
      ```json
      "en"
      ```

- `tagsOneOf` (query, string | Array<string>, optional) - tag(s) of the video
  Type: string | Array<string>
  
  oneOf:
    Type: string
  
    Type: Array<string>
    
    maxItems: 5
    
    Items:
      Type: string

- `tagsAllOf` (query, string | Array<string>, optional) - tag(s) of the video, where all should be present in the video
  Type: string | Array<string>
  
  oneOf:
    Type: string
  
    Type: Array<string>
    
    Items:
      Type: string

- `isLocal` (query, boolean, optional) - **PeerTube >= 4.0** Display only local or remote objects
  Type: boolean

- `include` (query, integer, optional) - **Only administrators and moderators can use this parameter**

Include additional videos in results (can be combined using bitwise or operator)
- `0` NONE
- `1` NOT_PUBLISHED_STATE
- `2` BLACKLISTED
- `4` BLOCKED_OWNER
- `8` FILES
- `16` CAPTIONS
- `32` VIDEO SOURCE

  Type: integer
  
  enum: [0,1,2,4,8,16,32]

- `hasHLSFiles` (query, boolean, optional) - **PeerTube >= 4.0** Display only videos that have HLS files
  Type: boolean

- `hasWebVideoFiles` (query, boolean, optional) - **PeerTube >= 6.0** Display only videos that have Web Video files
  Type: boolean

- `host` (query, string, optional) - Find elements owned by this host
  Type: string

- `autoTagOneOf` (query, string | Array<string>, optional) - **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags
  Type: string | Array<string>
  
  oneOf:
    Type: string
  
    Type: Array<string>
    
    Items:
      Type: string

- `stateOneOf` (query, id | Array<id>, optional) - **PeerTube >= 8.2** **Admins and moderators only** filter on videos that have one of these states
  Type: id | Array<id>
  
  oneOf:
    Reference: [id](https://sourcey-peertube.pages.dev/api-rest-reference/models/id.md); Type: id
    
    The video state:
    - `1`: Published
    - `2`: To transcode
    - `3`: To import
    - `4`: Waiting for live stream
    - `5`: Live ended
    - `6`: To move to an external storage (object storage...)
    - `7`: Transcoding failed
    - `8`: Moving to an external storage failed
    - `9`: To edit using studio edition feature
    - `10`: To move to the file system
    - `11`: Moving to the file system failed
    - `12`: Import failed
    - `13`: To duplicate, the files of another video are being copied
    - `14`: Duplication failed, the files of the other video could not be copied
    - `15`: The studio edition of a video saved as a new video failed
    
    
    enum: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
  
    Type: Array<id>
    
    Items:
      Reference: [id](https://sourcey-peertube.pages.dev/api-rest-reference/models/id.md); Type: id
      
      The video state:
      - `1`: Published
      - `2`: To transcode
      - `3`: To import
      - `4`: Waiting for live stream
      - `5`: Live ended
      - `6`: To move to an external storage (object storage...)
      - `7`: Transcoding failed
      - `8`: Moving to an external storage failed
      - `9`: To edit using studio edition feature
      - `10`: To move to the file system
      - `11`: Moving to the file system failed
      - `12`: Import failed
      - `13`: To duplicate, the files of another video are being copied
      - `14`: Duplication failed, the files of the other video could not be copied
      - `15`: The studio edition of a video saved as a new video failed
      
      
      enum: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

- `privacyOneOf` (query, VideoPrivacySet, optional) - **PeerTube >= 4.0** Display only videos in this specific privacy/privacies
  Type: VideoPrivacySet
  
  privacy id of the video (see [/videos/privacies](#operation/getVideoPrivacyPolicies))
  
  Schema: [VideoPrivacySet](https://sourcey-peertube.pages.dev/api-rest-reference/models/videoprivacyset.md)
  
  enum: [1,2,3,4,5]

- `excludeAlreadyWatched` (query, boolean, optional) - Whether or not to exclude videos that are in the user's video history
  Type: boolean

- `search` (query, string, optional) - Plain text search, applied to various parts of the model depending on endpoint
  Type: string

Responses:

- 200: successful operation

Content type: application/json

Type: VideoListResponse

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

- `total` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `data` (optional)
  Type: Array<Video>
  
  maxItems: 100
  
  Items:
    Reference: [Video](https://sourcey-peertube.pages.dev/api-rest-reference/models/video.md); Type: Video

## Examples

### JavaScript

```JavaScript
fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
.then(function(response) {
  return response.json()
}).then(function(data) {
  console.log(data)
})
```

### Shell

```Shell
## DEPENDENCIES: jq
curl -s https://peertube2.cpy.re/api/v1/accounts/{name}/videos | jq
```

### Ruby

```Ruby
require 'net/http'
require 'json'

uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

response = http.get(uri.request_uri)

puts JSON.parse(response.read_body)
```

### Python

```Python
import requests

r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
json = r.json()

print(json)
```
