# Search playlists

`GET /api/v1/search/video-playlists`

Authentication: no security requirement declared for this operation.

Parameters:

- `search` (query, string, required) - String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete playlist information and interact with it.

  Type: string

- `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

- `searchTarget` (query, string, optional) - If the administrator enabled search index support, you can override the default search target.

**Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
  * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
  then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
  After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
  * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch
  the data from the origin instance API

  Type: string
  
  enum: ["local","search-index"]

- `sort` (query, string, optional) - Sort column
  Type: string
  
  Example:
  
  ```json
  "-createdAt"
  ```

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

- `uuids` (query, any, optional) - Find elements with specific UUIDs
  Type: any
  
  Items:
    Type: string

Responses:

- 200: successful operation

Content type: application/json

Type: object

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

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

- 500: search index unavailable

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/search/video-playlists?search=string&count=15'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/search/video-playlists?search=string&count=15', {
  method: 'GET',
});

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

### Python

```python
import requests

response = requests.get('https://peertube2.cpy.re/api/v1/search/video-playlists?search=string&count=15')
print(response.text)
```
