Introducing /parse. Convert PDFs, Word docs, or spreadsheets into clean data for AI agents 5x faster. Try it now →

How to add basic web search from the command line

Basic web search from the command line means sending a query to a search API and receiving ranked results as structured text, without a browser. The two main approaches are calling a search API directly with curl or using a dedicated CLI tool that handles authentication, output formatting, and pagination for you.

ApproachSetupOutput formatBest for
curl + search APIAPI key, manual auth headersRaw JSONScripting, one-off lookups
Dedicated CLI toolInstall once, store keyFormatted text or JSONInteractive use, shell pipelines
Search-enabled agent CLIInstall onceLLM-ready markdownAI agents, code assistants
Browser automationHeadless browser runtimeFull HTMLSites that block API access

Command-line search is most useful when you need to pull live web results into a shell script, feed real-time data to a local model, or run a quick lookup without leaving the terminal. The minimum setup is a search API key and one curl call.

The Firecrawl CLI adds web search to the terminal in one step:

npx -y firecrawl-cli@latest init
firecrawl search "your query here"

Results come back as LLM-ready markdown with page content included, skipping the separate scrape step. The CLI also registers automatically as a tool in Claude Code, Codex, and other agents that support tool use.

Last updated: Apr 30, 2026
FOOTER
The easiest way to extract
data from the web
Backed by
Y Combinator
LinkedinGithubYouTube
SOC II · Type 2
AICPA
SOC 2
X (Twitter)
Discord