웹 가져오기 도구를 사용하면 Claude가 지정된 웹 페이지와 PDF 문서에서 전체 콘텐츠를 검색할 수 있습니다.
최신 웹 가져오기 도구 버전(web_fetch_20260209)은 Claude Fable 5, Claude Opus 4.8, Claude Mythos 5, Claude Mythos Preview, Claude Opus 4.7, Claude Opus 4.6, Claude Sonnet 4.6에서 동적 필터링을 지원합니다. Claude는 가져온 콘텐츠가 컨텍스트 윈도우에 도달하기 전에 코드를 작성하고 실행하여 필터링할 수 있으며, 관련 정보만 유지하고 나머지는 폐기합니다. 이를 통해 응답 품질을 유지하면서 토큰 소비를 줄일 수 있습니다. 이전 도구 버전(web_fetch_20250910)은 동적 필터링 없이 계속 사용할 수 있습니다.
Claude Mythos Preview의 경우, 웹 가져오기는 Claude API 및 Microsoft Foundry에서 사용할 수 있습니다. 현재 Amazon Bedrock 또는 Vertex AI의 Mythos Preview에서는 사용할 수 없습니다.
모델 응답의 품질, API 자체 또는 문서의 품질에 대한 피드백을 제공하려면 피드백 양식을 사용하세요.
Zero Data Retention 자격 요건 및 allowed_callers 해결 방법은 서버 도구를 참조하세요.
Claude가 신뢰할 수 없는 입력을 민감한 데이터와 함께 처리하는 환경에서 웹 가져오기 도구를 활성화하면 데이터 유출 위험이 발생합니다. 이 도구는 신뢰할 수 있는 환경에서만 사용하거나 민감하지 않은 데이터를 처리할 때만 사용하세요.
유출 위험을 최소화하기 위해 Claude는 URL을 동적으로 구성할 수 없습니다. Claude는 사용자가 명시적으로 제공한 URL 또는 이전 웹 검색이나 웹 가져오기 결과에서 나온 URL만 가져올 수 있습니다. 그러나 이 도구를 사용할 때 신중하게 고려해야 할 잔여 위험이 여전히 존재합니다.
데이터 유출이 우려되는 경우 다음을 고려하세요:
max_uses 매개변수를 사용하여 요청 수 제한allowed_domains 매개변수를 사용하여 알려진 안전한 도메인으로 제한모델 지원에 대해서는 도구 참조를 참조하세요.
API 요청에 웹 가져오기 도구를 추가하면:
웹 가져오기 도구는 현재 JavaScript로 동적으로 렌더링되는 웹사이트를 지원하지 않습니다.
Claude는 요청이 특정 페이지나 문서를 가리킬 때 가져오기를 수행합니다:
Claude는 특정 페이지를 참조하지 않는 일반 지식 또는 개방형 질문에 대해서는 가져오기를 수행하지 않습니다. "이 기사를 요약해 주세요: <url>"은 가져오기를 트리거하지만, "REST API 설계의 모범 사례는 무엇인가요?"는 직접 답변됩니다.
전체 웹 페이지와 PDF를 가져오면 특히 대용량 문서에서 특정 정보만 필요한 경우 토큰을 빠르게 소비할 수 있습니다. web_fetch_20260209 도구 버전을 사용하면 Claude는 가져온 콘텐츠를 컨텍스트에 로드하기 전에 코드를 작성하고 실행하여 필터링할 수 있습니다.
이 동적 필터링은 특히 다음과 같은 경우에 유용합니다:
동적 필터링을 사용하려면 코드 실행 도구가 활성화되어 있어야 합니다. 웹 가져오기 도구(동적 필터링 포함 및 미포함)는 Claude API, Claude Platform on AWS, Microsoft Foundry에서 사용할 수 있습니다. 현재 Amazon Bedrock 또는 Vertex AI에서는 사용할 수 없습니다.
동적 필터링을 활성화하려면 web_fetch_20260209 도구 버전을 사용하세요:
API 요청에 웹 가져오기 도구를 제공하세요:
웹 가져오기 도구는 다음 매개변수를 지원합니다:
{
"type": "web_fetch_20250910",
"name": "web_fetch",
// Optional: Limit the number of fetches per request
"max_uses": 10,
// Optional: Only fetch from these domains
"allowed_domains": ["example.com", "docs.example.com"],
// Optional: Never fetch from these domains
"blocked_domains": ["private.example.com"],
// Optional: Enable citations for fetched content
"citations": {
"enabled": true
},
// Optional: Maximum content length in tokens
"max_content_tokens": 100000
}max_uses 매개변수는 수행되는 웹 가져오기 횟수를 제한합니다. Claude가 허용된 것보다 더 많은 가져오기를 시도하면 web_fetch_tool_result는 max_uses_exceeded 오류 코드와 함께 오류가 됩니다. 현재 기본 제한은 없습니다.
allowed_domains 및 blocked_domains를 사용한 도메인 필터링에 대해서는 서버 도구를 참조하세요.
max_content_tokens 매개변수는 컨텍스트에 포함되는 콘텐츠의 양을 제한합니다. 가져온 콘텐츠가 이 제한을 초과하면 도구가 콘텐츠를 잘라냅니다. 이는 대용량 문서를 가져올 때 토큰 사용량을 제어하는 데 도움이 됩니다.
max_content_tokens 매개변수 제한은 근사치입니다. 실제 사용되는 입력 토큰 수는 약간 다를 수 있습니다.
인용이 항상 활성화되는 웹 검색과 달리, 웹 가져오기에서는 인용이 선택 사항입니다. Claude가 가져온 문서에서 특정 구절을 인용할 수 있도록 하려면 "citations": {"enabled": true}를 설정하세요.
API 출력을 최종 사용자에게 직접 표시하는 경우 원본 소스에 대한 인용을 포함해야 합니다. 최종 사용자에게 표시하기 전에 API 출력을 재처리하거나 자체 자료와 결합하는 등의 수정을 가하는 경우, 법무팀과의 협의를 바탕으로 적절하게 인용을 표시하세요.
다음은 응답 구조의 예시입니다:
{
"role": "assistant",
"content": [
// 1. Claude's decision to fetch
{
"type": "text",
"text": "I'll fetch the content from the article to analyze it."
},
// 2. The fetch request
{
"type": "server_tool_use",
"id": "srvtoolu_01234567890abcdef",
"name": "web_fetch",
"input": {
"url": "https://example.com/article"
}
},
// 3. Fetch results
{
"type": "web_fetch_tool_result",
"tool_use_id": "srvtoolu_01234567890abcdef",
"content": {
"type": "web_fetch_result",
"url": "https://example.com/article",
"content": {
"type": "document",
"source": {
"type": "text",
"media_type": "text/plain",
"data": "Full text content of the article..."
},
"title": "Article Title",
"citations": { "enabled": true }
},
"retrieved_at": "2025-08-25T10:30:00Z"
}
},
// 4. Claude's analysis with citations (if enabled)
{
"text": "Based on the article, ",
"type": "text"
},
{
"text": "the main argument presented is that artificial intelligence will transform healthcare",
"type": "text",
"citations": [
{
"type": "char_location",
"document_index": 0,
"document_title": "Article Title",
"start_char_index": 1234,
"end_char_index": 1456,
"cited_text": "Artificial intelligence is poised to revolutionize healthcare delivery..."
}
]
}
],
"id": "msg_a930390d3a",
"usage": {
"input_tokens": 25039,
"output_tokens": 931,
"server_tool_use": {
"web_fetch_requests": 1
}
},
"stop_reason": "end_turn"
}가져오기 결과에는 다음이 포함됩니다:
url: 가져온 URLcontent: 가져온 콘텐츠를 포함하는 문서 블록retrieved_at: 콘텐츠가 검색된 타임스탬프웹 가져오기 도구는 성능을 개선하고 중복 요청을 줄이기 위해 결과를 캐시합니다. 반환된 콘텐츠가 항상 URL에서 사용 가능한 최신 버전을 반영하지 않을 수 있습니다. 캐시 동작은 자동으로 관리되며 다양한 콘텐츠 유형과 사용 패턴에 맞게 최적화하기 위해 시간이 지남에 따라 변경될 수 있습니다.
PDF 문서의 경우 콘텐츠는 base64로 인코딩된 데이터로 반환됩니다:
{
"type": "web_fetch_tool_result",
"tool_use_id": "srvtoolu_02",
"content": {
"type": "web_fetch_result",
"url": "https://example.com/paper.pdf",
"content": {
"type": "document",
"source": {
"type": "base64",
"media_type": "application/pdf",
"data": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmo..."
},
"citations": { "enabled": true }
},
"retrieved_at": "2025-08-25T10:30:02Z"
}
}웹 가져오기 도구에서 오류가 발생하면 Claude API는 응답 본문에 오류가 표시된 200(성공) 응답을 반환합니다:
{
"type": "web_fetch_tool_result",
"tool_use_id": "srvtoolu_a93jad",
"content": {
"type": "web_fetch_tool_error",
"error_code": "url_not_accessible"
}
}가능한 오류 코드는 다음과 같습니다:
invalid_input: 잘못된 URL 형식url_too_long: URL이 최대 길이(250자)를 초과함url_not_allowed: 도메인 필터링 규칙 및 모델 제한에 의해 URL이 차단됨url_not_accessible: 콘텐츠 가져오기 실패(HTTP 오류)too_many_requests: 속도 제한 초과unsupported_content_type: 지원되지 않는 콘텐츠 유형(텍스트 및 PDF만 지원)max_uses_exceeded: 웹 가져오기 도구 최대 사용 횟수 초과unavailable: 내부 오류 발생보안상의 이유로 웹 가져오기 도구는 이전에 대화 컨텍스트에 나타난 URL만 가져올 수 있습니다. 여기에는 다음이 포함됩니다:
이 도구는 Claude가 생성한 임의의 URL이나 컨테이너 기반 서버 도구(Code Execution, Bash 등)의 URL을 가져올 수 없습니다.
웹 가져오기는 포괄적인 정보 수집을 위해 웹 검색과 원활하게 작동합니다:
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-8",
max_tokens=4096,
messages=[
{
"role": "user",
"content": "Find recent articles about quantum computing and analyze the most relevant one in detail",
}
],
tools=[
{"type": "web_search_20250305", "name": "web_search", "max_uses": 3},
{
"type": "web_fetch_20250910",
"name": "web_fetch",
"max_uses": 5,
"citations": {"enabled": True},
},
],
)
print(response)이 워크플로에서 Claude는 다음을 수행합니다:
웹 검색 도구와 웹 가져오기 도구가 모두 활성화되어 있고 사용자가 URL을 제공하지 않고 특정 페이지나 문서를 지정하는 경우(예: "anthropics/anthropic-sdk-python 리포지토리의 README를 읽어주세요"), Claude는 웹 검색을 사용하여 해당 리소스를 찾은 다음 결과를 가져옵니다.
턴 간에 도구 정의를 캐싱하는 방법은 프롬프트 캐싱과 함께 도구 사용을 참조하세요.
스트리밍이 활성화되면 가져오기 이벤트는 콘텐츠 검색 중 일시 정지와 함께 스트림의 일부가 됩니다:
event: message_start
data: {"type": "message_start", "message": {"id": "msg_abc123", "type": "message"}}
event: content_block_start
data: {"type": "content_block_start", "index": 0, "content_block": {"type": "text", "text": ""}}
// Claude's decision to fetch
event: content_block_start
data: {"type": "content_block_start", "index": 1, "content_block": {"type": "server_tool_use", "id": "srvtoolu_xyz789", "name": "web_fetch"}}
// Fetch URL streamed
event: content_block_delta
data: {"type": "content_block_delta", "index": 1, "delta": {"type": "input_json_delta", "partial_json": "{\"url\":\"https://example.com/article\"}"}}
// Pause while fetch executes
// Fetch results streamed
event: content_block_start
data: {"type": "content_block_start", "index": 2, "content_block": {"type": "web_fetch_tool_result", "tool_use_id": "srvtoolu_xyz789", "content": {"type": "web_fetch_result", "url": "https://example.com/article", "content": {"type": "document", "source": {"type": "text", "media_type": "text/plain", "data": "Article content..."}}}}}
// Claude's response continues...Messages Batches API에 웹 가져오기 도구를 포함할 수 있습니다. Messages Batches API를 통한 웹 가져오기 도구 호출은 일반 Messages API 요청과 동일한 가격이 책정됩니다.
웹 가져오기 사용에는 표준 토큰 비용 외에 추가 요금이 없습니다:
{
"usage": {
"input_tokens": 25039,
"output_tokens": 931,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0,
"server_tool_use": {
"web_fetch_requests": 1
}
}
}웹 가져오기 도구는 Claude API에서 추가 비용 없이 사용할 수 있습니다. 대화 컨텍스트의 일부가 되는 가져온 콘텐츠에 대한 표준 토큰 비용만 지불하면 됩니다.
과도한 토큰을 소비할 수 있는 대용량 콘텐츠를 실수로 가져오는 것을 방지하려면, max_content_tokens 매개변수를 사용하여 사용 사례와 예산 고려 사항에 따라 적절한 제한을 설정하세요.
일반적인 콘텐츠에 대한 토큰 사용량 예시:
Was this page helpful?
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-8",
max_tokens=4096,
messages=[
{
"role": "user",
"content": "Fetch the content at https://example.com/research-paper and extract the key findings.",
}
],
tools=[{"type": "web_fetch_20260209", "name": "web_fetch"}],
)
print(response)client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[
{
"role": "user",
"content": "Please analyze the content at https://example.com/article",
}
],
tools=[{"type": "web_fetch_20250910", "name": "web_fetch", "max_uses": 5}],
)
print(response)