빠른 시작
2분 이내에 첫 데이터 수집을 시작해 보세요.
사전 준비 사항
1단계: API 키 가져오기
Dashboard에 로그인하여 API 키를 생성합니다. 다음과 같은 형태입니다: pk_live_a1b2c3d4e5f6...
이 키를 복사합니다. 모든 request에 필요합니다.
2단계: 첫 Request 보내기
터미널을 열고 다음을 실행합니다(YOUR_API_KEY를 실제 키로 변경):
curl -X POST https://eu.api.foura.ai/api/single/ \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method": "GET", "url": "https://example.com"}'
이는 example.com으로 HTTP request를 보내고 페이지 HTML을 반환합니다.
3단계: Response 확인
{
"status": 200,
"headers": [
{
"result": { "version": "HTTP/2", "code": 200, "reason": "" },
"content-type": "text/html; charset=UTF-8",
"content-length": "1256"
}
],
"data": "<!doctype html><html>...</html>",
"total_time": 0.45
}
headers 필드는 객체 배열이며 리디렉션 홉당 하나씩 존재합니다. 각 항목에는 상태 줄과 타겟이 해당 홉에 대해 반환한 모든 response header가 포함된 result 필드가 있습니다.
주요 필드:
status: 타겟 사이트의 HTTP 상태 코드data: response 본문(HTML, JSON 또는 원시 텍스트)total_time: request 소요 시간(초)
4단계: 다른 Endpoint 사용해 보기
FourA는 다양한 상황에 맞는 4개의 endpoint를 제공합니다:
| Endpoint | 속도 | 사용 시기 |
|---|---|---|
POST /api/auto/ |
다양함(웜 호스트에서 빠름) | 사이트에 어떤 엔진이 필요한지 모를 때. URL을 전달하면 FourA가 작동하는 가장 저렴한 경로를 선택합니다. |
POST /api/single/ |
가장 빠름(200ms-2s) | 정적 페이지, API, 서버 렌더링 사이트 |
POST /api/browser/ |
보통(2s-10s) | JavaScript 비중이 높은 페이지, SPA, 동적 콘텐츠 |
POST /api/proxy/ |
빠름(1s-5s) | 봇 탐지기가 있는 사이트, 지역 제한 콘텐츠 |
auto request 시도(스마트 기본값):
curl -X POST https://eu.api.foura.ai/api/auto/ \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/product/42",
"validate": {"data": {"accept": ["Add to cart"]}}
}'
browser request 시도:
curl -X POST https://eu.api.foura.ai/api/browser/ \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "timeout_ms": 15000}'
proxy request 시도(자동 proxy 로테이션):
curl -X POST https://eu.api.foura.ai/api/proxy/ \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"maxTries": 3,
"request": {
"method": "GET",
"url": "https://example.com",
"unblocker": true
}
}'
다음 단계
- Authentication: API 키 관리 및 보안
- API Endpoints: 4개의 모든 endpoint에 대한 전체 매개변수 참조
- Smart Fetch (Auto): auto endpoint의 작업 결정 방식
- SDKs and Libraries: Python, Node.js, Go, Ruby 예제
- Choosing the Right Endpoint: auto, single, browser 또는 proxy 선택 시기