search
MethodParameter | Type | Description | Default |
---|---|---|---|
query | string | The input query string. | Required |
numResults | number | Number of search results to return. | 10 |
includeDomains | string[] | List of domains to include in the search. | undefined |
excludeDomains | string[] | List of domains to exclude in the search. | undefined |
startCrawlDate | string | Results will only include links crawled after this date. | undefined |
endCrawlDate | string | Results will only include links crawled before this date. | undefined |
startPublishedDate | string | Results will only include links with a published date after this date. | undefined |
endPublishedDate | string | Results will only include links with a published date before this date. | undefined |
type | string | The type of search, “keyword” or “neural”. | “auto” |
category | string | data category to focus on when searching, with higher comprehensivity and data cleanliness. Available categories: “company”, “research paper”, “news”, “linkedin profile”, “github”, “tweet”, “movie”, “song”, “personal site”, “pdf”, “financial report”. | undefined |
SearchResponse
Field | Type | Description |
---|---|---|
results | Result[] | List of Result objects |
Result
ObjectField | Type | Description |
---|---|---|
url | string | URL of the search result |
id | string | Temporary ID for the document |
title | string | null | Title of the search result |
score? | number | Similarity score between query/url and result |
publishedDate? | string | Estimated creation date |
author? | string | Author of the content, if available |
searchAndContents
MethodParameter | Type | Description | Default |
---|---|---|---|
query | string | The input query string. | Required |
text | boolean | { maxCharacters?: number, includeHtmlTags?: boolean } | If provided, includes the full text of the content in the results. | undefined |
highlights | boolean | { query?: string, numSentences?: number, highlightsPerUrl?: number } | If provided, includes highlights of the content in the results. | undefined |
numResults | number | Number of search results to return. | 10 |
includeDomains | string[] | List of domains to include in the search. | undefined |
excludeDomains | string[] | List of domains to exclude in the search. | undefined |
startCrawlDate | string | Results will only include links crawled after this date. | undefined |
endCrawlDate | string | Results will only include links crawled before this date. | undefined |
startPublishedDate | string | Results will only include links with a published date after this date. | undefined |
endPublishedDate | string | Results will only include links with a published date before this date. | undefined |
type | string | The type of search, “keyword” or “neural”. | “auto” |
category | string | A data category to focus on when searching, with higher comprehensivity and data cleanliness. Available categories: “company”, “research paper”, “news”, “linkedin profile”, “github”, “tweet”, “movie”, “song”, “personal site”, “pdf” and “financial report”. | undefined |
SearchResponse
Field | Type | Description |
---|---|---|
results | SearchResult<T>[] | List of SearchResult objects |
SearchResult
Result
object from the search
method with additional fields based on T
:
Field | Type | Description |
---|---|---|
text? | string | Text of the search result page (if requested) |
highlights? | string[] | Highlights of the search result (if requested) |
highlightScores? | number[] | Scores of the highlights (if requested) |
SearchResult<T>
object depend on the options provided in the searchAndContents
call.
findSimilar
MethodParameter | Type | Description | Default |
---|---|---|---|
url | string | The URL of the webpage to find similar results for. | Required |
numResults | number | Number of similar results to return. | undefined |
includeDomains | string[] | List of domains to include in the search. | undefined |
excludeDomains | string[] | List of domains to exclude from the search. | undefined |
startCrawlDate | string | Results will only include links crawled after this date. | undefined |
endCrawlDate | string | Results will only include links crawled before this date. | undefined |
startPublishedDate | string | Results will only include links with a published date after this date. | undefined |
endPublishedDate | string | Results will only include links with a published date before this date. | undefined |
excludeSourceDomain | boolean | If true, excludes results from the same domain as the input URL. | undefined |
category | string | A data category to focus on when searching, with higher comprehensivity and data cleanliness. | undefined |
SearchResponse
Field | Type | Description |
---|---|---|
results | Result[] | List of Result objects |
Result
ObjectField | Type | Description |
---|---|---|
url | string | URL of the search result |
id | string | Temporary ID for the document |
title | string | null | Title of the search result |
score? | number | Similarity score between query/url and result |
publishedDate? | string | Estimated creation date |
author? | string | Author of the content, if available |
findSimilarAndContents
MethodParameter | Type | Description | Default |
---|---|---|---|
url | string | The URL of the webpage to find similar results for. | Required |
text | boolean | { maxCharacters?: number, includeHtmlTags?: boolean } | If provided, includes the full text of the content in the results. | undefined |
highlights | boolean | { query?: string, numSentences?: number, highlightsPerUrl?: number } | If provided, includes highlights of the content in the results. | undefined |
numResults | number | Number of similar results to return. | undefined |
includeDomains | string[] | List of domains to include in the search. | undefined |
excludeDomains | string[] | List of domains to exclude from the search. | undefined |
startCrawlDate | string | Results will only include links crawled after this date. | undefined |
endCrawlDate | string | Results will only include links crawled before this date. | undefined |
startPublishedDate | string | Results will only include links with a published date after this date. | undefined |
endPublishedDate | string | Results will only include links with a published date before this date. | undefined |
excludeSourceDomain | boolean | If true, excludes results from the same domain as the input URL. | undefined |
category | string | A data category to focus on when searching, with higher comprehensivity and data cleanliness. | undefined |
SearchResponse
Field | Type | Description |
---|---|---|
results | SearchResult<T>[] | List of SearchResult objects |
Result
object with additional fields based on the requested content:
Field | Type | Description | |
---|---|---|---|
url | string | URL of the search result | |
id | string | Temporary ID for the document | |
title | `string | null` | Title of the search result |
score? | number | Similarity score between query/url and result | |
publishedDate? | string | Estimated creation date | |
author? | string | Author of the content, if available | |
text? | string | Text of the search result page (if requested) | |
highlights? | string[] | Highlights of the search result (if requested) | |
highlightScores? | number[] | Scores of the highlights (if requested) |
SearchResult<T>
object depend on the options provided in the findSimilarAndContents
call.
getContents
MethodParameter | Type | Description | Default |
---|---|---|---|
ids | string | string[] | SearchResult[]` | A single ID, an array of IDs, or an array of SearchResults. | Required |
text | boolean | { maxCharacters?: number, includeHtmlTags?: boolean } | If provided, includes the full text of the content in the results. | undefined |
highlights | boolean | { query?: string, numSentences?: number, highlightsPerUrl?: number } | If provided, includes highlights of the content in the results. | undefined |
SearchResponse
Field | Type | Description |
---|---|---|
results | SearchResult<T>[] | List of SearchResult objects |
SearchResult
SearchResult<T>
object depend on the options provided in the getContents
call:
Field | Type | Description | |
---|---|---|---|
id | string | Temporary ID for the document | |
url | string | URL of the search result | |
title | `string | null` | Title of the search result |
publishedDate? | string | Estimated creation date | |
author? | string | Author of the content, if available | |
text? | string | Text of the search result page (if requested) | |
highlights? | string[] | Highlights of the search result (if requested) | |
highlightScores? | number[] | Scores of the highlights (if requested) |
SearchResult<T>
object depend on the options provided in the getContents
call. If neither text
nor highlights
is specified, the method defaults to including the full text content.
answer
Methodtext: true
.
Parameter | Type | Description | Default |
---|---|---|---|
query | string | The question or query to answer. | Required |
options | {text?: boolean} | If text is true, each source in the result includes its full text. |
AnswerResponse
Field | Type | Description |
---|---|---|
answer | string | The generated answer text |
citations | SearchResult<{ }>[] | The citations used to generate the answer |
requestId? | string | Optional request ID for reference |
SearchResult<{}>
— a basic result object that can include text if options.text was set to true.
streamAnswer
MethodParameter | Type | Description | Default |
---|---|---|---|
query | string | The question to answer. | Required |
options | { text?: boolean } | If text is true, each citation chunk includes its full text. |
content
is the partial text content of the answer so far (streamed in chunks).citations
is an array of citation objects that appear at this chunk in the response.research.createTask
MethodParameter | Type | Description | Default |
---|---|---|---|
instructions | string | Natural language instructions describing what the research task should accomplish. | Required |
model | ResearchModel | The research model to use. Options: ResearchModel.exa_research, ResearchModel.exa_research_pro | exa_research |
output | { schema?: object, inferSchema?: boolean } | Output configuration with optional JSON schema or automatic schema inference. | undefined |
Field | Type | Description |
---|---|---|
id | string | The unique identifier for the task |
research.getTask
MethodParameter | Type | Description | Default |
---|---|---|---|
id | string | The unique identifier of the task | Required |
Field | Type | Description |
---|---|---|
id | string | The unique identifier for the task |
status | string | Task status: “running”, “completed”, or “failed” |
instructions | string | The original instructions provided |
schema | object (optional) | The JSON schema specification used |
data | object (optional) | The research results (when completed) |
citations | Record<string, Citation[]> (optional) | Citations grouped by root field (when completed) |
research.pollTask
MethodParameter | Type | Description | Default |
---|---|---|---|
id | string | The unique identifier of the task | Required |
ResearchTask
object with the completed task data (same structure as getTask
).
research.listTasks
MethodParameter | Type | Description | Default |
---|---|---|---|
cursor | string | Pagination cursor from previous request | undefined |
limit | number | Number of results to return (1-200) | 25 |
Field | Type | Description |
---|---|---|
data | ResearchTask[] | List of research task objects |
hasMore | boolean | Whether there are more results to paginate |
nextCursor | string (optional) | Cursor for the next page (if hasMore is true) |