@@ -80,32 +80,51 @@ def parse_args(argv)
8080 Create a new webset from search criteria or an import
8181
8282 Required (choose one):
83- --search JSON Search configuration (supports @file.json)
84- --import ID Import or webset ID to create webset from
85- (accepts import_* or webset_* IDs)
83+ --search JSON Search configuration as JSON (supports @file.json)
84+ Format: {"query":"...","count":10,"scope":[...]}
85+ The 'scope' field limits search to specific sources
86+ --import ID Import/webset ID to attach data to this webset
87+ (loads data but does NOT filter searches)
88+ Format: import_abc123 or webset_xyz789
8689
8790 Options:
8891 --enrichments JSON Array of enrichment configs (supports @file.json)
89- --exclude JSON Array of exclude configs (supports @file.json)
92+ Format: [{"description":"...","format":"text"}]
93+ --exclude JSON Sources to exclude from searches (supports @file.json)
94+ Format: [{"source":"import|webset","id":"..."}]
9095 --external-id ID External identifier for the webset
9196 --metadata JSON Custom metadata (supports @file.json)
97+ Format: {"key":"value"}
9298 --wait Wait for webset to reach idle status
9399 --api-key KEY Exa API key (or set EXA_API_KEY env var)
94100 --output-format FMT Output format: json, pretty, or text (default: json)
95101 --help, -h Show this help message
96102
103+ JSON Format Details:
104+ search.scope Array of source references to limit search
105+ Format: [{"source":"import|webset","id":"..."}]
106+ With relationship (hop search):
107+ [{"source":"webset","id":"ws_123",
108+ "relationship":{"definition":"investors of","limit":3}}]
109+
110+ IMPORTANT: Cannot use the same import ID in both --import and search.scope
111+ (this will return a 400 error from the API)
112+
97113 Examples:
98114 # Create webset from search
99115 exa-ai webset-create --search '{"query":"AI startups","count":10}'
100116 exa-ai webset-create --search @search.json --enrichments @enrichments.json
101117 exa-ai webset-create --search @search.json --wait
102118
119+ # Create webset with scoped search (filter to specific import)
120+ exa-ai webset-create --search '{"query":"CEOs","count":10,"scope":[{"source":"import","id":"import_abc"}]}'
121+
103122 # Create webset from import
104123 exa-ai webset-create --import import_abc123
105124 exa-ai webset-create --import import_def456 --enrichments @enrichments.json
106125
107- # Create webset from existing webset
108- exa-ai webset-create --import webset_xyz789
126+ # Load import AND run search (search not scoped to import)
127+ exa-ai webset-create --import import_abc123 --search '{"query":"investors","count":20}'
109128 HELP
110129 exit 0
111130 else
0 commit comments