> 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/products/es/web-scraper-api/integration-methods/proxy-endpoint.md).

# Proxy Endpoint

Envía y recibe datos a través de Oxylabs Web Scraper API Proxy Endpoint. Accede a las páginas de destino directamente mediante una integración sencilla basada en URL.

Si alguna vez ha utilizado Proxies normales para la extracción de datos, integrar el método de entrega Proxy Endpoint será muy sencillo. Todo lo que necesita hacer es usar nuestro nodo de entrada como proxy, autorizarse con las credenciales de Web Scraper API e ignorar los certificados. En `cURL`, es `-k` o `--insecure`. Sus datos le llegarán mediante una conexión abierta.

Proxy Endpoint **solo funciona con las fuentes de datos basadas en URL**, donde se proporciona la URL completa. Por lo tanto, solo acepta unos pocos parámetros de trabajo adicionales, que [**deben enviarse como encabezados**](#accepted-parameters).

{% hint style="warning" %}
El Proxy Endpoint no está diseñado para ser controlado por navegadores sin interfaz gráfica (p. ej., Chromium, PhantomJS, Splash) ni sus bibliotecas de automatización (p. ej., Playwright, Selenium, Puppeteer).
{% endhint %}

### Endpoint

```
GET realtime.oxylabs.io:60000
```

### Entrada

Consulte un ejemplo de solicitud a continuación.

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

```shell
curl -k -x https://realtime.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
-H 'x-oxylabs-user-agent-type: desktop' \
-H 'x-oxylabs-geo-location: Germany' \
'https://www.example.com'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint

# Use your Web Scraper API credentials here.
USERNAME, PASSWORD = 'YOUR_USERNAME', 'YOUR_PASSWORD'

# Define proxy dict.
proxies = {
  'http': f'http://{USERNAME}:{PASSWORD}@realtime.oxylabs.io:60000',
  'https': f'https://{USERNAME}:{PASSWORD}@realtime.oxylabs.io:60000'
}

# To set a specific geo-location, user-agent or to render Javascript
# it is required to send parameters as request headers.
headers = {
    'x-oxylabs-user-agent-type': 'desktop',
    'x-oxylabs-geo-location': 'Germany',
    #'X-Oxylabs-Render': 'html', # Uncomment if you want to render JavaScript within the page.
}

response = requests.request(
    'GET',
    'https://www.example.com',
    headers = headers, # Pass the defined headers.
    verify=False,  # Accept our certificate.
    proxies=proxies,
)

# Print result page to stdout.
pprint(response.text)

# Save returned HTML to 'result.html' file.
with open('result.html', 'w') as f:
    f.write(response.text)
```

{% endtab %}

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

```javascript
import fetch from 'node-fetch';
import { HttpsProxyAgent } from 'https-proxy-agent';

const username = 'YOUR_USERNAME';
const password = 'YOUR_PASSWORD';

const agent = new HttpsProxyAgent(
  `https://${username}:${password}@realtime.oxylabs.io:60000`
);

// The Proxy Endpoint presents its own certificate for the target site, so TLS verification must be disabled
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;

const headers = {
  'x-oxylabs-user-agent-type': 'desktop',
  'x-oxylabs-geo-location': 'Germany',
}

const response = await fetch('https://www.example.com', {
  method: 'get',
  headers: headers,
  agent: agent,
});

console.log(await response.text());
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.example.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, 'https://realtime.oxylabs.io:60000');
curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'YOUR_USERNAME' . ':' . 'YOUR_PASSWORD');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
// To set a specific geo-location, user-agent or to render Javascript
// it is required to send parameters as request headers.
curl_setopt_array($ch, array(
    CURLOPT_HTTPHEADER  => array(
        'x-oxylabs-user-agent-type: desktop',
        'x-oxylabs-geo-location: Germany',
        //'X-Oxylabs-Render: html', // Uncomment if you want to render JavaScript within the page.
    )
));

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);
?>
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
    "crypto/tls"
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
)

