import { ZodSchema } from 'zod'; /** * Types for the Search Monitors API */ type SearchMonitorStatus = "active" | "paused" | "disabled"; type SearchMonitorRunStatus = "pending" | "running" | "completed" | "failed" | "cancelled"; type SearchMonitorRunFailReason = "api_key_invalid" | "insufficient_credits" | "invalid_params" | "rate_limited" | "search_unavailable" | "search_failed" | "internal_error"; type SearchMonitorWebhookEvent = "monitor.created" | "monitor.updated" | "monitor.deleted" | "monitor.run.created" | "monitor.run.completed"; interface SearchMonitorSearch { query: string; numResults?: number; includeDomains?: string[]; excludeDomains?: string[]; contents?: ContentsOptions; } interface SearchMonitorTrigger { type: "interval"; period: string; } interface SearchMonitorWebhook { url: string; events?: SearchMonitorWebhookEvent[]; } interface GroundingCitation { url: string; title: string; } interface GroundingEntry { field: string; citations: GroundingCitation[]; confidence: "low" | "medium" | "high"; } interface SearchMonitorRunOutput { results?: Record[] | null; content?: string | null; grounding?: GroundingEntry[] | null; } interface SearchMonitor { id: string; name: string | null; status: SearchMonitorStatus; search: SearchMonitorSearch; trigger: SearchMonitorTrigger | null; outputSchema: Record | null; metadata: Record | null; webhook: SearchMonitorWebhook; nextRunAt: string | null; createdAt: string; updatedAt: string; } interface CreateSearchMonitorResponse extends SearchMonitor { webhookSecret: string; } interface SearchMonitorRun { id: string; monitorId: string; status: SearchMonitorRunStatus; output: SearchMonitorRunOutput | null; failReason: SearchMonitorRunFailReason | null; startedAt: string | null; completedAt: string | null; failedAt: string | null; cancelledAt: string | null; durationMs: number | null; createdAt: string; updatedAt: string; } interface CreateSearchMonitorParams { name?: string; search: SearchMonitorSearch; trigger?: SearchMonitorTrigger; outputSchema?: Record; metadata?: Record; webhook: SearchMonitorWebhook; } interface UpdateSearchMonitorParams { name?: string | null; status?: SearchMonitorStatus; search?: SearchMonitorSearch; trigger?: SearchMonitorTrigger | null; outputSchema?: Record | null; metadata?: Record | null; webhook?: SearchMonitorWebhook; } interface ListSearchMonitorsParams { cursor?: string; limit?: number; status?: SearchMonitorStatus; } interface ListSearchMonitorRunsParams { cursor?: string; limit?: number; } interface ListSearchMonitorsResponse { data: SearchMonitor[]; hasMore: boolean; nextCursor: string | null; } interface ListSearchMonitorRunsResponse { data: SearchMonitorRun[]; hasMore: boolean; nextCursor: string | null; } interface TriggerSearchMonitorResponse { triggered: boolean; } /** * Base client for Search Monitors API */ type QueryParams$2 = Record; declare class SearchMonitorsBaseClient { protected client: Exa; constructor(client: Exa); protected request(endpoint: string, method?: string, data?: Record, params?: QueryParams$2): Promise; protected buildPaginationParams(pagination?: ListSearchMonitorsParams | ListSearchMonitorRunsParams): QueryParams$2; } /** * Client for the Search Monitors API */ /** * Client for managing Search Monitor Runs */ declare class SearchMonitorRunsClient extends SearchMonitorsBaseClient { /** * List all runs for a Search Monitor * @param monitorId The ID of the Search Monitor * @param options Pagination options * @returns The list of Search Monitor runs */ list(monitorId: string, options?: ListSearchMonitorRunsParams): Promise; /** * Get a specific Search Monitor run * @param monitorId The ID of the Search Monitor * @param runId The ID of the run * @returns The Search Monitor run */ get(monitorId: string, runId: string): Promise; /** * Iterate through all runs for a Search Monitor, handling pagination automatically * @param monitorId The ID of the Search Monitor * @param options Pagination options * @returns Async generator of Search Monitor runs */ listAll(monitorId: string, options?: ListSearchMonitorRunsParams): AsyncGenerator; /** * Collect all runs for a Search Monitor into an array * @param monitorId The ID of the Search Monitor * @param options Pagination options * @returns Promise resolving to an array of all Search Monitor runs */ getAll(monitorId: string, options?: ListSearchMonitorRunsParams): Promise; } /** * Client for managing Search Monitors */ declare class SearchMonitorsClient extends SearchMonitorsBaseClient { /** * Client for managing Search Monitor Runs */ runs: SearchMonitorRunsClient; constructor(client: Exa); /** * Create a Search Monitor * @param params The monitor creation parameters * @returns The created Search Monitor with webhookSecret */ create(params: CreateSearchMonitorParams): Promise; /** * Get a Search Monitor by ID * @param id The ID of the Search Monitor * @returns The Search Monitor */ get(id: string): Promise; /** * List Search Monitors * @param options Pagination and filtering options * @returns The list of Search Monitors */ list(options?: ListSearchMonitorsParams): Promise; /** * Update a Search Monitor * @param id The ID of the Search Monitor * @param params The update parameters * @returns The updated Search Monitor */ update(id: string, params: UpdateSearchMonitorParams): Promise; /** * Delete a Search Monitor * @param id The ID of the Search Monitor * @returns The deleted Search Monitor */ delete(id: string): Promise; /** * Trigger a Search Monitor run immediately * @param id The ID of the Search Monitor * @returns Whether the monitor was triggered */ trigger(id: string): Promise; /** * Iterate through all Search Monitors, handling pagination automatically * @param options Pagination and filtering options * @returns Async generator of Search Monitors */ listAll(options?: ListSearchMonitorsParams): AsyncGenerator; /** * Collect all Search Monitors into an array * @param options Pagination and filtering options * @returns Promise resolving to an array of all Search Monitors */ getAll(options?: ListSearchMonitorsParams): Promise; } interface components$1 { schemas: { ListResearchResponseDto: { /** @description Research requests ordered by creation time (newest first) */ data: components$1["schemas"]["ResearchDtoClass"][]; /** @description If true, use nextCursor to fetch more results */ hasMore: boolean; /** @description Pass this value as the cursor parameter to fetch the next page */ nextCursor: string | null; }; ResearchCreateRequestDtoClass: { /** @description Instructions for what you would like research on. A good prompt clearly defines what information you want to find, how research should be conducted, and what the output should look like. */ instructions: string; /** * @description Research model to use. exa-research is faster and cheaper, while exa-research-pro provides more thorough analysis and stronger reasoning. * @default exa-research * @enum {string} */ model: "exa-research-fast" | "exa-research" | "exa-research-pro"; /** @description JSON Schema to enforce structured output. When provided, the research output will be validated against this schema and returned as parsed JSON. */ outputSchema?: { [key: string]: unknown; }; }; ResearchDtoClass: { /** @description When the research was created (Unix timestamp in milliseconds) */ createdAt: number; /** @description The original research instructions provided */ instructions: string; /** * @description The model used for this research request * @default exa-research * @enum {string} */ model: "exa-research-fast" | "exa-research" | "exa-research-pro"; /** @description The JSON Schema used to validate the output, if provided */ outputSchema?: { [key: string]: unknown; }; /** @description Unique identifier for tracking and retrieving this research request */ researchId: string; /** @enum {string} */ status: "pending"; } | { /** @description When the research was created (Unix timestamp in milliseconds) */ createdAt: number; /** @description Real-time log of operations as research progresses. Poll this endpoint or use ?stream=true for live updates. */ events?: components$1["schemas"]["ResearchEventDtoClass"][]; /** @description The original research instructions provided */ instructions: string; /** * @description The model used for this research request * @default exa-research * @enum {string} */ model: "exa-research-fast" | "exa-research" | "exa-research-pro"; /** @description The JSON Schema used to validate the output, if provided */ outputSchema?: { [key: string]: unknown; }; /** @description Unique identifier for tracking and retrieving this research request */ researchId: string; /** @enum {string} */ status: "running"; } | { /** @description Detailed cost breakdown for billing purposes */ costDollars: { /** @description Count of web pages fully crawled and processed. Only pages that were read in detail are counted. */ numPages: number; /** @description Count of web searches performed. Each search query counts as one search. */ numSearches: number; /** @description Total AI tokens used for reasoning, planning, and generating the final output */ reasoningTokens: number; /** @description Total cost in USD for this research request */ total: number; }; /** @description When the research was created (Unix timestamp in milliseconds) */ createdAt: number; /** @description Detailed log of all operations performed during research. Use ?events=true to include this field for debugging or monitoring progress. */ events?: components$1["schemas"]["ResearchEventDtoClass"][]; /** @description When the research completed (Unix timestamp in milliseconds) */ finishedAt: number; /** @description The original research instructions provided */ instructions: string; /** * @description The model used for this research request * @default exa-research * @enum {string} */ model: "exa-research-fast" | "exa-research" | "exa-research-pro"; /** @description The final research results, containing both raw text and parsed JSON if outputSchema was provided */ output: { /** @description The complete research output as text. If outputSchema was provided, this is a JSON string. */ content: string; /** @description Structured JSON object matching your outputSchema. Only present when outputSchema was provided and the output successfully validated. */ parsed?: { [key: string]: unknown; }; }; /** @description The JSON Schema used to validate the output, if provided */ outputSchema?: { [key: string]: unknown; }; /** @description Unique identifier for tracking and retrieving this research request */ researchId: string; /** @enum {string} */ status: "completed"; } | { /** @description When the research was created (Unix timestamp in milliseconds) */ createdAt: number; /** @description Detailed log of all operations performed during research. Use ?events=true to include this field for debugging or monitoring progress. */ events?: components$1["schemas"]["ResearchEventDtoClass"][]; /** @description When the research was canceled (Unix timestamp in milliseconds) */ finishedAt: number; /** @description The original research instructions provided */ instructions: string; /** * @description The model used for this research request * @default exa-research * @enum {string} */ model: "exa-research-fast" | "exa-research" | "exa-research-pro"; /** @description The JSON Schema used to validate the output, if provided */ outputSchema?: { [key: string]: unknown; }; /** @description Unique identifier for tracking and retrieving this research request */ researchId: string; /** @enum {string} */ status: "canceled"; } | { /** @description When the research was created (Unix timestamp in milliseconds) */ createdAt: number; /** @description Human-readable error message explaining what went wrong. */ error: string; /** @description Detailed log of all operations performed during research. Use ?events=true to include this field for debugging or monitoring progress. */ events?: components$1["schemas"]["ResearchEventDtoClass"][]; /** @description When the research failed (Unix timestamp in milliseconds) */ finishedAt: number; /** @description The original research instructions provided */ instructions: string; /** * @description The model used for this research request * @default exa-research * @enum {string} */ model: "exa-research-fast" | "exa-research" | "exa-research-pro"; /** @description The JSON Schema used to validate the output, if provided */ outputSchema?: { [key: string]: unknown; }; /** @description Unique identifier for tracking and retrieving this research request */ researchId: string; /** @enum {string} */ status: "failed"; }; ResearchEventDtoClass: ({ /** @description When this event occurred (Unix timestamp in milliseconds) */ createdAt: number; /** @enum {string} */ eventType: "research-definition"; /** @description The complete research instructions as provided */ instructions: string; /** @description The JSON Schema that will validate the final output */ outputSchema?: { [key: string]: unknown; }; /** @description The research request this event belongs to */ researchId: string; } | { /** @description When this event occurred (Unix timestamp in milliseconds) */ createdAt: number; /** @enum {string} */ eventType: "research-output"; /** @description The final research result, either successful with data or failed with error */ output: { /** @description The complete research output as text. If outputSchema was provided, this is a JSON string. */ content: string; costDollars: { /** @description Count of web pages fully crawled and processed. Only pages that were read in detail are counted. */ numPages: number; /** @description Count of web searches performed. Each search query counts as one search. */ numSearches: number; /** @description Total AI tokens used for reasoning, planning, and generating the final output */ reasoningTokens: number; /** @description Total cost in USD for this research request */ total: number; }; /** @enum {string} */ outputType: "completed"; /** @description Structured JSON object matching your outputSchema. Only present when outputSchema was provided and the output successfully validated. */ parsed?: { [key: string]: unknown; }; } | { /** @description Detailed error message explaining why the research failed */ error: string; /** @enum {string} */ outputType: "failed"; }; /** @description The research request this event belongs to */ researchId: string; }) | ({ /** @description When this event occurred (Unix timestamp in milliseconds) */ createdAt: number; /** @enum {string} */ eventType: "plan-definition"; /** @description Identifier for this planning cycle */ planId: string; /** @description The research request this event belongs to */ researchId: string; } | { /** @description When this event occurred (Unix timestamp in milliseconds) */ createdAt: number; /** @description The actual operation performed (think, search, or crawl) */ data: { /** @description The AI's reasoning process and decision-making steps */ content: string; /** @enum {string} */ type: "think"; } | { /** @description What the AI is trying to find with this search */ goal?: string; /** @description Token cost for processing search result snippets */ pageTokens: number; /** @description The exact search query sent to the search engine */ query: string; /** @description URLs returned by the search, ranked by relevance */ results: { url: string; }[]; /** * @description Search algorithm used (neural for semantic search, keyword for exact matches) * @enum {string} */ searchType: "neural" | "keyword" | "auto" | "fast"; /** @enum {string} */ type: "search"; } | { /** @description What information the AI expects to find on this page */ goal?: string; /** @description Token cost for processing the full page content */ pageTokens: number; /** @description The specific page that was crawled */ result: { url: string; }; /** @enum {string} */ type: "crawl"; }; /** @enum {string} */ eventType: "plan-operation"; /** @description Unique identifier for this specific operation */ operationId: string; /** @description Which plan this operation belongs to */ planId: string; /** @description The research request this event belongs to */ researchId: string; } | { /** @description When this event occurred (Unix timestamp in milliseconds) */ createdAt: number; /** @enum {string} */ eventType: "plan-output"; /** @description The plan's decision: either generate tasks or stop researching */ output: { /** @enum {string} */ outputType: "tasks"; /** @description Why these specific tasks were chosen */ reasoning: string; /** @description List of task instructions that will be executed in parallel */ tasksInstructions: string[]; } | { /** @enum {string} */ outputType: "stop"; /** @description Why the AI decided to stop researching */ reasoning: string; }; /** @description Which plan is producing this output */ planId: string; /** @description The research request this event belongs to */ researchId: string; }) | ({ /** @description When this event occurred (Unix timestamp in milliseconds) */ createdAt: number; /** @enum {string} */ eventType: "task-definition"; /** @description What this task should accomplish */ instructions: string; /** @description The plan that generated this task */ planId: string; /** @description The research request this event belongs to */ researchId: string; /** @description Identifier for tracking this specific task */ taskId: string; } | { /** @description When this event occurred (Unix timestamp in milliseconds) */ createdAt: number; /** @description The actual operation performed within this task */ data: { /** @description The AI's reasoning process and decision-making steps */ content: string; /** @enum {string} */ type: "think"; } | { /** @description What the AI is trying to find with this search */ goal?: string; /** @description Token cost for processing search result snippets */ pageTokens: number; /** @description The exact search query sent to the search engine */ query: string; /** @description URLs returned by the search, ranked by relevance */ results: { url: string; }[]; /** * @description Search algorithm used (neural for semantic search, keyword for exact matches) * @enum {string} */ searchType: "neural" | "keyword" | "auto" | "fast"; /** @enum {string} */ type: "search"; } | { /** @description What information the AI expects to find on this page */ goal?: string; /** @description Token cost for processing the full page content */ pageTokens: number; /** @description The specific page that was crawled */ result: { url: string; }; /** @enum {string} */ type: "crawl"; }; /** @enum {string} */ eventType: "task-operation"; /** @description Unique identifier for this specific operation */ operationId: string; /** @description The plan that owns this task */ planId: string; /** @description The research request this event belongs to */ researchId: string; /** @description Which task is performing this operation */ taskId: string; } | { /** @description When this event occurred (Unix timestamp in milliseconds) */ createdAt: number; /** @enum {string} */ eventType: "task-output"; /** @description The successful completion result of this task */ output: { /** @description The information gathered by this task */ content: string; /** @enum {string} */ outputType: "completed"; }; /** @description The plan that owns this task */ planId: string; /** @description The research request this event belongs to */ researchId: string; /** @description Which task produced this output */ taskId: string; }); ResearchOperationDtoClass: { /** @description The AI's reasoning process and decision-making steps */ content: string; /** @enum {string} */ type: "think"; } | { /** @description What the AI is trying to find with this search */ goal?: string; /** @description Token cost for processing search result snippets */ pageTokens: number; /** @description The exact search query sent to the search engine */ query: string; /** @description URLs returned by the search, ranked by relevance */ results: { url: string; }[]; /** * @description Search algorithm used (neural for semantic search, keyword for exact matches) * @enum {string} */ searchType: "neural" | "keyword" | "auto" | "fast"; /** @enum {string} */ type: "search"; } | { /** @description What information the AI expects to find on this page */ goal?: string; /** @description Token cost for processing the full page content */ pageTokens: number; /** @description The specific page that was crawled */ result: { url: string; }; /** @enum {string} */ type: "crawl"; }; }; responses: never; parameters: never; requestBodies: never; headers: never; pathItems: never; } type Research = components$1["schemas"]["ResearchDtoClass"]; type ResearchStatus = Research["status"]; type ResearchEvent = components$1["schemas"]["ResearchEventDtoClass"]; type ResearchOperation = components$1["schemas"]["ResearchOperationDtoClass"]; type DeepReplaceParsed = T extends { parsed?: Record; } ? Omit & { parsed: TData; } : T extends object ? { [K in keyof T]: DeepReplaceParsed; } : T; type ResearchTyped = DeepReplaceParsed; type ResearchStreamEventTyped = DeepReplaceParsed; type ListResearchRequest = { cursor?: string; limit?: number; }; type ListResearchResponse = components$1["schemas"]["ListResearchResponseDto"]; type ResearchCreateRequest = components$1["schemas"]["ResearchCreateRequestDtoClass"]; type ResearchCreateResponse = Research; type ResearchStreamEvent = ResearchEvent; /** * Enhanced research creation params with zod schema support */ type ResearchCreateParamsTyped = { instructions: string; model?: ResearchCreateRequest["model"]; outputSchema?: T; }; type ResearchDefinitionEvent = Extract; type ResearchOutputEvent = Extract; type ResearchPlanDefinitionEvent = Extract; type ResearchPlanOperationEvent = Extract; type ResearchPlanOutputEvent = Extract; type ResearchTaskDefinitionEvent = Extract; type ResearchTaskOperationEvent = Extract; type ResearchTaskOutputEvent = Extract; type QueryParams$1 = Record; interface RequestBody$1 { [key: string]: unknown; } declare class ResearchBaseClient { protected client: Exa; constructor(client: Exa); protected request(endpoint: string, method?: string, data?: RequestBody$1, params?: QueryParams$1): Promise; protected rawRequest(endpoint: string, method?: string, data?: RequestBody$1, params?: QueryParams$1): Promise; protected buildPaginationParams(pagination?: ListResearchRequest): QueryParams$1; } declare class ResearchClient extends ResearchBaseClient { constructor(client: Exa); create(params: ResearchCreateParamsTyped>): Promise; create(params: { instructions: string; model?: ResearchCreateRequest["model"]; outputSchema?: Record; }): Promise; get(researchId: string): Promise; get(researchId: string, options: { stream?: false; events?: boolean; }): Promise; get(researchId: string, options: { stream?: false; events?: boolean; outputSchema: ZodSchema; }): Promise>; get(researchId: string, options: { stream: true; events?: boolean; }): Promise>; get(researchId: string, options: { stream: true; events?: boolean; outputSchema?: ZodSchema; }): Promise>; list(options?: ListResearchRequest): Promise; pollUntilFinished(researchId: string, options?: { pollInterval?: number; timeoutMs?: number; events?: boolean; }): Promise; pollUntilFinished(researchId: string, options?: { pollInterval?: number; timeoutMs?: number; events?: boolean; outputSchema: ZodSchema; }): Promise & { status: "completed" | "failed" | "canceled"; }>; } /** * Base client for Websets API */ /** * Type for API query parameters */ type QueryParams = Record; /** * Type for API request body */ interface RequestBody { [key: string]: unknown; } /** * Common pagination parameters */ interface PaginationParams { /** * Cursor for pagination */ cursor?: string; /** * Maximum number of items per page */ limit?: number; } /** * Base client class for all Websets-related API clients */ declare class WebsetsBaseClient { protected client: Exa; /** * Initialize a new Websets base client * @param client The Exa client instance */ constructor(client: Exa); /** * Make a request to the Websets API * @param endpoint The endpoint path * @param method The HTTP method * @param data Optional request body data * @param params Optional query parameters * @returns The response JSON * @throws ExaError with API error details if the request fails */ protected request(endpoint: string, method?: string, data?: RequestBody, params?: QueryParams, headers?: Record): Promise; /** * Helper to build pagination parameters * @param pagination The pagination parameters * @returns QueryParams object with pagination parameters */ protected buildPaginationParams(pagination?: PaginationParams): QueryParams; } interface components { schemas: { /** Article */ ArticleEntity: { /** * @default article * @constant */ type: "article"; }; /** Company */ CompanyEntity: { /** * @default company * @constant */ type: "company"; }; CreateCriterionParameters: { /** @description The description of the criterion */ description: string; }; CreateEnrichmentParameters: { /** @description Provide a description of the enrichment task you want to perform to each Webset Item. */ description: string; /** * @description Format of the enrichment response. * * We automatically select the best format based on the description. If you want to explicitly specify the format, you can do so here. * @enum {string} */ format?: CreateEnrichmentParametersFormat; /** @description Set of key-value pairs you want to associate with this object. */ metadata?: { [key: string]: string; }; /** @description When the format is options, the different options for the enrichment agent to choose from. */ options?: { /** @description The label of the option */ label: string; }[]; }; CreateImportParameters: { /** @description The number of records to import */ count: number; /** @description When format is `csv`, these are the specific import parameters. */ csv?: { /** @description Column containing the key identifier for the entity (e.g. URL, Name, etc.). If not provided, we will try to infer it from the file. */ identifier?: number; }; /** @description What type of entity the import contains (e.g. People, Companies, etc.), and thus should be attempted to be resolved as. */ entity: components["schemas"]["CompanyEntity"] | components["schemas"]["PersonEntity"] | components["schemas"]["ArticleEntity"] | components["schemas"]["ResearchPaperEntity"] | components["schemas"]["CustomEntity"]; /** * @description When the import is in CSV format, we expect a column containing the key identifier for the entity - for now URL. If not provided, import will fail to be processed. * @enum {string} */ format: CreateImportParametersFormat; /** @description Set of key-value pairs you want to associate with this object. */ metadata?: { [key: string]: string; }; /** @description The size of the file in bytes. Maximum size is 50 MB. */ size: number; /** @description The title of the import */ title?: string; }; /** @description The response to a successful import. Includes the upload URL and the upload valid until date. */ CreateImportResponse: { /** @description The number of entities in the import */ count: number; /** * Format: date-time * @description When the import was created */ createdAt: string; /** @description The type of entity the import contains. */ entity: components["schemas"]["Entity"]; /** * Format: date-time * @description When the import failed */ failedAt: string | null; /** @description A human readable message of the import failure */ failedMessage: string | null; /** * @description The reason the import failed * @enum {string|null} */ failedReason: CreateImportResponseFailedReason; /** * @description The format of the import. * @enum {string} */ format: CreateImportResponseFormat; /** @description The unique identifier for the Import */ id: string; /** @description Set of key-value pairs you want to associate with this object. */ metadata: { [key: string]: string; }; /** * @description The type of object * @enum {string} */ object: CreateImportResponseObject; /** * @description The status of the Import * @enum {string} */ status: CreateImportResponseStatus; /** @description The title of the import */ title: string; /** * Format: date-time * @description When the import was last updated */ updatedAt: string; /** @description The URL to upload the file to */ uploadUrl: string; /** @description The date and time until the upload URL is valid. The upload URL will be valid for 1 hour. */ uploadValidUntil: string; }; CreateMonitorParameters: { /** @description Behavior to perform when monitor runs */ behavior: { /** @description Specify the search parameters for the Monitor. * * By default, the search parameters (query, entity and criteria) from the last search are used when no parameters are provided. */ config: { /** * @description The behaviour of the Search when it is added to a Webset. * @default append * @enum {string} */ behavior: WebsetSearchBehavior; /** @description The maximum number of results to find */ count: number; /** @description The criteria to search for. By default, the criteria from the last search is used. */ criteria?: { description: string; }[]; /** * Entity * @description The entity to search for. By default, the entity from the last search/import is used. */ entity?: components["schemas"]["Entity"]; /** @description The query to search for. By default, the query from the last search is used. */ query?: string; }; /** * @default search * @constant */ type: "search"; }; /** @description How often the monitor will run */ cadence: { /** @description Cron expression for monitor cadence (must be a valid Unix cron with 5 fields). The schedule must trigger at most once per day. */ cron: string; /** * @description IANA timezone (e.g., "America/New_York") * @default Etc/UTC */ timezone: string; }; metadata?: { [key: string]: string; }; /** @description The id of the Webset */ websetId: string; }; CreateWebhookParameters: { /** @description The events to trigger the webhook */ events: EventType[]; /** @description Set of key-value pairs you want to associate with this object. */ metadata?: { [key: string]: string; }; /** * Format: uri * @description The URL to send the webhook to */ url: string; }; CreateWebsetParameters: { /** @description Add enrichments to extract additional data from found items. * * Enrichments automatically search for and extract specific information (like contact details, funding data, employee counts, etc.) from each item added to your Webset. */ enrichments?: components["schemas"]["CreateEnrichmentParameters"][]; /** @description Global exclusion sources (existing imports or websets) that apply to all operations within this Webset. Any results found within these sources will be omitted across all search and import operations. */ exclude?: { /** @description The ID of the source to exclude. */ id: string; /** @enum {string} */ source: WebsetExcludeSource; }[]; /** @description The external identifier for the webset. * * You can use this to reference the Webset by your own internal identifiers. */ externalId?: string; /** @description Attach/load data from existing Imports or Websets into this Webset. For CSV Imports, this schedules ingestion and creates a staging pool of items (ImportItems do not automatically appear as Webset Items; searches create Webset Items). This does not filter searches. To filter a search to only look within an Import or Webset, use search.scope instead. */ import?: { /** @description The ID of the source to search. */ id: string; /** @enum {string} */ source: WebsetImportSource; }[]; /** @description Set of key-value pairs you want to associate with this object. */ metadata?: { [key: string]: string; }; /** @description Create initial search for the Webset. */ search?: { /** * @description Number of Items the Webset will attempt to find. * * The actual number of Items found may be less than this number depending on the search complexity. * @default 10 */ count: number; /** @description Criteria every item is evaluated against. * * It's not required to provide your own criteria, we automatically detect the criteria from all the information provided in the query. Only use this when you need more fine control. */ criteria?: components["schemas"]["CreateCriterionParameters"][]; /** @description Entity the Webset will return results for. * * It is not required to provide it, we automatically detect the entity from all the information provided in the query. Only use this when you need more fine control. */ entity?: components["schemas"]["Entity"]; /** @description Sources (existing imports or websets) to exclude from search results. Any results found within these sources will be omitted to prevent finding them during search. */ exclude?: { /** @description The ID of the source to exclude. */ id: string; /** @enum {string} */ source: WebsetExcludeSource; }[]; /** @description Natural language search query describing what you are looking for. * * Be specific and descriptive about your requirements, characteristics, and any constraints that help narrow down the results. * * Any URLs provided will be crawled and used as additional context for the search. */ query: string; /** @description Whether to provide an estimate of how many total relevant results could exist for this search. * Result of the analysis will be available in the `recall` field within the search request. */ recall?: boolean; /** @description Limit this search to only consider candidates from the listed sources (existing Imports or Websets). Scope applies per-search; if you run another search and want to stay within the same dataset, pass scope again. When scope is present, the search behavior is OVERRIDE (replaces results rather than appending). Note: Using the same Import in both top-level import and search.scope will return a 400 error. */ scope?: { /** @description The ID of the source to search. */ id: string; relationship?: { /** @description What the relationship of the entities you hope to find is relative to the entities contained in the provided source. Only needed for hop searches (graph traversal) from the source entities to related targets. Examples: "investors of", "current employer", "employees at". Omit for simple filtering within the source. */ definition: string; /** @description Number of related entities to find per source entity (fanout). Only used for hop searches. Range: 1-10. */ limit: number; }; /** @enum {string} */ source: WebsetSearchScopeSource; }[]; }; }; CreateWebsetSearchParameters: { /** * @description How this search interacts with existing items in the Webset: * * - **override**: Replace existing items and evaluate all items against new criteria * - **append**: Add new items to existing ones, keeping items that match the new criteria * @default override */ behavior: WebsetSearchBehavior; /** @description Number of Items the Search will attempt to find. * * The actual number of Items found may be less than this number depending on the query complexity. */ count: number; /** @description Criteria every item is evaluated against. * * It's not required to provide your own criteria, we automatically detect the criteria from all the information provided in the query. Only use this when you need more fine control. */ criteria?: components["schemas"]["CreateCriterionParameters"][]; /** @description Entity the search will return results for. * * It is not required to provide it, we automatically detect the entity from all the information provided in the query. Only use this when you need more fine control. */ entity?: components["schemas"]["Entity"]; /** @description Sources (existing imports or websets) to exclude from search results. Any results found within these sources will be omitted to prevent finding them during search. */ exclude?: { /** @description The ID of the source to exclude. */ id: string; /** @enum {string} */ source: WebsetExcludeSource; }[]; /** @description Set of key-value pairs you want to associate with this object. */ metadata?: { [key: string]: string; }; /** @description Natural language search query describing what you are looking for. * * Be specific and descriptive about your requirements, characteristics, and any constraints that help narrow down the results. * * Any URLs provided will be crawled and used as additional context for the search. */ query: string; /** @description Whether to provide an estimate of how many total relevant results could exist for this search. * Result of the analysis will be available in the `recall` field within the search request. */ recall?: boolean; /** @description Limit the search to specific sources (existing imports). Any results found within these sources matching the search criteria will be included in the Webset. */ scope?: { /** @description The ID of the source to search. */ id: string; relationship?: { /** @description What the relationship of the entities you hope to find is relative to the entities contained in the provided source. */ definition: string; limit: number; }; /** @enum {string} */ source: WebsetSearchScopeSource; }[]; }; /** Custom */ CustomEntity: { description: string; /** * @default custom * @constant */ type: "custom"; }; EnrichmentResult: { /** @description The id of the Enrichment that generated the result */ enrichmentId: string; format: components["schemas"]["WebsetEnrichmentFormat"]; /** * @default enrichment_result * @constant */ object: "enrichment_result"; /** @description The reasoning for the result when an Agent is used. */ reasoning: string | null; /** @description The references used to generate the result. */ references: { /** @description The relevant snippet of the reference content */ snippet: string | null; /** @description The title of the reference */ title: string | null; /** * Format: uri * @description The URL of the reference */ url: string; }[]; /** @description The result of the enrichment. */ result: string[] | null; /** * @description The status of the enrichment result. * @enum {string} */ status: EnrichmentResultStatus; }; Entity: components["schemas"]["CompanyEntity"] | components["schemas"]["PersonEntity"] | components["schemas"]["ArticleEntity"] | components["schemas"]["ResearchPaperEntity"] | components["schemas"]["CustomEntity"]; /** Event */ Event: { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["Webset"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.created * @constant */ type: "webset.created"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["Webset"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.deleted * @constant */ type: "webset.deleted"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["Webset"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.idle * @constant */ type: "webset.idle"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["Webset"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.paused * @constant */ type: "webset.paused"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["WebsetItem"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.item.created * @constant */ type: "webset.item.created"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["WebsetItem"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.item.enriched * @constant */ type: "webset.item.enriched"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["WebsetSearch"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.search.created * @constant */ type: "webset.search.created"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["WebsetSearch"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.search.updated * @constant */ type: "webset.search.updated"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["WebsetSearch"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.search.canceled * @constant */ type: "webset.search.canceled"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["WebsetSearch"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default webset.search.completed * @constant */ type: "webset.search.completed"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["Import"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default import.created * @constant */ type: "import.created"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["Import"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default import.completed * @constant */ type: "import.completed"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["Monitor"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default monitor.created * @constant */ type: "monitor.created"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["Monitor"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default monitor.updated * @constant */ type: "monitor.updated"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["Monitor"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default monitor.deleted * @constant */ type: "monitor.deleted"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["MonitorRun"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default monitor.run.created * @constant */ type: "monitor.run.created"; } | { /** * Format: date-time * @description The date and time the event was created */ createdAt: string; data: components["schemas"]["MonitorRun"]; /** @description The unique identifier for the event */ id: string; /** * @default event * @constant */ object: "event"; /** * @default monitor.run.completed * @constant */ type: "monitor.run.completed"; }; /** @enum {string} */ EventType: EventType; GetWebsetResponse: components["schemas"]["Webset"] & { /** @description When expand query parameter contains `items`, this will contain the items in the webset */ items?: components["schemas"]["WebsetItem"][]; }; Import: { /** @description The number of entities in the import */ count: number; /** * Format: date-time * @description When the import was created */ createdAt: string; /** @description The type of entity the import contains. */ entity: components["schemas"]["Entity"]; /** * Format: date-time * @description When the import failed */ failedAt: string | null; /** @description A human readable message of the import failure */ failedMessage: string | null; /** * @description The reason the import failed * @enum {string|null} */ failedReason: ImportFailedReason; /** * @description The format of the import. * @enum {string} */ format: ImportFormat; /** @description The unique identifier for the Import */ id: string; /** @description Set of key-value pairs you want to associate with this object. */ metadata: { [key: string]: string; }; /** * @description The type of object * @enum {string} */ object: ImportObject; /** * @description The status of the Import * @enum {string} */ status: ImportStatus; /** @description The title of the import */ title: string; /** * Format: date-time * @description When the import was last updated */ updatedAt: string; }; ListEventsResponse: { /** @description The list of events */ data: components["schemas"]["Event"][]; /** @description Whether there are more results to paginate through */ hasMore: boolean; /** @description The cursor to paginate through the next set of results */ nextCursor: string | null; }; ListImportsResponse: { /** @description The list of imports */ data: components["schemas"]["Import"][]; /** @description Whether there are more results to paginate through */ hasMore: boolean; /** @description The cursor to paginate through the next set of results */ nextCursor: string | null; }; ListMonitorRunsResponse: { /** @description The list of monitor runs */ data: components["schemas"]["MonitorRun"][]; /** @description Whether there are more results to paginate through */ hasMore: boolean; /** @description The cursor to paginate through the next set of results */ nextCursor: string | null; }; ListMonitorsResponse: { /** @description The list of monitors */ data: components["schemas"]["Monitor"][]; /** @description Whether there are more results to paginate through */ hasMore: boolean; /** @description The cursor to paginate through the next set of results */ nextCursor: string | null; }; ListWebhookAttemptsResponse: { /** @description The list of webhook attempts */ data: components["schemas"]["WebhookAttempt"][]; /** @description Whether there are more results to paginate through */ hasMore: boolean; /** @description The cursor to paginate through the next set of results */ nextCursor: string | null; }; ListWebhooksResponse: { /** @description The list of webhooks */ data: components["schemas"]["Webhook"][]; /** @description Whether there are more results to paginate through */ hasMore: boolean; /** @description The cursor to paginate through the next set of results */ nextCursor: string | null; }; ListWebsetItemResponse: { /** @description The list of webset items */ data: components["schemas"]["WebsetItem"][]; /** @description Whether there are more Items to paginate through */ hasMore: boolean; /** @description The cursor to paginate through the next set of Items */ nextCursor: string | null; }; ListWebsetsResponse: { /** @description The list of websets */ data: components["schemas"]["Webset"][]; /** @description Whether there are more results to paginate through */ hasMore: boolean; /** @description The cursor to paginate through the next set of results */ nextCursor: string | null; }; Monitor: { /** @description Behavior to perform when monitor runs */ behavior: { /** @description Specify the search parameters for the Monitor. * * By default, the search parameters (query, entity and criteria) from the last search are used when no parameters are provided. */ config: { /** * @description The behaviour of the Search when it is added to a Webset. * @default append * @enum {string} */ behavior: WebsetSearchBehavior; /** @description The maximum number of results to find */ count: number; /** @description The criteria to search for. By default, the criteria from the last search is used. */ criteria?: { description: string; }[]; /** * Entity * @description The entity to search for. By default, the entity from the last search/import is used. */ entity?: components["schemas"]["Entity"]; /** @description The query to search for. By default, the query from the last search is used. */ query?: string; }; /** * @default search * @constant */ type: "search"; }; /** @description How often the monitor will run */ cadence: { /** @description Cron expression for monitor cadence (must be a valid Unix cron with 5 fields). The schedule must trigger at most once per day. */ cron: string; /** * @description IANA timezone (e.g., "America/New_York") * @default Etc/UTC */ timezone: string; }; /** * Format: date-time * @description When the monitor was created */ createdAt: string; /** @description The unique identifier for the Monitor */ id: string; /** * MonitorRun * @description The last run of the monitor */ lastRun: components["schemas"]["MonitorRun"]; /** @description Set of key-value pairs you want to associate with this object. */ metadata: { [key: string]: string; }; /** * Format: date-time * @description Date and time when the next run will occur in */ nextRunAt: string | null; /** * @description The type of object * @enum {string} */ object: MonitorObject; /** * @description The status of the Monitor * @enum {string} */ status: MonitorStatus; /** * Format: date-time * @description When the monitor was last updated */ updatedAt: string; /** @description The id of the Webset the Monitor belongs to */ websetId: string; }; MonitorBehavior: { /** @description Specify the search parameters for the Monitor. * * By default, the search parameters (query, entity and criteria) from the last search are used when no parameters are provided. */ config: { /** * @description The behaviour of the Search when it is added to a Webset. * @default append * @enum {string} */ behavior: WebsetSearchBehavior; /** @description The maximum number of results to find */ count: number; /** @description The criteria to search for. By default, the criteria from the last search is used. */ criteria?: { description: string; }[]; /** * Entity * @description The entity to search for. By default, the entity from the last search/import is used. */ entity?: components["schemas"]["Entity"]; /** @description The query to search for. By default, the query from the last search is used. */ query?: string; }; /** * @default search * @constant */ type: "search"; }; MonitorCadence: { /** @description Cron expression for monitor cadence (must be a valid Unix cron with 5 fields). The schedule must trigger at most once per day. */ cron: string; /** * @description IANA timezone (e.g., "America/New_York") * @default Etc/UTC */ timezone: string; }; MonitorRun: { /** * Format: date-time * @description When the run was canceled */ canceledAt: string | null; /** * Format: date-time * @description When the run completed */ completedAt: string | null; /** * Format: date-time * @description When the run was created */ createdAt: string; /** * Format: date-time * @description When the run failed */ failedAt: string | null; /** @description The reason the run failed */ failedReason: string | null; /** @description The unique identifier for the Monitor Run */ id: string; /** @description The monitor that the run is associated with */ monitorId: string; /** * @description The type of object * @enum {string} */ object: MonitorRunObject; /** * @description The status of the Monitor Run * @enum {string} */ status: MonitorRunStatus; /** * @description The type of the Monitor Run * @enum {string} */ type: MonitorRunType; /** * Format: date-time * @description When the run was last updated */ updatedAt: string; }; /** Person */ PersonEntity: { /** * @default person * @constant */ type: "person"; }; PreviewWebsetParameters: { search: { /** * @description When query parameter search=true, the number of preview items to return. * @default 10 */ count: number; /** @description Entity used to inform the decomposition. * * It is not required to provide it, we automatically detect the entity from all the information provided in the query. Only use this when you need more fine control. */ entity?: components["schemas"]["Entity"]; /** @description Natural language search query describing what you are looking for. * * Be specific and descriptive about your requirements, characteristics, and any constraints that help narrow down the results. */ query: string; }; }; PreviewWebsetResponse: { /** @description Detected enrichments from the query. */ enrichments: { /** @description Description of the enrichment. */ description: string; /** * @description Format of the enrichment. * @enum {string} */ format: WebsetEnrichmentFormat; /** @description When format is options, the options detected from the query. */ options?: { /** @description Label of the option. */ label: string; }[]; }[]; /** @description Preview items matching the search criteria. */ items: components["schemas"]["WebsetItemPreview"][]; search: { /** @description Detected criteria from the query. */ criteria: { description: string; }[]; /** @description Detected entity from the query. */ entity: components["schemas"]["CompanyEntity"] | components["schemas"]["PersonEntity"] | components["schemas"]["ArticleEntity"] | components["schemas"]["ResearchPaperEntity"] | components["schemas"]["CustomEntity"]; }; }; /** Research Paper */ ResearchPaperEntity: { /** * @default research_paper * @constant */ type: "research_paper"; }; UpdateEnrichmentParameters: { /** @description Provide a description of the enrichment task you want to perform to each Webset Item. */ description?: string; /** * @description Format of the enrichment response. * * We automatically select the best format based on the description. If you want to explicitly specify the format, you can do so here. * @enum {string} */ format?: WebsetEnrichmentFormat; /** @description Set of key-value pairs you want to associate with this object. */ metadata?: { [key: string]: string; } | null; /** @description When the format is options, the different options for the enrichment agent to choose from. */ options?: { /** @description The label of the option */ label: string; }[]; }; UpdateImport: { metadata?: { [key: string]: string; }; title?: string; }; UpdateMonitor: { behavior?: components["schemas"]["MonitorBehavior"]; cadence?: components["schemas"]["MonitorCadence"]; metadata?: { [key: string]: string; }; /** * @description The status of the monitor. * @enum {string} */ status?: UpdateMonitorStatus; }; UpdateWebhookParameters: { /** @description The events to trigger the webhook */ events?: EventType[]; /** @description Set of key-value pairs you want to associate with this object. */ metadata?: { [key: string]: string; }; /** * Format: uri * @description The URL to send the webhook to */ url?: string; }; UpdateWebsetRequest: { /** @description Set of key-value pairs you want to associate with this object. */ metadata?: { [key: string]: string; } | null; }; Webhook: { /** * Format: date-time * @description The date and time the webhook was created */ createdAt: string; /** @description The events to trigger the webhook */ events: EventType[]; /** @description The unique identifier for the webhook */ id: string; /** * @description The metadata of the webhook * @default {} */ metadata: { [key: string]: string; }; /** * @default webhook * @constant */ object: "webhook"; /** @description The secret to verify the webhook signature. Only returned on Webhook creation. */ secret: string | null; /** * WebhookStatus * @description The status of the webhook * @enum {string} */ status: WebhookStatus; /** * Format: date-time * @description The date and time the webhook was last updated */ updatedAt: string; /** * Format: uri * @description The URL to send the webhook to */ url: string; }; WebhookAttempt: { /** @description The attempt number of the webhook */ attempt: number; /** * Format: date-time * @description The date and time the webhook attempt was made */ attemptedAt: string; /** @description The unique identifier for the event */ eventId: string; /** * @description The type of event * @enum {string} */ eventType: EventType; /** @description The unique identifier for the webhook attempt */ id: string; /** * @default webhook_attempt * @constant */ object: "webhook_attempt"; /** @description The body of the response */ responseBody: string | null; /** @description The headers of the response */ responseHeaders: { [key: string]: string; }; /** @description The status code of the response */ responseStatusCode: number; /** @description Whether the attempt was successful */ successful: boolean; /** @description The URL that was used during the attempt */ url: string; /** @description The unique identifier for the webhook */ webhookId: string; }; Webset: { /** * Format: date-time * @description The date and time the webset was created */ createdAt: string; /** @description The URL to view the webset in the Exa dashboard */ dashboardUrl: string; /** @description The Enrichments to apply to the Webset Items. */ enrichments: components["schemas"]["WebsetEnrichment"][]; /** @description The Excludes sources (existing imports or websets) that apply to all operations within this Webset. Any results found within these sources will be omitted across all search and import operations. */ excludes?: { id: string; /** @enum {string} */ source: WebsetExcludeSource; }[]; /** @description The external identifier for the webset */ externalId: string | null; /** @description The unique identifier for the webset */ id: string; /** @description Imports that have been performed on the webset. */ imports: components["schemas"]["Import"][]; /** * @description Set of key-value pairs you want to associate with this object. * @default {} */ metadata: { [key: string]: string; }; /** @description The Monitors for the Webset. */ monitors: components["schemas"]["Monitor"][]; /** * @default webset * @constant */ object: "webset"; /** @description The searches that have been performed on the webset. */ searches: components["schemas"]["WebsetSearch"][]; /** * WebsetStatus * @description The status of the webset * @enum {string} */ status: WebsetStatus; /** @description The title of the webset */ title: string | null; /** * Format: date-time * @description The date and time the webset was updated */ updatedAt: string; }; WebsetEnrichment: { /** * Format: date-time * @description The date and time the enrichment was created */ createdAt: string; /** @description The description of the enrichment task provided during the creation of the enrichment. */ description: string; /** @description The format of the enrichment response. */ format: components["schemas"]["WebsetEnrichmentFormat"]; /** @description The unique identifier for the enrichment */ id: string; /** @description The instructions for the enrichment Agent. * * This will be automatically generated based on the description and format. */ instructions: string | null; /** * @description The metadata of the enrichment * @default {} */ metadata: { [key: string]: string; }; /** * @default webset_enrichment * @constant */ object: "webset_enrichment"; /** * WebsetEnrichmentOptions * @description When the format is options, the different options for the enrichment agent to choose from. */ options: { /** @description The label of the option */ label: string; }[] | null; /** * WebsetEnrichmentStatus * @description The status of the enrichment * @enum {string} */ status: WebsetEnrichmentStatus; /** @description The title of the enrichment. * * This will be automatically generated based on the description and format. */ title: string | null; /** * Format: date-time * @description The date and time the enrichment was updated */ updatedAt: string; /** @description The unique identifier for the Webset this enrichment belongs to. */ websetId: string; }; /** @enum {string} */ WebsetEnrichmentFormat: WebsetEnrichmentFormat; WebsetItem: { /** * Format: date-time * @description The date and time the item was created */ createdAt: string; /** @description The enrichments results of the Webset item */ enrichments: components["schemas"]["EnrichmentResult"][] | null; /** @description The criteria evaluations of the item */ evaluations: components["schemas"]["WebsetItemEvaluation"][]; /** @description The unique identifier for the Webset Item */ id: string; /** * @default webset_item * @constant */ object: "webset_item"; /** @description The properties of the Item */ properties: components["schemas"]["WebsetItemPersonProperties"] | components["schemas"]["WebsetItemCompanyProperties"] | components["schemas"]["WebsetItemArticleProperties"] | components["schemas"]["WebsetItemResearchPaperProperties"] | components["schemas"]["WebsetItemCustomProperties"]; /** * @description The source of the Item * @enum {string} */ source: WebsetItemSource; /** @description The unique identifier for the source */ sourceId: string; /** * Format: date-time * @description The date and time the item was last updated */ updatedAt: string; /** @description The unique identifier for the Webset this Item belongs to. */ websetId: string; }; WebsetItemArticleProperties: { /** WebsetItemArticlePropertiesFields */ article: { /** @description The author(s) of the article */ author: string | null; /** @description The date and time the article was published */ publishedAt: string | null; /** @description The title of the article */ title: string | null; }; /** @description The text content for the article */ content: string | null; /** @description Short description of the relevance of the article */ description: string; /** * @default article * @constant */ type: "article"; /** * Format: uri * @description The URL of the article */ url: string; }; WebsetItemCompanyProperties: { /** WebsetItemCompanyPropertiesFields */ company: { /** @description A short description of the company */ about: string | null; /** @description The number of employees of the company */ employees: number | null; /** @description The industry of the company */ industry: string | null; /** @description The main location of the company */ location: string | null; /** * Format: uri * @description The logo URL of the company */ logoUrl: string | null; /** @description The name of the company */ name: string; }; /** @description The text content of the company website */ content: string | null; /** @description Short description of the relevance of the company */ description: string; /** * @default company * @constant */ type: "company"; /** * Format: uri * @description The URL of the company website */ url: string; }; WebsetItemCustomProperties: { /** @description The text content of the Item */ content: string | null; /** WebsetItemCustomPropertiesFields */ custom: { /** @description The author(s) of the website */ author: string | null; /** @description The date and time the website was published */ publishedAt: string | null; /** @description The title of the website */ title: string | null; }; /** @description Short description of the Item */ description: string; /** * @default custom * @constant */ type: "custom"; /** * Format: uri * @description The URL of the Item */ url: string; }; WebsetItemEvaluation: { /** @description The description of the criterion */ criterion: string; /** @description The reasoning for the result of the evaluation */ reasoning: string; /** * @description The references used to generate the result. * @default [] */ references: { /** @description The relevant snippet of the reference content */ snippet: string | null; /** @description The title of the reference */ title: string | null; /** * Format: uri * @description The URL of the reference */ url: string; }[]; /** * @description The satisfaction of the criterion * @enum {string} */ satisfied: WebsetItemEvaluationSatisfied; }; WebsetItemPersonProperties: { /** @description Short description of the relevance of the person */ description: string; /** WebsetItemPersonPropertiesFields */ person: { /** WebsetItemPersonCompanyPropertiesFields */ company: { /** @description The location the person is working at the company */ location: string | null; /** @description The name of the company */ name: string; } | null; /** @description The location of the person */ location: string | null; /** @description The name of the person */ name: string; /** * Format: uri * @description The image URL of the person */ pictureUrl: string | null; /** @description The current work position of the person */ position: string | null; }; /** * @default person * @constant */ type: "person"; /** * Format: uri * @description The URL of the person profile */ url: string; }; WebsetItemPreview: { /** * Format: date-time * @description The date and time the preview was created */ createdAt: string; /** @description The unique identifier for the preview item */ id: string; /** @description The properties of the preview item */ properties: components["schemas"]["WebsetItemPersonProperties"] | components["schemas"]["WebsetItemCompanyProperties"] | components["schemas"]["WebsetItemArticleProperties"] | components["schemas"]["WebsetItemResearchPaperProperties"] | components["schemas"]["WebsetItemCustomProperties"]; }; WebsetItemResearchPaperProperties: { /** @description The text content of the research paper */ content: string | null; /** @description Short description of the relevance of the research paper */ description: string; /** WebsetItemResearchPaperPropertiesFields */ researchPaper: { /** @description The author(s) of the research paper */ author: string | null; /** @description The date and time the research paper was published */ publishedAt: string | null; /** @description The title of the research paper */ title: string | null; }; /** * @default research_paper * @constant */ type: "research_paper"; /** * Format: uri * @description The URL of the research paper */ url: string; }; WebsetSearch: { /** * @description The behavior of the search when it is added to a Webset. * * - `override`: the search will replace the existing Items found in the Webset and evaluate them against the new criteria. Any Items that don't match the new criteria will be discarded. * - `append`: the search will add the new Items found to the existing Webset. Any Items that don't match the new criteria will be discarded. * @default override */ behavior: WebsetSearchBehavior; /** * Format: date-time * @description The date and time the search was canceled */ canceledAt: string | null; /** @description The reason the search was canceled */ canceledReason: WebsetSearchCanceledReason; /** @description The number of results the search will attempt to find. The actual number of results may be less than this number depending on the search complexity. */ count: number; /** * Format: date-time * @description The date and time the search was created */ createdAt: string; /** @description The criteria the search will use to evaluate the results. If not provided, we will automatically generate them for you. */ criteria: { /** @description The description of the criterion */ description: string; /** @description Value between 0 and 100 representing the percentage of results that meet the criterion. */ successRate: number; }[]; /** @description The entity the search will return results for. * * When no entity is provided during creation, we will automatically select the best entity based on the query. */ entity: components["schemas"]["Entity"]; /** @description Sources (existing imports or websets) used to omit certain results to be found during the search. */ exclude: { id: string; /** @enum {string} */ source: WebsetExcludeSource; }[]; /** @description The unique identifier for the search */ id: string; /** * @description Set of key-value pairs you want to associate with this object. * @default {} */ metadata: { [key: string]: string; }; /** * @default webset_search * @constant */ object: "webset_search"; /** @description The progress of the search */ progress: { /** @description The number of results analyzed so far */ analyzed: number; /** @description The completion percentage of the search */ completion: number; /** @description The number of results found so far */ found: number; /** @description The estimated time remaining in seconds, null if unknown */ timeLeft: number | null; }; /** @description The query used to create the search. */ query: string; /** @description Recall metrics for the search, null if not yet computed or requested. */ recall: { expected: { bounds: { /** @description The maximum estimated total number of potential matches */ max: number; /** @description The minimum estimated total number of potential matches */ min: number; }; /** * @description The confidence in the estimate * @enum {string} */ confidence: WebsetSearchRecallExpectedConfidence; /** @description The estimated total number of potential matches */ total: number; }; /** @description The reasoning for the estimate */ reasoning: string; } | null; /** @description The scope of the search. By default, there is no scope - thus searching the web. * * If provided during creation, the search will only be performed on the sources provided. */ scope: { id: string; relationship?: { /** @description What the relationship of the entities you hope to find is relative to the entities contained in the provided source. */ definition: string; limit: number; }; /** @enum {string} */ source: WebsetSearchScopeSource; }[]; /** * WebsetSearchStatus * @description The status of the search * @enum {string} */ status: WebsetSearchStatus; /** * Format: date-time * @description The date and time the search was updated */ updatedAt: string; /** @description The unique identifier for the Webset this search belongs to */ websetId: string; }; }; responses: never; parameters: never; requestBodies: never; headers: never; pathItems: never; } type ArticleEntity = components["schemas"]["ArticleEntity"]; type CreateCriterionParameters = components["schemas"]["CreateCriterionParameters"]; type CreateEnrichmentParameters = components["schemas"]["CreateEnrichmentParameters"]; type CreateImportParameters = components["schemas"]["CreateImportParameters"]; type CreateImportResponse = components["schemas"]["CreateImportResponse"]; type CreateMonitorParameters = components["schemas"]["CreateMonitorParameters"]; type CreateWebhookParameters = components["schemas"]["CreateWebhookParameters"]; type CreateWebsetParameters = components["schemas"]["CreateWebsetParameters"]; type CreateWebsetSearchParameters = components["schemas"]["CreateWebsetSearchParameters"]; type CustomEntity = components["schemas"]["CustomEntity"]; type EnrichmentResult = components["schemas"]["EnrichmentResult"]; type Event = components["schemas"]["Event"]; type GetWebsetResponse = components["schemas"]["GetWebsetResponse"]; type Import = components["schemas"]["Import"]; type ListEventsResponse = components["schemas"]["ListEventsResponse"]; type ListImportsResponse = components["schemas"]["ListImportsResponse"]; type ListMonitorRunsResponse = components["schemas"]["ListMonitorRunsResponse"]; type ListMonitorsResponse = components["schemas"]["ListMonitorsResponse"]; type ListWebhookAttemptsResponse = components["schemas"]["ListWebhookAttemptsResponse"]; type ListWebhooksResponse = components["schemas"]["ListWebhooksResponse"]; type ListWebsetItemResponse = components["schemas"]["ListWebsetItemResponse"]; type ListWebsetsResponse = components["schemas"]["ListWebsetsResponse"]; type Monitor = components["schemas"]["Monitor"]; type MonitorBehavior = components["schemas"]["MonitorBehavior"]; type MonitorCadence = components["schemas"]["MonitorCadence"]; type MonitorRun = components["schemas"]["MonitorRun"]; type PreviewWebsetParameters = components["schemas"]["PreviewWebsetParameters"]; type PreviewWebsetResponse = components["schemas"]["PreviewWebsetResponse"]; type ResearchPaperEntity = components["schemas"]["ResearchPaperEntity"]; type UpdateEnrichmentParameters = components["schemas"]["UpdateEnrichmentParameters"]; type UpdateImport = components["schemas"]["UpdateImport"]; type UpdateMonitor = components["schemas"]["UpdateMonitor"]; type UpdateWebhookParameters = components["schemas"]["UpdateWebhookParameters"]; type UpdateWebsetRequest = components["schemas"]["UpdateWebsetRequest"]; type Webhook = components["schemas"]["Webhook"]; type WebhookAttempt = components["schemas"]["WebhookAttempt"]; type Webset = components["schemas"]["Webset"]; type WebsetEnrichment = components["schemas"]["WebsetEnrichment"]; type WebsetItem = components["schemas"]["WebsetItem"]; type WebsetItemArticleProperties = components["schemas"]["WebsetItemArticleProperties"]; type WebsetItemCompanyProperties = components["schemas"]["WebsetItemCompanyProperties"]; type WebsetItemCustomProperties = components["schemas"]["WebsetItemCustomProperties"]; type WebsetItemEvaluation = components["schemas"]["WebsetItemEvaluation"]; type WebsetItemPersonProperties = components["schemas"]["WebsetItemPersonProperties"]; type WebsetItemResearchPaperProperties = components["schemas"]["WebsetItemResearchPaperProperties"]; type WebsetSearch = components["schemas"]["WebsetSearch"]; declare enum CreateEnrichmentParametersFormat { text = "text", date = "date", number = "number", options = "options", email = "email", phone = "phone", url = "url" } declare enum CreateImportParametersFormat { csv = "csv" } declare enum CreateImportResponseFailedReason { invalid_format = "invalid_format", invalid_file_content = "invalid_file_content", missing_identifier = "missing_identifier" } declare enum CreateImportResponseFormat { csv = "csv", webset = "webset" } declare enum CreateImportResponseObject { import = "import" } declare enum CreateImportResponseStatus { pending = "pending", processing = "processing", completed = "completed", failed = "failed" } declare enum WebsetImportSource { import = "import", webset = "webset" } declare enum EnrichmentResultStatus { pending = "pending", completed = "completed", canceled = "canceled" } declare enum EventType { webset_created = "webset.created", webset_deleted = "webset.deleted", webset_paused = "webset.paused", webset_idle = "webset.idle", webset_search_created = "webset.search.created", webset_search_canceled = "webset.search.canceled", webset_search_completed = "webset.search.completed", webset_search_updated = "webset.search.updated", import_created = "import.created", import_completed = "import.completed", webset_item_created = "webset.item.created", webset_item_enriched = "webset.item.enriched", monitor_created = "monitor.created", monitor_updated = "monitor.updated", monitor_deleted = "monitor.deleted", monitor_run_created = "monitor.run.created", monitor_run_completed = "monitor.run.completed", webset_export_created = "webset.export.created", webset_export_completed = "webset.export.completed" } declare enum ImportFailedReason { invalid_format = "invalid_format", invalid_file_content = "invalid_file_content", missing_identifier = "missing_identifier" } declare enum ImportFormat { csv = "csv", webset = "webset" } declare enum ImportObject { import = "import" } declare enum ImportStatus { pending = "pending", processing = "processing", completed = "completed", failed = "failed" } declare enum MonitorObject { monitor = "monitor" } declare enum MonitorStatus { enabled = "enabled", disabled = "disabled" } declare enum MonitorRunObject { monitor_run = "monitor_run" } declare enum MonitorRunStatus { created = "created", running = "running", completed = "completed", canceled = "canceled", failed = "failed" } declare enum MonitorRunType { search = "search", refresh = "refresh" } declare enum UpdateMonitorStatus { enabled = "enabled", disabled = "disabled" } declare enum WebhookStatus { active = "active", inactive = "inactive" } declare enum WebsetStatus { idle = "idle", pending = "pending", running = "running", paused = "paused" } declare enum WebsetEnrichmentStatus { pending = "pending", canceled = "canceled", completed = "completed" } declare enum WebsetEnrichmentFormat { text = "text", date = "date", number = "number", options = "options", email = "email", phone = "phone", url = "url" } declare enum WebsetItemSource { search = "search", import = "import" } declare enum WebsetItemEvaluationSatisfied { yes = "yes", no = "no", unclear = "unclear" } declare enum WebsetExcludeSource { import = "import", webset = "webset" } declare enum WebsetSearchRecallExpectedConfidence { high = "high", medium = "medium", low = "low" } declare enum WebsetSearchScopeSource { import = "import", webset = "webset" } declare enum WebsetSearchStatus { created = "created", pending = "pending", running = "running", completed = "completed", canceled = "canceled" } declare enum WebsetSearchBehavior { override = "override", append = "append" } declare enum WebsetSearchCanceledReason { webset_deleted = "webset_deleted", webset_canceled = "webset_canceled" } /** * Client for managing Webset Enrichments */ /** * Client for managing Webset Enrichments */ declare class WebsetEnrichmentsClient extends WebsetsBaseClient { /** * Create an Enrichment for a Webset * @param websetId The ID of the Webset * @param params The enrichment parameters * @returns The created Webset Enrichment */ create(websetId: string, params: CreateEnrichmentParameters): Promise; /** * Get an Enrichment by ID * @param websetId The ID of the Webset * @param id The ID of the Enrichment * @returns The Webset Enrichment */ get(websetId: string, id: string): Promise; /** * Delete an Enrichment * @param websetId The ID of the Webset * @param id The ID of the Enrichment * @returns The deleted Webset Enrichment */ delete(websetId: string, id: string): Promise; /** * Update an Enrichment * @param websetId The ID of the Webset * @param id The ID of the Enrichment * @param params The enrichment update parameters * @returns Promise that resolves when the update is complete */ update(websetId: string, id: string, params: UpdateEnrichmentParameters): Promise; /** * Cancel a running Enrichment * @param websetId The ID of the Webset * @param id The ID of the Enrichment * @returns The canceled Webset Enrichment */ cancel(websetId: string, id: string): Promise; } /** * Options for listing Events */ interface ListEventsOptions { /** * The cursor to paginate through the results */ cursor?: string; /** * The number of results to return */ limit?: number; /** * The types of events to filter by */ types?: EventType[]; } /** * Client for managing Events */ declare class EventsClient extends WebsetsBaseClient { /** * Initialize a new Events client * @param client The Exa client instance */ constructor(client: Exa); /** * List all Events * @param options Optional filtering and pagination options * @returns The list of Events */ list(options?: ListEventsOptions): Promise; /** * Get an Event by ID * @param id The ID of the Event * @returns The Event */ get(id: string): Promise; /** * Iterate through all Events, handling pagination automatically * @param options Filtering and pagination options * @returns Async generator of Events */ listAll(options?: ListEventsOptions): AsyncGenerator; /** * Collect all Events into an array * @param options Filtering and pagination options * @returns Promise resolving to an array of all Events */ getAll(options?: ListEventsOptions): Promise; } /** * Options for waiting until import completion */ interface WaitUntilCompletedOptions { /** * Maximum time to wait in milliseconds (default: 5 minutes) */ timeout?: number; /** * How often to poll for status in milliseconds (default: 2 seconds) */ pollInterval?: number; /** * Callback function called on each poll with the current status */ onPoll?: (status: ImportStatus) => void; } /** * Parameters for creating an import with CSV data */ interface CreateImportWithCsvParameters { /** * Title of the import */ title: string; /** * Entity type and configuration */ entity: CreateImportParameters["entity"]; /** * Optional metadata */ metadata?: CreateImportParameters["metadata"]; /** * Optional CSV-specific parameters */ csv?: CreateImportParameters["csv"]; } /** * CSV data input - can be raw data or buffer */ type CsvDataInput = string | Buffer; /** * Client for managing Imports */ declare class ImportsClient extends WebsetsBaseClient { /** * Create a new Import (basic version - returns upload URL) * @param params The import creation parameters * @returns The created Import response with upload URL */ create(params: CreateImportParameters): Promise; /** * Create a new Import with CSV data (handles upload) * @param params The import creation parameters (without size/count - calculated automatically) * @param csv CSV data as string or Buffer * @returns The Import after upload (not waited for completion) */ create(params: CreateImportWithCsvParameters, csv: CsvDataInput): Promise; /** * Get an Import by ID * @param id The ID of the Import * @returns The Import */ get(id: string): Promise; /** * List all Imports * @param options Pagination options * @returns The list of Imports */ list(options?: PaginationParams): Promise; /** * Update an Import * @param id The ID of the Import * @param params The import update parameters * @returns The updated Import */ update(id: string, params: UpdateImport): Promise; /** * Delete an Import * @param id The ID of the Import * @returns The deleted Import */ delete(id: string): Promise; /** * Wait until an Import is completed or failed * @param id The ID of the Import * @param options Configuration options for timeout and polling * @returns The Import once it reaches a final state (completed or failed) * @throws Error if the Import does not complete within the timeout or fails */ waitUntilCompleted(id: string, options?: WaitUntilCompletedOptions): Promise; /** * Iterate through all Imports, handling pagination automatically * @param options Pagination options * @returns Async generator of Imports */ listAll(options?: PaginationParams): AsyncGenerator; /** * Collect all Imports into an array * @param options Pagination options * @returns Promise resolving to an array of all Imports */ getAll(options?: PaginationParams): Promise; } /** * Client for managing Webset Items */ /** * Options for listing webset items */ interface ListWebsetItemsOptions extends PaginationParams { /** * The id of the source to filter items by */ sourceId?: string; } /** * Client for managing Webset Items */ declare class WebsetItemsClient extends WebsetsBaseClient { /** * List all Items for a Webset * @param websetId The ID of the Webset * @param params - Optional pagination and filtering parameters * @returns A promise that resolves with the list of Items */ list(websetId: string, params?: ListWebsetItemsOptions): Promise; /** * Iterate through all Items in a Webset, handling pagination automatically * @param websetId The ID of the Webset * @param options Pagination options * @returns Async generator of Webset Items */ listAll(websetId: string, options?: ListWebsetItemsOptions): AsyncGenerator; /** * Collect all items from a Webset into an array * @param websetId The ID of the Webset * @param options Pagination options * @returns Promise resolving to an array of all Webset Items */ getAll(websetId: string, options?: ListWebsetItemsOptions): Promise; /** * Get an Item by ID * @param websetId The ID of the Webset * @param id The ID of the Item * @returns The Webset Item */ get(websetId: string, id: string): Promise; /** * Delete an Item * @param websetId The ID of the Webset * @param id The ID of the Item * @returns The deleted Webset Item */ delete(websetId: string, id: string): Promise; } /** * Client for managing Webset Monitors */ /** * Options for listing monitors */ interface ListMonitorsOptions extends PaginationParams { /** * The id of the Webset to list monitors for */ websetId?: string; } /** * Client for managing Monitor Runs */ declare class WebsetMonitorRunsClient extends WebsetsBaseClient { /** * List all runs for a Monitor * @param monitorId The ID of the Monitor * @param options Pagination options * @returns The list of Monitor runs */ list(monitorId: string, options?: PaginationParams): Promise; /** * Get a specific Monitor run * @param monitorId The ID of the Monitor * @param runId The ID of the Monitor run * @returns The Monitor run */ get(monitorId: string, runId: string): Promise; } /** * Client for managing Webset Monitors */ declare class WebsetMonitorsClient extends WebsetsBaseClient { /** * Client for managing Monitor Runs */ runs: WebsetMonitorRunsClient; constructor(client: Exa); /** * Create a Monitor * @param params The monitor parameters * @returns The created Monitor */ create(params: CreateMonitorParameters): Promise; /** * Get a Monitor by ID * @param id The ID of the Monitor * @returns The Monitor */ get(id: string): Promise; /** * List all Monitors * @param options Pagination and filtering options * @returns The list of Monitors */ list(options?: ListMonitorsOptions): Promise; /** * Update a Monitor * @param id The ID of the Monitor * @param params The monitor update parameters (status, metadata) * @returns The updated Monitor */ update(id: string, params: UpdateMonitor): Promise; /** * Delete a Monitor * @param id The ID of the Monitor * @returns The deleted Monitor */ delete(id: string): Promise; /** * Iterate through all Monitors, handling pagination automatically * @param options Pagination and filtering options * @returns Async generator of Monitors */ listAll(options?: ListMonitorsOptions): AsyncGenerator; /** * Collect all Monitors into an array * @param options Pagination and filtering options * @returns Promise resolving to an array of all Monitors */ getAll(options?: ListMonitorsOptions): Promise; } /** * Client for managing Webset Webhooks */ /** * Options for listing webhooks (only pagination is supported by API) */ interface ListWebhooksOptions extends PaginationParams { } /** * Options for listing webhook attempts */ interface ListWebhookAttemptsOptions extends PaginationParams { /** * The type of event to filter by */ eventType?: EventType; /** * Filter attempts by their success status */ successful?: boolean; } /** * Client for managing Webset Webhooks */ declare class WebsetWebhooksClient extends WebsetsBaseClient { /** * Create a Webhook * @param params The webhook parameters * @returns The created Webhook */ create(params: CreateWebhookParameters): Promise; /** * Get a Webhook by ID * @param id The ID of the Webhook * @returns The Webhook */ get(id: string): Promise; /** * List all Webhooks * @param options Pagination options * @returns The list of Webhooks */ list(options?: ListWebhooksOptions): Promise; /** * Iterate through all Webhooks, handling pagination automatically * @param options Pagination options * @returns Async generator of Webhooks */ listAll(options?: ListWebhooksOptions): AsyncGenerator; /** * Collect all Webhooks into an array * @param options Pagination options * @returns Promise resolving to an array of all Webhooks */ getAll(options?: ListWebhooksOptions): Promise; /** * Update a Webhook * @param id The ID of the Webhook * @param params The webhook update parameters (events, metadata, url) * @returns The updated Webhook */ update(id: string, params: UpdateWebhookParameters): Promise; /** * Delete a Webhook * @param id The ID of the Webhook * @returns The deleted Webhook */ delete(id: string): Promise; /** * List all attempts for a Webhook * @param id The ID of the Webhook * @param options Pagination and filtering options * @returns The list of Webhook attempts */ listAttempts(id: string, options?: ListWebhookAttemptsOptions): Promise; /** * Iterate through all attempts for a Webhook, handling pagination automatically * @param id The ID of the Webhook * @param options Pagination and filtering options * @returns Async generator of Webhook attempts */ listAllAttempts(id: string, options?: ListWebhookAttemptsOptions): AsyncGenerator; /** * Collect all attempts for a Webhook into an array * @param id The ID of the Webhook * @param options Pagination and filtering options * @returns Promise resolving to an array of all Webhook attempts */ getAllAttempts(id: string, options?: ListWebhookAttemptsOptions): Promise; } /** * Websets API client */ type WebsetHeadersLike = { "x-exa-websets-priority"?: "low" | "medium" | "high"; } & Record; /** * Client for managing Webset Searches */ /** * Client for managing Webset Searches */ declare class WebsetSearchesClient extends WebsetsBaseClient { /** * Create a new Search for the Webset * @param websetId The ID of the Webset * @param params The search parameters * @returns The created Webset Search */ create(websetId: string, params: CreateWebsetSearchParameters, options?: { headers?: WebsetHeadersLike; }): Promise; /** * Get a Search by ID * @param websetId The ID of the Webset * @param id The ID of the Search * @returns The Webset Search */ get(websetId: string, id: string): Promise; /** * Cancel a running Search * @param websetId The ID of the Webset * @param id The ID of the Search * @returns The canceled Webset Search */ cancel(websetId: string, id: string): Promise; } /** * Main client for Websets API */ /** * Options for listing Websets (API only supports pagination) */ interface ListWebsetsOptions extends PaginationParams { } /** * Client for managing Websets */ declare class WebsetsClient extends WebsetsBaseClient { /** * Client for managing Events */ events: EventsClient; /** * Client for managing Imports */ imports: ImportsClient; /** * Client for managing Webset Items */ items: WebsetItemsClient; /** * Client for managing Webset Searches */ searches: WebsetSearchesClient; /** * Client for managing Webset Enrichments */ enrichments: WebsetEnrichmentsClient; /** * Client for managing Webset Monitors */ monitors: WebsetMonitorsClient; /** * Client for managing Webset Webhooks */ webhooks: WebsetWebhooksClient; /** * Initialize a new Websets client * @param client The Exa client instance */ constructor(client: Exa); /** * Create a new Webset * @param params The Webset creation parameters * @returns The created Webset */ create(params: CreateWebsetParameters, options?: { headers?: WebsetHeadersLike; }): Promise; /** * Preview a webset * @param params The preview parameters * @param options Optional parameters. Search = true allows you to retrieve a preview set of items that could be returned by the webset. * @returns The preview response showing how the query will be decomposed */ preview(params: PreviewWebsetParameters, options?: { search?: boolean; }): Promise; /** * Get a Webset by ID * @param id The ID of the Webset * @param expand Optional array of relations to expand * @returns The Webset */ get(id: string, expand?: Array<"items">): Promise; /** * List all Websets * @param options Pagination options (filtering by status is not supported by API) * @returns The list of Websets */ list(options?: ListWebsetsOptions): Promise; /** * Iterate through all Websets, handling pagination automatically * @param options Pagination options * @returns Async generator of Websets */ listAll(options?: ListWebsetsOptions): AsyncGenerator; /** * Collect all Websets into an array * @param options Pagination options * @returns Promise resolving to an array of all Websets */ getAll(options?: ListWebsetsOptions): Promise; /** * Update a Webset * @param id The ID of the Webset * @param params The Webset update parameters * @returns The updated Webset */ update(id: string, params: UpdateWebsetRequest): Promise; /** * Delete a Webset * @param id The ID of the Webset * @returns The deleted Webset */ delete(id: string): Promise; /** * Cancel a running Webset * @param id The ID or external ID of the Webset * @returns The canceled Webset (as returned by the API) */ cancel(id: string): Promise; /** * Wait until a Webset is idle * @param id The ID of the Webset * @param options Configuration options for timeout and polling * @returns The Webset once it becomes idle * @throws Error if the Webset does not become idle within the timeout */ waitUntilIdle(id: string, options?: { timeout?: number; pollInterval?: number; onPoll?: (status: WebsetStatus) => void; } | number): Promise; } /** * HTTP status codes */ declare enum HttpStatusCode { BadRequest = 400, NotFound = 404, Unauthorized = 401, Forbidden = 403, TooManyRequests = 429, RequestTimeout = 408, InternalServerError = 500, ServiceUnavailable = 503 } /** * Base error class for all Exa API errors */ declare class ExaError extends Error { /** * HTTP status code */ statusCode: number; /** * ISO timestamp from API */ timestamp?: string; /** * Path that caused the error (may be undefined for client-side errors) */ path?: string; /** * Create a new ExaError * @param message Error message * @param statusCode HTTP status code * @param timestamp ISO timestamp from API * @param path Path that caused the error */ constructor(message: string, statusCode: number, timestamp?: string, path?: string); } /** * Options for retrieving page contents * @typedef {Object} ContentsOptions * @property {TextContentsOptions | boolean} [text] - Options for retrieving text contents. * @property {HighlightsContentsOptions | boolean} [highlights] - Options for retrieving highlights. * @property {SummaryContentsOptions | boolean} [summary] - Options for retrieving summary. * @property {number} [maxAgeHours] - Maximum age of cached content in hours. If content is older, it will be fetched fresh. Special values: 0 = always fetch fresh content, -1 = never fetch fresh (use cached content only). Example: 168 = fetch fresh for pages older than 7 days. * @property {boolean} [filterEmptyResults] - If true, filters out results with no contents. Default is true. * @property {number} [subpages] - The number of subpages to return for each result, where each subpage is derived from an internal link for the result. * @property {string | string[]} [subpageTarget] - Text used to match/rank subpages in the returned subpage list. You could use "about" to get *about* page for websites. Note that this is a fuzzy matcher. * @property {ExtrasOptions} [extras] - Miscelleneous data derived from results */ type ContentsOptions = { text?: TextContentsOptions | true; highlights?: HighlightsContentsOptions | true; summary?: SummaryContentsOptions | true; livecrawl?: LivecrawlOptions; /** @deprecated Use `highlights` or `text` instead. Will be removed in a future version. */ context?: ContextOptions | true; livecrawlTimeout?: number; maxAgeHours?: number; filterEmptyResults?: boolean; subpages?: number; subpageTarget?: string | string[]; extras?: ExtrasOptions; }; /** * Options for performing a search query * @typedef {Object} SearchOptions * @property {ContentsOptions | boolean} [contents] - Options for retrieving page contents for each result returned. Default is { text: { maxCharacters: 10_000 } }. * @property {number} [numResults] - Number of search results to return. Default 10. * @property {string[]} [includeDomains] - List of domains to include in the search. * @property {string[]} [excludeDomains] - List of domains to exclude in the search. * @property {string} [startCrawlDate] - Start date for results based on crawl date. * @property {string} [endCrawlDate] - End date for results based on crawl date. * @property {string} [startPublishedDate] - Start date for results based on published date. * @property {string} [endPublishedDate] - End date for results based on published date. * @property {string} [category] - A data category to focus on, with higher comprehensivity and data cleanliness. * @property {string[]} [includeText] - List of strings that must be present in webpage text of results. Currently only supports 1 string of up to 5 words. * @property {string[]} [excludeText] - List of strings that must not be present in webpage text of results. Currently only supports 1 string of up to 5 words. * @property {string[]} [flags] - Experimental flags * @property {string} [userLocation] - The two-letter ISO country code of the user, e.g. US. * @property {boolean} [stream] - Whether to stream back OpenAI-style chat completion chunks. Use `streamSearch()` instead of `search({ stream: true })`. */ type BaseSearchOptions = { contents?: ContentsOptions; numResults?: number; includeDomains?: string[]; excludeDomains?: string[]; startCrawlDate?: string; endCrawlDate?: string; startPublishedDate?: string; endPublishedDate?: string; category?: "company" | "research paper" | "news" | "pdf" | "personal site" | "financial report" | "people"; includeText?: string[]; excludeText?: string[]; flags?: string[]; userLocation?: string; stream?: boolean; }; /** * Base search options shared across all search types */ type BaseRegularSearchOptions = BaseSearchOptions & { /** * If true, the search results are moderated for safety. */ moderation?: boolean; useAutoprompt?: boolean; /** * Additional instructions that guide both the search process and the final returned synthesis. * Use this to prefer certain sources, emphasize novelty, avoid duplicates, or constrain output style. */ systemPrompt?: string; /** * Output schema for search responses. When provided, the API returns synthesized output in `output`. * - `type: "text"` for plain text output (optionally guided by `description`) * - `type: "object"` for structured JSON output * * Note: For object schemas, the API enforces max depth 2 and max 10 total properties. */ outputSchema?: DeepOutputSchema; }; type DeepSearchType = "deep-lite" | "deep" | "deep-reasoning"; /** * Deep search output schema mode for plain text responses. */ type DeepTextOutputSchema = { type: "text"; /** * Optional formatting guidance for text output. */ description?: string; }; /** * Deep search output schema mode for structured JSON object responses. */ type DeepObjectOutputSchema = { type: "object"; /** * JSON-schema-style properties for the result object. */ properties?: Record; /** * Required property names. */ required?: string[]; }; /** * Search output schema. * - `type: "text"` returns plain text in `output.content` (with optional description guidance). * - `type: "object"` returns structured JSON in `output.content`. * * Note: For object schemas, the API enforces a maximum nesting depth of 2 and a maximum of 10 total properties. */ type DeepOutputSchema = DeepTextOutputSchema | DeepObjectOutputSchema; /** * Contents options for deep search. * @deprecated The `context` field is deprecated. Use `highlights` or `text` instead. */ type DeepContentsOptions = Omit & { /** @deprecated Use `highlights` or `text` instead. Will be removed in a future version. */ context?: Omit | true; }; /** * Search options for deep search types, which additionally support additional queries. */ type DeepSearchOptions = Omit & { type: DeepSearchType; /** * Alternative query formulations for deep search variants to skip automatic LLM-based query expansion. * Max 5 queries. * @example ["machine learning", "ML algorithms", "neural networks"] */ additionalQueries?: string[]; /** * Options for retrieving page contents. */ contents?: DeepContentsOptions; }; /** * Search options for non-deep search types (keyword, neural, auto, hybrid, fast, instant) */ type NonDeepSearchOptions = BaseRegularSearchOptions & { type?: "keyword" | "neural" | "auto" | "hybrid" | "fast" | "instant"; }; /** * Search options for performing a search query. * Uses a discriminated union to ensure additionalQueries is only allowed when type is a deep search variant. */ type RegularSearchOptions = DeepSearchOptions | NonDeepSearchOptions; /** * Options for finding similar links. * @typedef {Object} FindSimilarOptions * @property {boolean} [excludeSourceDomain] - If true, excludes links from the base domain of the input. */ type FindSimilarOptions = BaseSearchOptions & { excludeSourceDomain?: boolean; }; type ExtrasOptions = { links?: number; imageLinks?: number; }; /** * Options for livecrawling contents * @typedef {string} LivecrawlOptions */ type LivecrawlOptions = "never" | "fallback" | "always" | "auto" | "preferred"; /** * Verbosity levels for content filtering. * - compact: Most concise output, main content only (default) * - standard: Balanced content with more detail * - full: Complete content including all sections */ type VerbosityOptions = "compact" | "standard" | "full"; /** * Section tags for semantic content filtering. */ type SectionTag = "unspecified" | "header" | "navigation" | "banner" | "body" | "sidebar" | "footer" | "metadata"; /** * Options for retrieving text from page. * @typedef {Object} TextContentsOptions * @property {number} [maxCharacters] - The maximum number of characters to return. * @property {boolean} [includeHtmlTags] - If true, includes HTML tags in the returned text. Default: false * @property {VerbosityOptions} [verbosity] - Controls verbosity level of returned content. Default: "compact". Requires maxAgeHours: 0. * @property {SectionTag[]} [includeSections] - Only include content from these semantic sections. Requires maxAgeHours: 0. * @property {SectionTag[]} [excludeSections] - Exclude content from these semantic sections. Requires maxAgeHours: 0. */ type TextContentsOptions = { maxCharacters?: number; includeHtmlTags?: boolean; verbosity?: VerbosityOptions; includeSections?: SectionTag[]; excludeSections?: SectionTag[]; }; /** * Options for retrieving highlights from page. * Deep search variants also support these options for returned highlights. * @typedef {Object} HighlightsContentsOptions * @property {string} [query] - The query string to use for highlights search. * @property {number} [maxCharacters] - The maximum number of characters to return for highlights. * @property {number} [numSentences] - Deprecated. Use maxCharacters instead. * @property {number} [highlightsPerUrl] - Deprecated. Use maxCharacters instead. */ type HighlightsContentsOptions = { query?: string; maxCharacters?: number; /** @deprecated Use maxCharacters instead */ numSentences?: number; /** @deprecated Use maxCharacters instead */ highlightsPerUrl?: number; }; /** * Options for retrieving summary from page. * @typedef {Object} SummaryContentsOptions * @property {string} [query] - The query string to use for summary generation. * @property {JSONSchema} [schema] - JSON schema for structured output from summary. */ type SummaryContentsOptions = { query?: string; schema?: Record | ZodSchema; }; /** * @deprecated Use Record instead. */ type JSONSchema = Record; /** * @deprecated Use `highlights` or `text` instead. The `context` option is deprecated and will be removed in a future version. * * Options for retrieving the context from a list of search results. The context is a string * representation of all the search results. * @typedef {Object} ContextOptions * @property {number} [maxCharacters] - The maximum number of characters. */ type ContextOptions = { maxCharacters?: number; }; /** * @typedef {Object} TextResponse * @property {string} text - Text from page */ type TextResponse = { text: string; }; /** * @typedef {Object} HighlightsResponse * @property {string[]} highlights - The highlights as an array of strings. * @property {number[]} [highlightScores] - The corresponding scores as an array of floats, 0 to 1 */ type HighlightsResponse = { highlights: string[]; highlightScores?: number[]; }; /** * @typedef {Object} SummaryResponse * @property {string} summary - The generated summary of the page content. */ type SummaryResponse = { summary: string; }; /** * @typedef {Object} ExtrasResponse * @property {string[]} links - The links on the page of a result * @property {string[]} imageLinks - The image links on the page of a result */ type ExtrasResponse = { extras: { links?: string[]; imageLinks?: string[]; }; }; /** * @typedef {Object} SubpagesResponse * @property {ContentsResultComponent} subpages - The subpages for a result */ type SubpagesResponse = { subpages: ContentsResultComponent[]; }; type Default = [keyof T] extends [never] ? U : T; /** * @typedef {Object} ContentsResultComponent * Depending on 'ContentsOptions', this yields a combination of 'TextResponse', 'HighlightsResponse', 'SummaryResponse', or an empty object. * * @template T - A type extending from 'ContentsOptions'. */ type ContentsResultComponent = (T["text"] extends object | true ? TextResponse : {}) & (T["highlights"] extends object | true ? HighlightsResponse : {}) & (T["summary"] extends object | true ? SummaryResponse : {}) & (T["subpages"] extends number ? SubpagesResponse : {}) & (T["extras"] extends object ? ExtrasResponse : {}); /** * Represents the cost breakdown related to contents retrieval. Fields are optional because * only non-zero costs are included. * @typedef {Object} CostDollarsContents * @property {number} [text] - The cost in dollars for retrieving text. * @property {number} [highlights] - The cost in dollars for retrieving highlights. * @property {number} [summary] - The cost in dollars for retrieving summary. */ type CostDollarsContents = { text?: number; highlights?: number; summary?: number; }; /** * Represents the cost breakdown related to search. Fields are optional because * only non-zero costs are included. * @typedef {Object} CostDollarsSeearch * @property {number} [neural] - The cost in dollars for neural search. * @property {number} [keyword] - The cost in dollars for keyword search. */ type CostDollarsSeearch = { neural?: number; keyword?: number; }; /** * Represents the total cost breakdown. Only non-zero costs are included. * @typedef {Object} CostDollars * @property {number} total - The total cost in dollars. * @property {CostDollarsSeearch} [search] - The cost breakdown for search. * @property {CostDollarsContents} [contents] - The cost breakdown for contents. */ type CostDollars = { total: number; search?: CostDollarsSeearch; contents?: CostDollarsContents; }; /** * Entity types for company/people search results. * Only returned when using category=company or category=people searches. */ /** Company workforce information. */ type EntityCompanyPropertiesWorkforce = { total?: number | null; }; /** Company headquarters information. */ type EntityCompanyPropertiesHeadquarters = { address?: string | null; city?: string | null; postalCode?: string | null; country?: string | null; }; /** Funding round information. */ type EntityCompanyPropertiesFundingRound = { name?: string | null; date?: string | null; amount?: number | null; }; /** Company financial information. */ type EntityCompanyPropertiesFinancials = { revenueAnnual?: number | null; fundingTotal?: number | null; fundingLatestRound?: EntityCompanyPropertiesFundingRound | null; }; /** Company web traffic information. */ type EntityCompanyPropertiesWebTraffic = { visitsMonthly?: number | null; }; /** Structured properties for a company entity. */ type EntityCompanyProperties = { name?: string | null; foundedYear?: number | null; description?: string | null; workforce?: EntityCompanyPropertiesWorkforce | null; headquarters?: EntityCompanyPropertiesHeadquarters | null; financials?: EntityCompanyPropertiesFinancials | null; webTraffic?: EntityCompanyPropertiesWebTraffic | null; }; /** Date range for work history entries. */ type EntityDateRange = { from?: string | null; to?: string | null; }; /** Reference to a company in work history. */ type EntityPersonPropertiesCompanyRef = { id?: string | null; name?: string | null; }; /** A single work history entry for a person. */ type EntityPersonPropertiesWorkHistoryEntry = { title?: string | null; location?: string | null; dates?: EntityDateRange | null; company?: EntityPersonPropertiesCompanyRef | null; }; /** Structured properties for a person entity. */ type EntityPersonProperties = { name?: string | null; location?: string | null; workHistory?: EntityPersonPropertiesWorkHistoryEntry[]; }; /** Structured entity data for a company. */ type CompanyEntity = { id: string; type: "company"; version: number; properties: EntityCompanyProperties; }; /** Structured entity data for a person. */ type PersonEntity = { id: string; type: "person"; version: number; properties: EntityPersonProperties; }; /** Structured entity data for company or person search results. */ type Entity = CompanyEntity | PersonEntity; /** * Represents a search result object. * @typedef {Object} SearchResult * @property {string} title - The title of the search result. * @property {string} url - The URL of the search result. * @property {string} [publishedDate] - The estimated creation date of the content. * @property {string} [author] - The author of the content, if available. * @property {number} [score] - Similarity score between the query/url and the result. * @property {string} id - The temporary ID for the document. * @property {string} [image] - A representative image for the content, if any. * @property {string} [favicon] - A favicon for the site, if any. * @property {Entity[]} [entities] - Structured entity data for company or person search results. */ type SearchResult = { title: string | null; url: string; publishedDate?: string; author?: string; score?: number; id: string; image?: string; favicon?: string; entities?: Entity[]; } & ContentsResultComponent; type DeepSearchOutputGroundingCitation = { url: string; title: string; }; type DeepSearchOutputGroundingConfidence = "low" | "medium" | "high"; type DeepSearchOutputGrounding = { field: string; citations: DeepSearchOutputGroundingCitation[]; confidence: DeepSearchOutputGroundingConfidence; }; type DeepSearchOutput = { content: string | Record; grounding: DeepSearchOutputGrounding[]; }; /** * Represents a search response object. * @typedef {Object} SearchResponse * @property {Result[]} results - The list of search results. * @property {string} [context] - Deprecated. The context for the search. * @property {DeepSearchOutput} [output] - Search synthesized output object returned when `outputSchema` is provided. * @property {string} [autoDate] - The autoprompt date, if applicable. * @property {string} requestId - The request ID for the search. * @property {CostDollars} [costDollars] - The cost breakdown for this request. * @property {string} [resolvedSearchType] - The resolved search type ('neural' or 'keyword') when using 'auto' search. * @property {number} [searchTime] - Time taken for the search in milliseconds. */ type SearchResponse = { results: SearchResult[]; /** @deprecated Use `highlights` or `text` on individual results instead. Will be removed in a future version. */ context?: string; output?: DeepSearchOutput; autoDate?: string; requestId: string; statuses?: Array; costDollars?: CostDollars; resolvedSearchType?: string; searchTime?: number; }; type Status = { id: string; status: string; source: string; }; /** * Options for the answer endpoint * @typedef {Object} AnswerOptions * @property {boolean} [stream] - Whether to stream the response. Default false. * @property {boolean} [text] - Whether to include text in the source results. Default false. * @property {"exa"} [model] - The model to use for generating the answer. Default "exa". * @property {string} [systemPrompt] - A system prompt to guide the LLM's behavior when generating the answer. * @property {Object} [outputSchema] - A JSON Schema specification for the structure you expect the output to take */ type AnswerOptions = { stream?: boolean; text?: boolean; model?: "exa"; systemPrompt?: string; outputSchema?: Record; userLocation?: string; }; /** * Represents an answer response object from the /answer endpoint. * @typedef {Object} AnswerResponse * @property {string | Object} answer - The generated answer text (or an object matching `outputSchema`, if provided) * @property {SearchResult<{}>[]} citations - The sources used to generate the answer. * @property {CostDollars} [costDollars] - The cost breakdown for this request. * @property {string} [requestId] - Optional request ID for the answer. */ type AnswerResponse = { answer: string | Record; citations: SearchResult<{}>[]; requestId?: string; costDollars?: CostDollars; }; type AnswerStreamChunk = { /** * The partial text content of the answer (if present in this chunk). */ content?: string; /** * Citations associated with the current chunk of text (if present). */ citations?: Array<{ id: string; url: string; title?: string; publishedDate?: string; author?: string; text?: string; }>; }; type SearchStreamChunk = AnswerStreamChunk; /** * Represents a streaming answer response chunk from the /answer endpoint. * @typedef {Object} AnswerStreamResponse * @property {string} [answer] - A chunk of the generated answer text. * @property {SearchResult<{}>[]]} [citations] - The sources used to generate the answer. */ type AnswerStreamResponse = { answer?: string; citations?: SearchResult<{}>[]; }; /** * Enhanced answer options that accepts either JSON schema or Zod schema */ type AnswerOptionsTyped = Omit & { outputSchema: T; }; /** * Enhanced answer response with strongly typed answer when using Zod */ type AnswerResponseTyped = Omit & { answer: T; }; /** * Enhanced summary contents options that accepts either JSON schema or Zod schema */ type SummaryContentsOptionsTyped = Omit & { schema: T; }; /** * The Exa class encapsulates the API's endpoints. */ declare class Exa { private baseURL; private headers; /** * Websets API client */ websets: WebsetsClient; /** * Research API client */ research: ResearchClient; /** * Search Monitors API client */ monitors: SearchMonitorsClient; /** * Helper method to separate out the contents-specific options from the rest. */ private extractContentsOptions; private buildSearchRequestBody; /** * Constructs the Exa API client. * @param {string} apiKey - The API key for authentication. * @param {string} [baseURL] - The base URL of the Exa API. */ constructor(apiKey?: string, baseURL?: string); /** * Makes a request to the Exa API. * @param {string} endpoint - The API endpoint to call. * @param {string} method - The HTTP method to use. * @param {any} [body] - The request body for POST requests. * @param {Record} [params] - The query parameters. * @returns {Promise} The response from the API. * @throws {ExaError} When any API request fails with structured error information */ request(endpoint: string, method: string, body?: any, params?: Record, headers?: Record): Promise; rawRequest(endpoint: string, method?: string, body?: Record, queryParams?: Record): Promise; /** * Performs a search with an Exa prompt-engineered query. * By default, returns text contents. Use contents: false to opt-out. * * @param {string} query - The query string. * @returns {Promise>} A list of relevant search results with text contents. */ search(query: string): Promise>; /** * Performs a search without contents. * * @param {string} query - The query string. * @param {RegularSearchOptions & { contents: false }} options - Search options with contents explicitly disabled * @returns {Promise>} A list of relevant search results without contents. */ search(query: string, options: RegularSearchOptions & { contents: false | null | undefined; }): Promise>; /** * Performs a search with specific contents. * * @param {string} query - The query string. * @param {RegularSearchOptions & { contents: T }} options - Search options with specific contents * @returns {Promise>} A list of relevant search results with requested contents. */ search(query: string, options: RegularSearchOptions & { contents: T; }): Promise>; /** * Performs a search with an Exa prompt-engineered query. * When no contents option is specified, returns text contents by default. * * @param {string} query - The query string. * @param {Omit | Omit} options - Search options without contents * @returns {Promise>} A list of relevant search results with text contents. */ search(query: string, options: Omit | Omit): Promise>; /** * Stream a search response as an async generator of OpenAI-style chat completion chunks. * * Each iteration yields a chunk with partial text (`content`) or new citations. * Use this if you'd like to read synthesized search output incrementally. */ streamSearch(query: string, options?: RegularSearchOptions & { contents?: ContentsOptions | false | null | undefined; }): AsyncGenerator; /** * @deprecated Use `search()` instead. The search method now returns text contents by default. * * Migration examples: * - `searchAndContents(query)` → `search(query)` * - `searchAndContents(query, { text: true })` → `search(query, { contents: { text: true } })` * - `searchAndContents(query, { summary: true })` → `search(query, { contents: { summary: true } })` * * Performs a search with an Exa prompt-engineered query and returns the contents of the documents. * * @param {string} query - The query string. * @param {RegularSearchOptions & T} [options] - Additional search + contents options * @returns {Promise>} A list of relevant search results with requested contents. */ searchAndContents(query: string, options?: RegularSearchOptions & T): Promise>; /** * Finds similar links to the provided URL. * By default, returns text contents. Use contents: false to opt-out. * * @param {string} url - The URL for which to find similar links. * @returns {Promise>} A list of similar search results with text contents. */ findSimilar(url: string): Promise>; /** * Finds similar links to the provided URL without contents. * * @param {string} url - The URL for which to find similar links. * @param {FindSimilarOptions & { contents: false }} options - Options with contents explicitly disabled * @returns {Promise>} A list of similar search results without contents. */ findSimilar(url: string, options: FindSimilarOptions & { contents: false | null | undefined; }): Promise>; /** * Finds similar links to the provided URL with specific contents. * * @param {string} url - The URL for which to find similar links. * @param {FindSimilarOptions & { contents: T }} options - Options with specific contents * @returns {Promise>} A list of similar search results with requested contents. */ findSimilar(url: string, options: FindSimilarOptions & { contents: T; }): Promise>; /** * Finds similar links to the provided URL. * When no contents option is specified, returns text contents by default. * * @param {string} url - The URL for which to find similar links. * @param {Omit} options - Options without contents * @returns {Promise>} A list of similar search results with text contents. */ findSimilar(url: string, options: Omit): Promise>; /** * @deprecated Use `findSimilar()` instead. The findSimilar method now returns text contents by default. * * Migration examples: * - `findSimilarAndContents(url)` → `findSimilar(url)` * - `findSimilarAndContents(url, { text: true })` → `findSimilar(url, { contents: { text: true } })` * - `findSimilarAndContents(url, { summary: true })` → `findSimilar(url, { contents: { summary: true } })` * * Finds similar links to the provided URL and returns the contents of the documents. * @param {string} url - The URL for which to find similar links. * @param {FindSimilarOptions & T} [options] - Additional options for finding similar links + contents. * @returns {Promise>} A list of similar search results, including requested contents. */ findSimilarAndContents(url: string, options?: FindSimilarOptions & T): Promise>; /** * Retrieves contents of documents based on URLs. * @param {string | string[] | SearchResult[]} urls - A URL or array of URLs, or an array of SearchResult objects. * @param {ContentsOptions} [options] - Additional options for retrieving document contents. * @returns {Promise>} A list of document contents for the requested URLs. */ getContents(urls: string | string[] | SearchResult[], options?: T): Promise>; /** * Generate an answer with Zod schema for strongly typed output */ answer(query: string, options: AnswerOptionsTyped>): Promise>; /** * Generate an answer to a query. * @param {string} query - The question or query to answer. * @param {AnswerOptions} [options] - Additional options for answer generation. * @returns {Promise} The generated answer and source references. * * Example with systemPrompt: * ```ts * const answer = await exa.answer("What is quantum computing?", { * text: true, * model: "exa", * systemPrompt: "Answer in a technical manner suitable for experts." * }); * ``` * * Note: For streaming responses, use the `streamAnswer` method: * ```ts * for await (const chunk of exa.streamAnswer(query)) { * // Handle chunks * } * ``` */ answer(query: string, options?: AnswerOptions): Promise; /** * Stream an answer with Zod schema for structured output (non-streaming content) * Note: Structured output works only with non-streaming content, not with streaming chunks */ streamAnswer(query: string, options: { text?: boolean; model?: "exa" | "exa-pro"; systemPrompt?: string; outputSchema: ZodSchema; userLocation?: string; }): AsyncGenerator; /** * Stream an answer as an async generator * * Each iteration yields a chunk with partial text (`content`) or new citations. * Use this if you'd like to read the answer incrementally, e.g. in a chat UI. * * Example usage: * ```ts * for await (const chunk of exa.streamAnswer("What is quantum computing?", { * text: false, * systemPrompt: "Answer in a concise manner suitable for beginners." * })) { * if (chunk.content) process.stdout.write(chunk.content); * if (chunk.citations) { * console.log("\nCitations: ", chunk.citations); * } * } * ``` */ streamAnswer(query: string, options?: { text?: boolean; model?: "exa" | "exa-pro"; systemPrompt?: string; outputSchema?: Record; userLocation?: string; }): AsyncGenerator; private streamChatCompletions; private processChunk; private parseSSEStream; } export { type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateSearchMonitorParams, type CreateSearchMonitorResponse, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, type DeepObjectOutputSchema, type DeepOutputSchema, type DeepSearchOutput, type DeepSearchOutputGrounding, type DeepSearchOutputGroundingCitation, type DeepSearchOutputGroundingConfidence, type DeepSearchType, type DeepTextOutputSchema, type Default, type EnrichmentResult, type Entity, type EntityCompanyProperties, type EntityCompanyPropertiesFinancials, type EntityCompanyPropertiesFundingRound, type EntityCompanyPropertiesHeadquarters, type EntityCompanyPropertiesWebTraffic, type EntityCompanyPropertiesWorkforce, type EntityDateRange, type EntityPersonProperties, type EntityPersonPropertiesCompanyRef, type EntityPersonPropertiesWorkHistoryEntry, type Event, EventType, EventsClient, Exa, ExaError, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type GroundingCitation, type GroundingEntry, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type ListResearchRequest, type ListResearchResponse, type ListSearchMonitorRunsParams, type ListSearchMonitorRunsResponse, type ListSearchMonitorsParams, type ListSearchMonitorsResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, type RegularSearchOptions, type Research, type ResearchCreateParamsTyped, type ResearchCreateRequest, type ResearchCreateResponse, type ResearchDefinitionEvent, type ResearchEvent, type ResearchOperation, type ResearchOutputEvent, type ResearchPaperEntity, type ResearchPlanDefinitionEvent, type ResearchPlanOperationEvent, type ResearchPlanOutputEvent, type ResearchStatus, type ResearchStreamEvent, type ResearchStreamEventTyped, type ResearchTaskDefinitionEvent, type ResearchTaskOperationEvent, type ResearchTaskOutputEvent, type ResearchTyped, type SearchMonitor, type SearchMonitorRun, type SearchMonitorRunFailReason, type SearchMonitorRunOutput, type SearchMonitorRunStatus, SearchMonitorRunsClient, type SearchMonitorSearch, type SearchMonitorStatus, type SearchMonitorTrigger, type SearchMonitorWebhook, type SearchMonitorWebhookEvent, SearchMonitorsClient, type SearchResponse, type SearchResult, type SearchStreamChunk, type SectionTag, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type TriggerSearchMonitorResponse, type UpdateEnrichmentParameters, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateSearchMonitorParams, type UpdateWebhookParameters, type UpdateWebsetRequest, type VerbosityOptions, type WaitUntilCompletedOptions, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, WebsetExcludeSource, type WebsetHeadersLike, WebsetImportSource, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchScopeSource, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, Exa as default };