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_URL environment variable set

  • Valid authentication credentials

Available Commands

Search the web for documents or pages relevant to your query.

Usage

Parameters

Parameter
Required
Type
Default
Description

--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

Parameter
Required
Type
Default
Description

--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

Parameter
Required
Type
Default
Description

--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

Parameter
Required
Type
Default
Description

--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

Parameter
Required
Type
Default
Description

--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

Parameter
Required
Type
Default
Description

--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

  1. Choose appropriate result types:

    • Use snippets for detailed text excerpts

    • Use keypoints for concise summaries

    • Use summary for high-level overviews

  2. Optimize size parameter:

    • Start with default (5) for quick results

    • Increase for comprehensive searches

    • Maximum is 50 results per query

  3. Use streaming for performance:

    • Enable --stream true for queries returning many results

    • Reduces waiting time and memory usage

  4. Select appropriate snippet style:

    • paragraph: For contextual information

    • sentence: For precise, concise answers

  5. JSON for automation:

    • Use --view json when integrating with scripts

    • Easier 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:// or https://

  • Connection timeout: Check network connectivity and SMARTSEARCH_BASE_URL

  • Authentication failed: Verify credentials and environment variables

  • Size out of range: Use values between 1 and 50

Last updated