func main() {
    const Username = "YOUR_USERNAME"
    const Password = "YOUR_PASSWORD"

    proxyUrl, _ := url.Parse(
        fmt.Sprintf(
            "https://%s:%s@realtime.oxylabs.io:60000",
            Username,
            Password,
        ),
    )
    customTransport := &http.Transport{Proxy: http.ProxyURL(proxyUrl)}

    // The Proxy Endpoint presents its own certificate for the target site, so TLS verification must be disabled
    customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}

    client := &http.Client{Transport: customTransport}
    request, _ := http.NewRequest("GET",
        "https://www.example.com",
        nil,
    )

    request.Header.Add("x-oxylabs-user-agent-type", "desktop")
    request.Header.Add("x-oxylabs-geo-location", "Germany")
    request.SetBasicAuth(Username, Password)
    response, _ := client.Do(request)

    responseText, _ := ioutil.ReadAll(response.Body)
    fmt.Println(string(responseText))
}

```

{% endtab %}

{% tab title="C#" %}

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

namespace OxyApi
{
    class Program
    {
        static async Task Main(string[] args)
        {
            var webProxy = new WebProxy
            {
                Address = new Uri($"https://realtime.oxylabs.io:60000"),
                BypassProxyOnLocal = false,
                UseDefaultCredentials = false,

                Credentials = new NetworkCredential(
                userName: "YOUR_USERNAME",
                password: "YOUR_PASSWORD"
                )
            };

            var httpClientHandler = new HttpClientHandler
            {
                Proxy = webProxy,
            };

            // The Proxy Endpoint presents its own certificate for the target site, so TLS verification must be disabled
            httpClientHandler.ClientCertificateOptions = ClientCertificateOption.Manual;
            httpClientHandler.ServerCertificateCustomValidationCallback =
                (httpRequestMessage, cert, cetChain, policyErrors) =>
                {
                    return true;
                };


            var client = new HttpClient(handler: httpClientHandler, disposeHandler: true);

            client.DefaultRequestHeaders.Add("x-oxylabs-user-agent-type", "desktop");
            client.DefaultRequestHeaders.Add("x-oxylabs-geo-location", "Germany");

            Uri baseUri = new Uri("https://www.example.com");
            client.BaseAddress = baseUri;

            var requestMessage = new HttpRequestMessage(HttpMethod.Get, "");

            var response = await client.SendAsync(requestMessage);
            var contents = await response.Content.ReadAsStringAsync();

            Console.WriteLine(contents);
        }
    }
}
```

{% endtab %}

{% tab title="Java" %}

```java
package org.example;

import org.apache.hc.client5.http.auth.AuthScope;
import org.apache.hc.client5.http.auth.CredentialsProvider;
import org.apache.hc.client5.http.classic.methods.HttpGet;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.impl.auth.CredentialsProviderBuilder;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactoryBuilder;
import org.apache.hc.client5.http.ssl.TrustAllStrategy;
import org.apache.hc.core5.http.HttpHost;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.message.StatusLine;
import org.apache.hc.core5.ssl.SSLContextBuilder;

import java.util.Arrays;
import java.util.Properties;


public class Main {

    public static void main(final String[] args)throws Exception {
        final CredentialsProvider credsProvider = CredentialsProviderBuilder.create()
                .add(new AuthScope("realtime.oxylabs.io", 60000), "YOUR_USERNAME", "YOUR_PASSWORD".toCharArray())
                .build();
        final HttpHost target = new HttpHost("https", "example.com", 443);
        final HttpHost proxy = new HttpHost("https", "realtime.oxylabs.io", 60000);
        try (final CloseableHttpClient httpclient = HttpClients.custom()
                .setDefaultCredentialsProvider(credsProvider)
                .setProxy(proxy)
                // The Proxy Endpoint presents its own certificate for the target site, so TLS verification must be disabled
                .setConnectionManager(PoolingHttpClientConnectionManagerBuilder.create()
                        .setSSLSocketFactory(SSLConnectionSocketFactoryBuilder.create()
                                .setSslContext(SSLContextBuilder.create()
                                        .loadTrustMaterial(TrustAllStrategy.INSTANCE)
                                        .build())
                                .setHostnameVerifier(NoopHostnameVerifier.INSTANCE)
                                .build())
                        .build())
                .build()) {

            final RequestConfig config = RequestConfig.custom()
                    .build();
            final HttpGet request = new HttpGet("/");
            request.addHeader("x-oxylabs-user-agent-type","desktop");
            request.addHeader("x-oxylabs-geo-location","Germany");
            request.setConfig(config);

            System.out.println("Executing request " + request.getMethod() + " " + request.getUri() +
                    " via " + proxy + " headers: " + Arrays.toString(request.getHeaders()));

            httpclient.execute(target, request, response -> {
                System.out.println("----------------------------------------");
                System.out.println(request + "->" + new StatusLine(response));
                EntityUtils.consume(response.getEntity());
                return null;
            });
        }
    }
}
```

