JSON 자동 파서
auto_parser=1을 설정하면 API가 페이지를 태그, 속성, 텍스트로 구성된 중첩 JSON 구조로 파싱합니다. JavaScript 렌더링 사용 여부와 관계없이 작동합니다.
엔드포인트
섹션 제목: “엔드포인트” GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>&auto_parser=1
매개변수
섹션 제목: “매개변수”| 매개변수 | 유형 | 필수 | 설명 |
|---|---|---|---|
api_key | string | 예 | Web Scraping API 키 |
url | string | 예 | 가져올 대상 URL |
auto_parser | integer | 아니요 | 0(기본값) 또는 1. 1인 경우 응답이 파싱된 JSON으로 반환됩니다. |
요청 예시
섹션 제목: “요청 예시”curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com&auto_parser=1"import requests
r = requests.get("https://scrape.shifter.io/v1", params={ "api_key": "YOUR_API_KEY", "url": "https://example.com", "auto_parser": 1,})print(r.json())import fetch from 'node-fetch';
const url = 'https://scrape.shifter.io/v1?' + new URLSearchParams({ api_key: 'YOUR_API_KEY', url: 'https://example.com', auto_parser: '1',});const res = await fetch(url);console.log(await res.json());응답 예시
섹션 제목: “응답 예시”{ "0": { "tagName": "div", "children": { "0": { "tagName": "h1", "text": "Example Domain" }, "1": { "tagName": "p", "text": "This domain is for use in illustrative examples in documents." }, "2": { "tagName": "p", "text": "More information...", "children": { "0": { "tagName": "a", "attributes": { "href": "https://www.iana.org/domains/example" }, "text": "More information..." } } } } }}