Web Search and Fetch
Module: Core Features | Lesson: 7 of 7 | Time: ~10 minutes
What You Will Learn
- How WebSearch lets Claude search the internet
- How WebFetch retrieves content from URLs
- When and why Claude goes online
Prerequisites
- Completed Searching with Grep
Why This Matters
Claude has a vast amount of built-in knowledge, but that knowledge has a cutoff date. When you need the latest documentation, current package versions, real-time information, or content from a specific web page, Claude can go online using two tools: WebSearch and WebFetch. These tools bridge the gap between Claude's built-in knowledge and the live internet.
Two Tools for Online Access
| Tool | What It Does | Best For |
|---|---|---|
| WebSearch | Searches the internet for information | Finding answers, looking up documentation, checking current versions |
| WebFetch | Retrieves the content of a specific URL | Reading a page you already know about, pulling data from a specific site |
Think of it this way: WebSearch is like typing into Google. WebFetch is like clicking on a specific link you already have.
When Claude Goes Online
Claude does not automatically search the internet for every question. It uses its built-in knowledge first. Claude goes online when:
- You ask about something very recent: "What is the latest version of React?"
- You reference a URL: "Read the page at https://docs.python.org/3/tutorial/"
- You ask Claude to search: "Search the web for Windows PowerShell cheat sheet"
- Built-in knowledge is not enough: "What are the current system requirements for Unity 2025?"
You do not need to tell Claude to "use the WebSearch tool." Just ask your question naturally. If Claude thinks it needs online information, it will search automatically. You can also explicitly ask Claude to search if you want to make sure it checks the web.
Using WebSearch
Here are some natural ways to trigger a web search:
> What is the latest version of Node.js?
> Search for how to install Python on Windows 11
> Look up the documentation for the Express.js framework
> What are the current best practices for CSS grid layout?
When Claude searches, you will see something like:
─ WebSearch: "latest Node.js version 2026"
Based on my search results, the latest LTS version of Node.js is...
Claude searches, reads through the results, and gives you a summary rather than just a list of links.
Using WebFetch
When you already have a specific URL, Claude can fetch its contents:
> Read the page at https://docs.python.org/3/tutorial/introduction.html
> Fetch the content from this URL: https://react.dev/learn
> What does this page say? https://learn.microsoft.com/en-us/powershell/
WebFetch retrieves the page content and Claude processes it for you:
─ WebFetch: https://docs.python.org/3/tutorial/introduction.html
Here is a summary of the Python tutorial introduction page...
Claude reads through the page and presents the relevant information instead of dumping the entire raw HTML on you.
If someone sends you a link to documentation, a Stack Overflow answer, or a tutorial, you can paste it directly into Claude Code:
> Summarize this article: https://example.com/blog/how-to-use-git
Claude will fetch the page and give you the key points.
Practical Use Cases
Looking Up Documentation
> How do I use the fs.readFile function in Node.js? Check the official docs.
> What parameters does the Python requests.get() function accept?
> Search for the PowerShell Get-ChildItem documentation
Checking Current Versions and Requirements
> What is the latest stable version of Python?
> What are the system requirements for Visual Studio Code?
> What version of npm comes with Node.js 22?
Finding Solutions to Errors
> Search for: "PowerShell cannot be loaded because running scripts is disabled on this system"
> Look up how to fix "EACCES permission denied" on npm install
> Search for solutions to "Python was not found" on Windows
Learning New Topics
> Search for a beginner's guide to Git
> Find a tutorial on how to create a REST API with Python
> Look up the basics of HTML forms
Limitations
Web tools are powerful but have some constraints you should know about:
- Not a full browser: Claude cannot interact with web pages (no clicking buttons, filling forms, or running JavaScript). It reads the text content of pages.
- Some sites block access: A few websites prevent automated access. If Claude cannot fetch a page, it will tell you.
- Dynamic content may be missing: Content that loads after the page via JavaScript (like infinite scroll feeds or single-page apps) may not be available.
- Rate limits: If you make many web requests in a short time, some searches may be slower or limited.
- No login access: Claude cannot access pages that require you to be logged in (like private GitHub repositories or paywalled articles).
If Claude cannot access a page, you can try an alternative:
> I need the content from that page. Can you search for the same topic and find it from another source?
Common Questions
Q: Does Claude search the web for every question I ask? No. Claude uses its built-in knowledge first, which is faster. It only searches the web when it believes online information would be more accurate or up-to-date.
Q: Can Claude access my private repositories or accounts? No. Claude can only access publicly available web pages. It cannot log into any services on your behalf.
Q: Does web search cost extra? Web search and fetch are included in your Claude Code usage. They do not have a separate cost, but they do use some of your conversation context (the information Claude retrieves takes up space in the conversation).
Q: Can I tell Claude NOT to search the web? Yes. You can say "Answer from your built-in knowledge only, do not search the web" and Claude will rely solely on what it already knows.
Try It Yourself
Step 1: Try a Web Search
Start Claude Code and ask about something that changes frequently:
> What is the latest LTS version of Node.js right now?
Claude should search the web and give you a current answer.
Step 2: Fetch a Specific Page
> Read this page and summarize it for me: https://code.visualstudio.com/docs/getstarted/tips-and-tricks
Claude will fetch the page and give you a summary.
Step 3: Research a Topic
> Search for the best way to organize files in a JavaScript project. Give me a summary of the recommendations.
Claude will search multiple sources and synthesize the advice.
Step 4: Compare Built-in vs Web Knowledge
Try asking something Claude knows, then ask it to verify:
> From your built-in knowledge, what is the latest Python version?
> Now search the web to confirm. Was your built-in answer correct?
This shows you the difference between Claude's training data and live information.
If Claude successfully searched the web, fetched a specific page, and explained the results to you, you have a good grasp of the web tools. You now know all seven core tools in Claude Code.
What You Learned
- WebSearch: Claude searches the internet for current information, like using a search engine
- WebFetch: Claude retrieves content from a specific URL you provide
- Automatic use: Claude decides when to search based on your question, but you can ask explicitly
- Best for: Current versions, documentation, error solutions, and any topic that changes over time
- Limitations: No login access, no interactive pages, some sites may block access
- You can control it: Ask Claude to search or not search as you prefer
How was this lesson? Take 2 minutes to share your feedback — it helps us make the tutorials better for everyone.