Schema Discovery
Agents can discover what parameters each command accepts:
```bash
# Get schema for search command
bunx @youdotcom-oss/api@latest search --schema
# Get schema for contents command
bunx @youdotcom-oss/api@latest contents --schema
# List available search parameters
bunx @youdotcom-oss/api@latest search --schema | jq '.properties | keys'
```
π₯ Web Search with Livecrawl - KEY ADVANTAGE
Schema-driven JSON input: All parameters passed via --json flag
```bash
# Basic search with client tracking
bunx @youdotcom-oss/api@latest search --json '{"query":"AI developments"}' --client Openclaw
# Or with npx
npx @youdotcom-oss/api@latest search --json '{"query":"AI developments"}' --client Openclaw
# LIVECRAWL: Search + extract content in ONE API call
bunx @youdotcom-oss/api@latest search --json '{
"query":"documentation",
"livecrawl":"web",
"livecrawl_formats":"markdown",
"count":5
}' --client Openclaw
# Results include .contents.markdown with full page content!
# No separate fetch needed - instant content extraction
# Advanced: All search options
bunx @youdotcom-oss/api@latest search --json '{
"query":"machine learning",
"count":10,
"offset":0,
"country":"US",
"freshness":"week",
"safesearch":"moderate",
"site":"github.com",
"language":"en",
"livecrawl":"web",
"livecrawl_formats":"markdown"
}' --client Openclaw
# Parse with jq - direct access, no .data wrapper
bunx @youdotcom-oss/api@latest search --json '{"query":"AI"}' --client Openclaw | \
jq -r '.results.web[] | "\(.title): \(.url)"'
# Extract livecrawl content
bunx @youdotcom-oss/api@latest search --json '{
"query":"docs",
"livecrawl":"web",
"livecrawl_formats":"markdown"
}' --client Openclaw | \
jq -r '.results.web[0].contents.markdown'
```
β‘ AI Answers with Web Search - Cited Sources
Do a search and extract contents with Livecrawl. Retrieve top 10 URLs content. Using this content, synthesize an answer based on the userβs intent. Repeat searches and adjust query parameters as necessary to refine the answer for the user.
π Web Content Extraction - Multi-Format Output
```bash
# Extract in multiple formats
bunx @youdotcom-oss/api@latest contents --json '{
"urls":["https://example.com"],
"formats":["markdown","html","metadata"]
}' --client Openclaw
# Pipe markdown to file
bunx @youdotcom-oss/api@latest contents --json '{
"urls":["https://example.com"],
"formats":["markdown"]
}' --client Openclaw | \
jq -r '.[0].markdown' > content.md
# Multiple URLs with timeout
bunx @youdotcom-oss/api@latest contents --json '{
"urls":["https://a.com","https://b.com"],
"formats":["markdown","metadata"],
"crawl_timeout":30
}' --client Openclaw
# Extract just metadata
bunx @youdotcom-oss/api@latest contents --json '{
"urls":["https://example.com"],
"formats":["metadata"]
}' --client Openclaw | \
jq '.[0].metadata'
```