Encabezados personalizados
Añade cualquier encabezado a la solicitud de scraping saliente enviándolo con el prefijo Wsa-. La API elimina el prefijo y reenvía el encabezado al sitio de destino.
Endpoint
Sección titulada «Endpoint» GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>
Parámetros
Sección titulada «Parámetros»| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | Tu clave de la API de Web Scraping |
url | string | yes | URL de destino que se va a obtener |
Wsa-* (header) | string | no | Cualquier encabezado con el prefijo Wsa- se reenvía al destino sin el prefijo. |
Ejemplo de solicitud
Sección titulada «Ejemplo de solicitud»curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=http%3A%2F%2Fhttpbin.org%2Fheaders" \ -H "Wsa-My-header: test" \ -H "Wsa-User-Agent: potato"import requests
r = requests.get( "https://scrape.shifter.io/v1", params={"api_key": "YOUR_API_KEY", "url": "http://httpbin.org/headers"}, headers={"Wsa-My-header": "test", "Wsa-User-Agent": "potato"},)print(r.json())import fetch from 'node-fetch';
const url = 'https://scrape.shifter.io/v1?' + new URLSearchParams({ api_key: 'YOUR_API_KEY', url: 'http://httpbin.org/headers',});const res = await fetch(url, { headers: { 'Wsa-My-header': 'test', 'Wsa-User-Agent': 'potato', },});console.log(await res.json());Ejemplo de respuesta
Sección titulada «Ejemplo de respuesta»{ "headers": { "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "Accept-Encoding": "gzip, deflate, br", "Host": "httpbin.org", "My-Header": "test", "Upgrade-Insecure-Requests": "1", "User-Agent": "potato" }}