# listyoutubevideos: List YouTube Videos

> listyoutubevideos (List YouTube Videos) is a 1001fx API function in the group YouTube: POST https://api.1001fx.com/youtube/listyoutubevideos, 5 credits per call. It works in Make, n8n, scripts and AI agents as a plain HTTP call.

**Deprecated:** this function will be removed in a future release.

Returns a list of videos that match the API request parameters.

- This service is provided by an external service provider: YouTube. The data of the call is sent to the provider. [More about service providers](https://1001fx.com/functions#serviceproviders)

- Group: YouTube
- Endpoint: `POST https://api.1001fx.com/youtube/listyoutubevideos`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 5 credits per call
- Ready-made in: none, use an HTTP request
- Service provider: YouTube
- Docs: https://1001fx.com/functions/listyoutubevideos

## Parameters

- `credentialKey` (string, required) – 1001fx Credential Key: Your 1001fx credential key. See https://1001fx.com/app/credentials/list
- `chart` (object, optional) – Videos Chart Filter: Filters videos based on the chart filter. One of chart, id or myRating needs to be provided.
  - `chart` (enum, optional, one of `mostPopular`) – Chart: The chart parameter identifies the chart that you want to retrieve. - mostPopular: Return the most popular videos for the specified content region and video category.
  - `regionCode` (string, optional) – Region Code: The regionCode parameter instructs the API to select a video chart available in the specified region. The parameter value is an ISO 3166-1 alpha-2 country code. See https://1001fx.com/functions/listyoutubei18nregions.
  - `videoCategoryId` (string, optional, default `0`) – Video Category ID: The videoCategoryId parameter identifies the video category for which the chart should be retrieved. By default, charts are not restricted to a particular category. The default value is 0.
  - `pageToken` (string, optional) – Page Token: The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.
- `id` (object, optional) – Videos ID Filter: Filters videos based on the id filter. One of chart, id or myRating needs to be provided.
  - `videoIds` (array<string>, optional) – Video IDs: The videoIds parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the videos ID.
- `myRating` (object, optional) – Videos MyRating Filter: Filters videos based on the myRating filter. One of chart, id or myRating needs to be provided.
  - `myRating` (enum, optional, one of `dislike`, `like`) – My Rating: Set this parameters value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user. - dislike: Returns only videos disliked by the authenticated user.. - like: Returns only video liked by the authenticated user.
  - `maxResults` (number, optional, default `5`, min 1, max 50) – Max Results: Specifies the maximum number of items that should be returned in the result set. Defaults to 5.
  - `pageToken` (string, optional) – Page Token: The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.
- `hl` (string, optional) – HL: The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. If localized resource details are available in that language, the resources snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resourcess default language. See https://1001fx.com/functions/listyoutubei18nlanguages.
- `maxWidth` (number, optional, min 72, max 8192) – Max Width: The maxWidth parameter specifies the maximum width of the embedded player returned in the player.embedHtml property. You can use this parameter to specify that instead of the default dimensions, the embed code should use a width appropriate for your application layout. If the maxHeight parameter is also provided, the player may be narrower than maxWidth in order to not violate the maximum height.
- `maxHeight` (number, optional, min 72, max 8192) – Max Height: The maxHeight parameter specifies the maximum height of the embedded player returned in the player.embedHtml property. You can use this parameter to specify that instead of the default dimensions, the embed code should use a height appropriate for your application layout. If the maxWidth parameter is also provided, the player may be shorter than the maxHeight in order to not violate the maximum width.

## Example: Most popular videos

```bash
curl -X POST 'https://api.1001fx.com/youtube/listyoutubevideos' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"credentialKey":"yourCredentialKey","chart":{"chart":"mostPopular","regionCode":"DE","videoCategoryId":"20"},"hl":"de","maxWidth":1920,"maxHeight":1080}'
```