{% endtab %}
{% endtabs %}

### Salida

A continuación encontrará una respuesta de ejemplo de `https://example.com`:

<details>

<summary>Respuesta de ejemplo</summary>

```html
<!doctype html>
<html lang="en">
<head>
<title>Example Domain</title>
<link rel="icon" href="data:,">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p>
<p>
<a href="https://iana.org/domains/example">Learn more</a>
</p>
</div>
</body>
</html>
```

</details>

### Parámetros aceptados

Al realizar su solicitud, junto con la URL, puede enviarnos algunos parámetros de trabajo que utilizaremos al ejecutar su trabajo. Los parámetros de trabajo deben enviarse en los encabezados de su solicitud; consulte un ejemplo [**aquí**](#input)**.**

Esta es la lista de parámetros de trabajo que puede enviar con solicitudes de Proxy Endpoint:

| Parámetro                        | Descripción                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `x-oxylabs-user-agent-type`      | No hay forma de indicar un User-Agent específico, pero puede informarnos qué tipo de user-agent desea que utilicemos. Puede encontrar una lista de tipos de User-Agent compatibles [**aquí**](/products/es/web-scraper-api/features/http-context-and-job-management/user-agent-type.md).                                                                                                        |
| `x-oxylabs-geo-location`         | En algunos casos, es posible que necesite indicar la ubicación geográfica para la que debe adaptarse el resultado. Este parámetro corresponde al parámetro `geo_location`  , descrito por separado en la documentación a nivel de fuente. Los valores aceptados dependen de la URL que desea extraer. Lea más [**aquí**](/products/es/web-scraper-api/features/localization/proxy-location.md). |
| `x-oxylabs-render`               | Ejecución de JavaScript. Valores aceptados: `html` y `png`. Lea más [**aquí**](/products/es/web-scraper-api/features/js-rendering-and-browser-control.md).                                                                                                                                                                                                                                      |
| `x-oxylabs-parse`                | Establézcalo en true para obtener una salida JSON estructurada en lugar de contenido de página sin procesar. Solo funciona para URL cubiertas por un [**analizador dedicado**](/products/es/web-scraper-api/features/result-processing-and-storage/dedicated-parsers.md)**.**                                                                                                                   |
| `x-oxylabs-parser-type`          | Selecciona un analizador explícitamente. Debe enviarse junto con `x-oxylabs-parse: true`, y debe ser un analizador que admita la URL que está extrayendo.                                                                                                                                                                                                                                       |
| `x-oxylabs-browser-instructions` | Instrucciones del navegador como una cadena JSON. Requiere `x-oxylabs-render`. Lea más [**aquí**](/products/es/web-scraper-api/features/js-rendering-and-browser-control.md#browser-instructions).                                                                                                                                                                                              |


---

# 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, and the optional `goal` query parameter:

```
GET https://developers.oxylabs.io/products/es/web-scraper-api/integration-methods/proxy-endpoint.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
