@youdotcom-oss/api 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,10 +25,10 @@ bunx @youdotcom-oss/api search --json '{"query":"AI developments"}' --client Ope
25
25
  bun i -g @youdotcom-oss/api
26
26
  ydc search --json '{"query":"AI developments"}' --client Openclaw
27
27
 
28
- # Get AI answer with citations
29
- bunx @youdotcom-oss/api express --json '{
30
- "input":"What happened in AI this week?",
31
- "tools":[{"type":"web_search"}]
28
+ # Get comprehensive research with citations
29
+ bunx @youdotcom-oss/api deep-search --json '{
30
+ "query":"What happened in AI this week?",
31
+ "search_effort":"high"
32
32
  }' --client MyAgent
33
33
 
34
34
  # Extract web content
@@ -100,7 +100,7 @@ All commands require the `--json` flag with a JSON string containing the query p
100
100
 
101
101
  ```bash
102
102
  ydc search --json '{"query":"..."}'
103
- ydc express --json '{"input":"..."}'
103
+ ydc deep-search --json '{"query":"...","search_effort":"medium"}'
104
104
  ydc contents --json '{"urls":["..."]}'
105
105
  ```
106
106
 
@@ -110,6 +110,7 @@ ydc contents --json '{"urls":["..."]}'
110
110
  - `--api-key <key>` - You.com API key (overrides YDC_API_KEY)
111
111
  - `--client <name>` - Client name for tracking (overrides YDC_CLIENT)
112
112
  - `--schema` - Output JSON schema for what can be passed to --json
113
+ - `--dry-run` - Show request details without making API call
113
114
  - `--help, -h` - Show help
114
115
 
115
116
  ### Schema Discovery
@@ -120,8 +121,8 @@ Use `--schema` to discover what parameters each command accepts:
120
121
  # Get schema for search command
121
122
  ydc search --schema
122
123
 
123
- # Get schema for express command
124
- ydc express --schema
124
+ # Get schema for deep-search command
125
+ ydc deep-search --schema
125
126
 
126
127
  # Get schema for contents command
127
128
  ydc contents --schema
@@ -182,32 +183,31 @@ Examples:
182
183
  - `livecrawl` - Live-crawl sections: web/news/all
183
184
  - `livecrawl_formats` - html/markdown
184
185
 
185
- ### Express Command
186
+ ### Deep-Search Command
186
187
 
187
188
  ```bash
188
- ydc express --json '{"input":"..."}' [options]
189
+ ydc deep-search --json '{"query":"..."}' [options]
189
190
 
190
191
  Examples:
191
- # Fast answer
192
- api express --json '{"input":"What is quantum computing?"}' --client Openclaw
192
+ # Comprehensive research with medium effort
193
+ api deep-search --json '{"query":"What is quantum computing?"}' --client Openclaw
193
194
 
194
- # Answer with web search
195
- api express --json '{
196
- "input":"Latest AI news",
197
- "tools":[{"type":"web_search"}]
195
+ # High-effort deep research (up to 5 minutes)
196
+ api deep-search --json '{
197
+ "query":"Latest breakthroughs in AI agents",
198
+ "search_effort":"high"
198
199
  }' --client Openclaw
199
200
 
200
201
  # Parse answer and sources
201
- api express --json '{
202
- "input":"AI trends",
203
- "tools":[{"type":"web_search"}]
202
+ api deep-search --json '{
203
+ "query":"AI trends 2026"
204
204
  }' --client Openclaw | \
205
- jq -r '.answer, "\nSources:", (.results.web[]? | "- \(.title)")'
205
+ jq -r '.answer, "\nSources:", (.results[]? | "- \(.title): \(.url)")'
206
206
  ```
207
207
 
208
- **Available express parameters** (use `--schema` to see full schema):
209
- - `input` (required) - Question or prompt for AI
210
- - `tools` - Array of tools: `[{"type":"web_search"}]`
208
+ **Available deep-search parameters** (use `--schema` to see full schema):
209
+ - `query` (required) - Research question requiring in-depth investigation
210
+ - `search_effort` - Computation budget: `low` (<30s), `medium` (<60s, default), `high` (<300s)
211
211
 
212
212
  ### Contents Command
213
213
 
@@ -317,22 +317,22 @@ console.log(response.results.news); // News results
317
317
  console.log(response.metadata); // Query metadata
318
318
  ```
319
319
 
320
- ### Express
320
+ ### Deep-Search
321
321
 
322
322
  ```typescript
323
- import { callExpressAgent, ExpressAgentInputSchema } from '@youdotcom-oss/api';
323
+ import { callDeepSearch, DeepSearchQuerySchema } from '@youdotcom-oss/api';
324
324
 
325
- const response = await callExpressAgent({
326
- agentInput: {
327
- input: 'What happened in AI this week?',
328
- tools: [{ type: 'web_search' }],
325
+ const response = await callDeepSearch({
326
+ deepSearchQuery: {
327
+ query: 'What happened in AI this week?',
328
+ search_effort: 'high', // low | medium | high
329
329
  },
330
330
  YDC_API_KEY: process.env.YDC_API_KEY,
331
331
  getUserAgent,
332
332
  });
333
333
 
334
- console.log(response.answer); // AI answer
335
- console.log(response.results?.web); // Optional search results
334
+ console.log(response.answer); // Comprehensive answer with inline citations
335
+ console.log(response.results); // Array of sources with URLs, titles, and snippets
336
336
  ```
337
337
 
338
338
  ### Contents
@@ -410,10 +410,10 @@ search=$(api search --json '{
410
410
  "livecrawl_formats":"markdown"
411
411
  }' --client Openclaw)
412
412
 
413
- # Get AI answer with web search
414
- answer=$(api express --json '{
415
- "input":"Summarize AI developments",
416
- "tools":[{"type":"web_search"}]
413
+ # Get comprehensive research with citations
414
+ answer=$(api deep-search --json '{
415
+ "query":"Summarize AI developments in 2026",
416
+ "search_effort":"high"
417
417
  }' --client Openclaw)
418
418
 
419
419
  # Extract top result URL and fetch content
@@ -486,8 +486,8 @@ All functions are fully typed with TypeScript. Import types alongside functions:
486
486
  import type {
487
487
  SearchQuery,
488
488
  SearchResponse,
489
- ExpressAgentInput,
490
- ExpressAgentMcpResponse,
489
+ DeepSearchQuery,
490
+ DeepSearchResponse,
491
491
  ContentsQuery,
492
492
  ContentsApiResponse,
493
493
  } from '@youdotcom-oss/api';