고급
사용자 지정 헤더
섹션 제목: “사용자 지정 헤더”custom_headers를 통해 URL로 인코딩된 JSON 객체로 헤더를 전달합니다:
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://api.example.com&custom_headers=%7B%22Authorization%22%3A%22Bearer%20abc123%22%7D"대상이 bearer 토큰, X-Requested-With: XMLHttpRequest, 또는 로케일 설정을 요구할 때 유용합니다.
사용자 지정 쿠키
섹션 제목: “사용자 지정 쿠키”custom_cookies를 통해 쿠키를 인라인으로 설정합니다:
cookie_name=value; other_name=value2URL 인코딩:
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com&custom_cookies=session_id%3Dabc%3B%20locale%3Den-US"여러 요청에 걸쳐 쿠키를 사용하려면 session_id를 사용하는 것이 좋으며, 서버가 설정한 쿠키는 자동으로 유지됩니다.
POST 및 PUT
섹션 제목: “POST 및 PUT”method로 메서드를 전환합니다. 본문은 요청 본문으로 전달합니다.
curl -X POST \ "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://api.example.com/users&method=POST" \ -H "Content-Type: application/json" \ -d '{"email":"user@example.com","plan":"pro"}'PUT도 method=PUT으로 동일하게 동작합니다.
스크린샷
섹션 제목: “스크린샷”HTML 대신 전체 페이지 PNG를 반환합니다:
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com&render_js=1&screenshot=1" \ -o screenshot.png옵션:
screenshot_full_page=1, 뷰포트 밖까지 캡처합니다.screenshot_selector=<css>, 하나의 요소만 캡처합니다.
바이너리 파일
섹션 제목: “바이너리 파일”PDF, 이미지, 또는 텍스트가 아닌 응답의 경우 binary_response=1을 추가합니다. 스크레이퍼는 바이너리 페이로드를 다음과 같이 스트리밍합니다:
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com/file.pdf&binary_response=1" \ -o file.pdf스텔스 제어
섹션 제목: “스텔스 제어”일부 대상은 기본 브라우저 핑거프린트를 감지합니다. 디버깅 목적으로 스텔스 모드를 비활성화할 수 있습니다(프로덕션 환경에서는 권장하지 않음):
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com&disable_stealth=1&render_js=1"플래그 조합
섹션 제목: “플래그 조합”모든 플래그는 함께 사용할 수 있습니다. 실제 요청 예시는 다음과 같습니다:
curl "https://scrape.shifter.io/v1?\api_key=YOUR_API_KEY&\url=https://shop.example.com/products/42&\render_js=1&\wait_for_css=.price&\session_id=cart-001&\premium_proxy=1&\country=us&\extract_rules=%7B%22price%22%3A%7B%22selector%22%3A%22.price%22%2C%22output%22%3A%22text%22%7D%7D"성공한 요청 1건당 크레딧 1개가 소모됩니다.