SDK 및 라이브러리
FourA는 REST API입니다. HTTP를 지원하는 모든 언어와 함께 사용할 수 있습니다. 다음은 가장 널리 쓰이는 언어들의 빠른 시작 예시입니다.
Python
requests 라이브러리 사용:
import requests
response = requests.post(
"https://eu.api.foura.ai/api/single/",
headers={
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"method": "GET",
"url": "https://example.com"
}
)
data = response.json()
print(data["data"][:200]) # First 200 chars of response body
Node.js
내장 fetch 사용 (Node 18+):
const response = await fetch('https://eu.api.foura.ai/api/single/', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
method: 'GET',
url: 'https://example.com'
})
});
const result = await response.json();
console.log(result.data.slice(0, 200));
cURL
명령줄에서 테스트하는 가장 간단한 방법입니다.
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"}'
Go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]string{
"method": "GET",
"url": "https://example.com",
})
req, _ := http.NewRequest("POST", "https://eu.api.foura.ai/api/single/", bytes.NewBuffer(payload))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Ruby
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://eu.api.foura.ai/api/single/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = { method: 'GET', url: 'https://example.com' }.to_json
response = http.request(request)
puts JSON.parse(response.body)['data'][0..200]
MCP Server (LLM 에이전트용)
LLM 에이전트(Claude Desktop, Claude Code, Cursor, Windsurf, VS Code)를 구축하는 경우 원시 HTTP 클라이언트를 건너뛰고 @fouradata/mcp 서버를 사용하십시오. 4개의 모든 FourA endpoint를 타입이 지정된 response를 제공하는 네이티브 Model Context Protocol 도구(foura_auto, foura_single, foura_proxy, foura_browser)로 노출하므로, 글루 코드를 작성할 필요 없이 에이전트가 적절한 메서드를 선택할 수 있습니다.
Claude Desktop을 위한 최소 설정:
{
"mcpServers": {
"foura": {
"command": "npx",
"args": ["-y", "@fouradata/mcp"],
"env": { "FOURA_API_KEY": "pk_live_..." }
}
}
}
지원되는 모든 클라이언트를 위한 전체 설정: MCP Server.
다음 단계
- 빠른 시작: 첫 request
- 인증: API 키 가져오기
- API Endpoints: 전체 참조
- MCP Server: FourA를 MCP 도구 세트로 사용