> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/api-targets/es/video-y-redes-sociales/youtube/youtube-video-trainability.md).

# Entrenabilidad del video

La `youtube_video_trainability` fuente está diseñada para recuperar información sobre si un video específico de YouTube **es elegible para fines de entrenamiento de IA**. Este servicio permite verificar los permisos de entrenamiento del contenido de YouTube.

## Ejemplos de solicitud

Los siguientes ejemplos muestran cómo comprobar los permisos de entrenamiento de IA para un video específico de YouTube.

{% tabs %}
{% tab title="cURL" %}

```bash
curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
"source": "youtube_video_trainability",
"video_id": "rFNDylrjn_w"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://realtime.oxylabs.io/v1/queries"
payload = {
    "source": "youtube_video_trainability",
    "video_id": "rFNDylrjn_w"
}
headers = {
    "Content-Type": "application/json"
}
auth = ("USERNAME", "PASSWORD")

response = requests.post(url, json=payload, headers=headers, auth=auth)
print(response.text)
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const fetch = require('node-fetch');

const url = 'https://realtime.oxylabs.io/v1/queries';
const payload = {
    source: 'youtube_video_trainability',
    video_id: 'rFNDylrjn_w'
};

const options = {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Basic ' + Buffer.from('USERNAME:PASSWORD').toString('base64')
    },
    body: JSON.stringify(payload)
};

fetch(url, options)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
```

{% endtab %}

{% tab title="HTTP" %}

```http
POST /v1/queries HTTP/1.1
Host: realtime.oxylabs.io
Authorization: Basic [BASE64_ENCODED_CREDENTIALS]
Content-Type: application/json

{
    "source": "youtube_video_trainability",
    "video_id": "rFNDylrjn_w"
}
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = 'https://realtime.oxylabs.io/v1/queries';
$payload = [
    'source' => 'youtube_video_trainability',
    'video_id' => 'rFNDylrjn_w'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_USERPWD, 'USERNAME:PASSWORD');

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://realtime.oxylabs.io/v1/queries"
    payload := map[string]string{
        "source": "youtube_video_trainability",
        "video_id":  "rFNDylrjn_w",
    }
    
    jsonPayload, _ := json.Marshal(payload)
    
    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
    req.Header.Set("Content-Type", "application/json")
    req.SetBasicAuth("USERNAME", "PASSWORD")
    
    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    
    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            var url = "https://realtime.oxylabs.io/v1/queries";
            var payload = @"{
                ""source"": ""youtube_video_trainability"",
                ""video_id"": ""rFNDylrjn_w""
            }";
            
            var content = new StringContent(payload, Encoding.UTF8, "application/json");
            var byteArray = Encoding.ASCII.GetBytes("USERNAME:PASSWORD");
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
                "Basic", Convert.ToBase64String(byteArray));
            
            var response = await client.PostAsync(url, content);
            var responseContent = await response.Content.ReadAsStringAsync();
            Console.WriteLine(responseContent);
        }
    }
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Base64;

public class OxylabsRequest {
    public static void main(String[] args) throws IOException, InterruptedException {
        String url = "https://realtime.oxylabs.io/v1/queries";
        String payload = "{\"source\":\"youtube_video_trainability\",\"video_id\":\"rFNDylrjn_w\"}";
        
        String auth = "USERNAME:PASSWORD";
        String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes());
        
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(url))
                .header("Content-Type", "application/json")
                .header("Authorization", "Basic " + encodedAuth)
                .POST(HttpRequest.BodyPublishers.ofString(payload))
                .build();
        
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
```

{% endtab %}

{% tab title="JSON" %}

```json
{
    "source": "youtube_video_trainability",
    "video_id": "rFNDylrjn_w"
}
```

{% endtab %}
{% endtabs %}

Usamos [**Realtime**](/products/es/web-scraper-api/integration-methods/realtime.md) el método de integración sincrónica en nuestros ejemplos. Si desea usar [**Push-Pull**](/products/es/web-scraper-api/integration-methods/push-pull.md) la integración, consulte la [**sección de métodos de integración**](/products/es/web-scraper-api/integration-methods.md) .

## Valores de los parámetros de solicitud

<table><thead><tr><th>Parámetro</th><th width="225.04296875">Descripción</th><th>Valor predeterminado</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong><code>source</code></strong></mark></td><td>Configura el scraper.</td><td><code>youtube_video_trainability</code></td></tr><tr><td><mark style="background-color:green;"><strong><code>video_id</code></strong></mark></td><td>ID del video de YouTube.</td><td>-</td></tr><tr><td><code>callback_url</code></td><td>URL a tu endpoint de callback. <a href="/spaces/xofNngbwiAAH0MB3lMAb/pages/28181dba27c108c1684f7f17f5d8fef78bd80d90"><strong>Más información</strong></a></td><td>-</td></tr></tbody></table>

&#x20;    \- parámetro obligatorio

## Formato de respuesta

La API devuelve una respuesta JSON estructurada con los siguientes campos:

```json
{
  "videoId": "<YOUTUBE_VIDEO_ID>",
  "kind": "youtube#videoTrainability",
  "etag": "<ETAG_VALUE>",
  "permitted": ["<PERMISSION_LEVEL>"]
}
```

La `permitted` El campo indica el nivel de permiso de entrenamiento disponible para el video, con estos posibles valores:

| Valor                       | Descripción                                                            |
| --------------------------- | ---------------------------------------------------------------------- |
| `["all"]`                   | Se permite el entrenamiento para todas las partes                      |
| `["none"]`                  | No se permite el entrenamiento para ninguna parte                      |
| `["party1", "party2", ...]` | Se permite el entrenamiento solo para las partes específicas indicadas |

La `etag` El valor sirve como identificador de versión del estado de entrenamiento.

### Ejemplo de respuesta

```json
{
  "videoId": "rFNDylrjn_w",
  "kind": "youtube#videoTrainability",
  "etag": "oXToFpOwrHWvoiN1YbOa0tkzOn0",
  "permitted": ["None"]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.oxylabs.io/api-targets/es/video-y-redes-sociales/youtube/youtube-video-trainability.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
