CLI Web Search
The Smart Search SDK provides powerful CLI commands for web searching, page fetching, and content extraction.
Overview
Web search commands allow you to:
Search the web for relevant documents and pages
Fetch web page URLs matching your query
Extract specific web page content
Get snippets from web pages based on queries
Extract keypoints from web pages
Prerequisites
Before using web search commands, ensure you have:
Smart Search SDK installed
SMARTSEARCH_BASE_URLenvironment variable setValid authentication credentials
Available Commands
Web Search
Search the web for documents or pages relevant to your query.
Usage
Parameters
--query
Yes
String
-
Search query string
--site
No
String
-
Comma-separated URLs to limit results to specific sites
--result-type
No
String
snippets
Type of results: snippets, keypoints, summary, description
--engine
No
String
auto
Search engine: auto, firecrawl, or perplexity
--size
No
Integer
5
Maximum number of results (1-50)
--stream
No
Boolean
false
Enable streaming response
--view
No
String
table
Output format: table or json
Examples
Basic search with snippets:
Search with keypoints:
Search with JSON output:
Streaming search:
Search with site filter:
Search with multiple sites:
Search with specific engine:
Response (Table View)
Response (JSON View)
Web - Map Website
Map a website and discover its URL structure and hierarchy.
Usage
Parameters
--base-url
Yes
String
-
Base URL of the website to map
--page
No
Integer
1
Page number to return (default is 1). Can be skipped if --return-all-map is true.
--size
No
Integer
20
Maximum number of URLs to return (1-1000), default is 20. Can be skipped if --return-all-map is true.
--return-all-map
No
Boolean
false
Return all mapped links (default is false)
--include-subdomains
No
Boolean
false
Include subdomains in the mapping
--query
No
String
-
Optional query to filter URLs by keywords
--view
No
String
table
Output format: table or json
Examples
Basic website mapping:
Map with keyword filtering:
Include subdomains:
Return all mapped links:
Get JSON output:
Response (Table View)
Response (JSON View)
Web - Search URLs
Search the web for pages and return their URLs (similar to Google search results).
Usage
Parameters
--query
Yes
String
-
Search query string
--site
No
String
-
Comma-separated URLs to limit results to specific sites
--engine
No
String
auto
Search engine: auto, firecrawl, or perplexity
--size
No
Integer
5
Maximum number of URLs (1-50)
--stream
No
Boolean
false
Enable streaming response
--view
No
String
table
Output format: table or json
Examples
Find URLs about Python documentation:
Get URLs with JSON output:
Search URLs with site filter:
Search multiple sites for URLs:
Search with specific engine:
Response (Table View)
Web - Fetch Page
Fetch a single web page by URL and return its content and metadata.
Usage
Parameters
--url
Yes
String
-
URL of the web page to fetch
--json-schema
No
String
-
Path to JSON schema file or JSON string
--return-html
No
Boolean
false
Return full HTML content
--stream
No
Boolean
false
Enable streaming response
--view
No
String
json
Output format: json or markdown
Examples
Fetch page content:
Fetch with HTML:
Fetch with JSON schema:
Fetch with schema from file:
Response (Markdown View)
Response (JSON View)
Web - Get Web Page Snippets
Extract relevant text snippets from a web page for a given query.
Usage
Parameters
--query
Yes
String
-
Query to search within the page
--url
Yes
String
-
URL of the web page to extract from
--size
No
Integer
5
Maximum number of snippets (1-50)
--json-schema
No
String
-
Path to JSON schema file or JSON string
--style
No
String
paragraph
Snippet style: paragraph or sentence
--stream
No
Boolean
false
Enable streaming response
--view
No
String
table
Output format: table or json
Examples
Extract snippets about list comprehension:
Extract sentence-style snippets:
Extract with JSON schema:
Response (Table View)
Web - Get Web Page Keypoints
Extract concise key points from a web page.
Usage
Parameters
--query
Yes
String
-
Query to search for
--url
Yes
String
-
URL of the web page to extract from
--size
No
Integer
5
Maximum number of keypoints (1-50)
--json-schema
No
String
-
Path to JSON schema file or JSON string
--stream
No
Boolean
false
Enable streaming response
--view
No
String
table
Output format: table or json
Examples
Extract Python features:
Get keypoints with JSON output:
Extract keypoints with JSON schema:
Response (Table View)
Output Formats
Table View
Human-readable format
Best for interactive CLI usage
Automatically formats columns and rows
JSON View
Machine-readable format
Best for scripting and automation
Complete data structure with all fields
Streaming Responses
Enable streaming for better performance with large result sets:
Benefits:
Real-time results as they arrive
Reduced memory usage
Better user experience for long-running queries
Best Practices
Choose appropriate result types:
Use
snippetsfor detailed text excerptsUse
keypointsfor concise summariesUse
summaryfor high-level overviews
Optimize size parameter:
Start with default (5) for quick results
Increase for comprehensive searches
Maximum is 50 results per query
Use streaming for performance:
Enable
--stream truefor queries returning many resultsReduces waiting time and memory usage
Select appropriate snippet style:
paragraph: For contextual informationsentence: For precise, concise answers
JSON for automation:
Use
--view jsonwhen integrating with scriptsEasier to parse and process programmatically
Common Use Cases
Research and Documentation
Quick Information Lookup
Content Aggregation
Page Analysis
Error Handling
All commands provide clear error messages:
Common errors:
Invalid URL: Ensure URLs start with
http://orhttps://Connection timeout: Check network connectivity and
SMARTSEARCH_BASE_URLAuthentication failed: Verify credentials and environment variables
Size out of range: Use values between 1 and 50
Last updated
