커스텀 헤더
Wsa- 접두사를 붙여서 전송하면 나가는 스크레이핑 요청에 원하는 헤더를 추가할 수 있습니다. API는 접두사를 제거한 후 해당 헤더를 대상 사이트로 전달합니다.
Endpoint
섹션 제목: “Endpoint” GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>
Parameters
섹션 제목: “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | Web Scraping API 키 |
url | string | yes | 가져올 대상 URL |
Wsa-* (header) | string | no | Wsa- 접두사가 붙은 모든 헤더는 접두사가 제거된 상태로 대상에 전달됩니다. |
Example request
섹션 제목: “Example request”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());Example response
섹션 제목: “Example response”{ "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" }}