Enumeration of methods and types in the Exa Python SDK (exa_py).
search
MethodParameter | Type | Description | Default |
---|---|---|---|
query | str | The input query string. | Required |
num_results | Optional[int] | Number of search results to return. | 10 |
include_domains | Optional[List[str]] | List of domains to include in the search. | None |
exclude_domains | Optional[List[str]] | List of domains to exclude in the search. | None |
start_crawl_date | Optional[str] | Results will only include links crawled after this date. | None |
end_crawl_date | Optional[str] | Results will only include links crawled before this date. | None |
start_published_date | Optional[str] | Results will only include links with a published date after this date. | None |
end_published_date | Optional[str] | Results will only include links with a published date before this date. | None |
type | Optional[str] | The type of search, keyword or neural. | ”auto” |
category | Optional[str] | A data category to focus on when searching, with higher comprehensivity and data cleanliness. Currently, the available categories are: company, research paper, news, linkedin profile, github, tweet, movie, song, personal site, pdf and financial report. | None |
context | Union[ContextContentsOptions, Literal[True]] | If true, concatentates results into a context string. | None |
SearchResponse[Result]
Field | Type | Description |
---|---|---|
results | List[Result] | List of Result objects |
context | Optional[str] | Results concatentated into a string |
Field | Type | Description |
---|---|---|
url | str | URL of the search result |
id | str | Temporary ID for the document |
title | Optional[str] | Title of the search result |
score | Optional[float] | Similarity score between query/url and result |
published_date | Optional[str] | Estimated creation date |
author | Optional[str] | Author of the content, if available |
search_and_contents
MethodParameter | Type | Description | Default |
---|---|---|---|
query | str | The input query string. | Required |
text | Union[TextContentsOptions, Literal[True]] | If provided, includes the full text of the content in the results. | None |
highlights | Union[HighlightsContentsOptions, Literal[True]] | If provided, includes highlights of the content in the results. | None |
num_results | Optional[int] | Number of search results to return. | 10 |
include_domains | Optional[List[str]] | List of domains to include in the search. | None |
exclude_domains | Optional[List[str]] | List of domains to exclude in the search. | None |
start_crawl_date | Optional[str] | Results will only include links crawled after this date. | None |
end_crawl_date | Optional[str] | Results will only include links crawled before this date. | None |
start_published_date | Optional[str] | Results will only include links with a published date after this date. | None |
end_published_date | Optional[str] | Results will only include links with a published date before this date. | None |
type | Optional[str] | The type of search, keyword or neural. | ”auto” |
category | Optional[str] | A data category to focus on when searching, with higher comprehensivity and data cleanliness. Currently, the available categories are: company, research paper, news, linkedin profile, github, tweet, movie, song, personal site, pdf and financial report. | None |
context | Union[ContextContentsOptions, Literal[True]] | If true, concatentates results into a context string. | None |
text
and highlights
parameters:
SearchResponse[ResultWithText]
: When only text
is provided.SearchResponse[ResultWithHighlights]
: When only highlights
is provided.SearchResponse[ResultWithTextAndHighlights]
: When both text
and highlights
are provided.SearchResponse[ResultWithTextAndHighlights]
Field | Type | Description |
---|---|---|
results | List[ResultWithTextAndHighlights] | List of ResultWithTextAndHighlights objects |
context | Optional[str] | Results concatenated into a string |
ResultWithTextAndHighlights
ObjectField | Type | Description |
---|---|---|
url | str | URL of the search result |
id | str | Temporary ID for the document |
title | Optional[str] | Title of the search result |
score | Optional[float] | Similarity score between query/url and result |
published_date | Optional[str] | Estimated creation date |
author | Optional[str] | Author of the content, if available |
text | str | Text of the search result page (always present) |
highlights | List[str] | Highlights of the search result (always present) |
highlight_scores | List[float] | Scores of the highlights (always present) |
text
nor highlights
is specified, the method defaults to including the full text content.
find_similar
MethodParameter | Type | Description | Default |
---|---|---|---|
url | str | The URL of the webpage to find similar results for. | Required |
num_results | Optional[int] | Number of similar results to return. | None |
include_domains | Optional[List[str]] | List of domains to include in the search. | None |
exclude_domains | Optional[List[str]] | List of domains to exclude from the search. | None |
start_crawl_date | Optional[str] | Results will only include links crawled after this date. | None |
end_crawl_date | Optional[str] | Results will only include links crawled before this date. | None |
start_published_date | Optional[str] | Results will only include links with a published date after this date. | None |
end_published_date | Optional[str] | Results will only include links with a published date before this date. | None |
exclude_source_domain | Optional[bool] | If true, excludes results from the same domain as the input URL. | None |
category | Optional[str] | A data category to focus on when searching, with higher comprehensivity and data cleanliness. | None |
context | Union[ContextContentsOptions, Literal[True]] | If true, concatentates results into a context string. | None |
SearchResponse[_Result]
: The response containing similar results and optional autoprompt string.
SearchResponse[Results]
Field | Type | Description |
---|---|---|
results | List[ResultWithTextAndHighlights] | List of ResultWithTextAndHighlights objects |
context | Optional[String] | Results concatentated into a string |
Results
ObjectField | Type | Description |
---|---|---|
url | str | URL of the search result |
id | str | Temporary ID for the document |
title | Optional[str] | Title of the search result |
score | Optional[float] | Similarity score between query/url and result |
published_date | Optional[str] | Estimated creation date |
author | Optional[str] | Author of the content, if available |
find_similar_and_contents
MethodParameter | Type | Description | Default |
---|---|---|---|
url | str | The URL of the webpage to find similar results for. | Required |
text | Union[TextContentsOptions, Literal[True]] | If provided, includes the full text of the content in the results. | None |
highlights | Union[HighlightsContentsOptions, Literal[True]] | If provided, includes highlights of the content in the results. | None |
num_results | Optional[int] | Number of similar results to return. | None |
include_domains | Optional[List[str]] | List of domains to include in the search. | None |
exclude_domains | Optional[List[str]] | List of domains to exclude from the search. | None |
start_crawl_date | Optional[str] | Results will only include links crawled after this date. | None |
end_crawl_date | Optional[str] | Results will only include links crawled before this date. | None |
start_published_date | Optional[str] | Results will only include links with a published date after this date. | None |
end_published_date | Optional[str] | Results will only include links with a published date before this date. | None |
exclude_source_domain | Optional[bool] | If true, excludes results from the same domain as the input URL. | None |
category | Optional[str] | A data category to focus on when searching, with higher comprehensivity and data cleanliness. | None |
context | Union[ContextContentsOptions, Literal[True]] | If true, concatentates results into a context string. | None |
text
and highlights
parameters:
SearchResponse[ResultWithText]
: When only text
is provided or when neither text
nor highlights
is provided (defaults to including text).SearchResponse[ResultWithHighlights]
: When only highlights
is provided.SearchResponse[ResultWithTextAndHighlights]
: When both text
and highlights
are provided.text
nor highlights
is specified, the method defaults to including the full text content.
answer
MethodParameter | Type | Description | Default |
---|---|---|---|
query | str | The question to answer. | Required |
text | Optional[bool] | If true, the full text of each citation is included in the result. | False |
stream | Optional[bool] | Note: If true, an error is thrown. Use stream_answer() instead for streaming responses. | None |
AnswerResponse
object:
Field | Type | Description |
---|---|---|
answer | str | The generated answer text |
citations | List[AnswerResult] | List of citations used to generate the answer |
AnswerResult
objectField | Type | Description |
---|---|---|
id | str | Temporary ID for the document |
url | str | URL of the citation |
title | Optional[str] | Title of the content, if available |
published_date | Optional[str] | Estimated creation date |
author | Optional[str] | The author of the content, if available |
text | Optional[str] | The full text of the content (if text=True) |
stream_answer
MethodParameter | Type | Description | Default |
---|---|---|---|
query | str | The question to answer. | Required |
text | Optional[bool] | If true, includes full text of each citation in the streamed response. | False |
StreamAnswerResponse
object, which is iterable. Iterating over it yields StreamChunk
objects:
StreamChunk
Field | Type | Description |
---|---|---|
content | Optional[str] | Partial text content of the answer so far. |
citations | Optional[List[AnswerResult]] | Citations discovered in this chunk, if any. |
stream.close()
to end the streaming session if needed.
research.create_task
MethodParameter | Type | Description | Default |
---|---|---|---|
instructions | str | Natural language instructions describing what the research task should accomplish. | Required |
model | Optional[str] | The research model to use. Options: “exa-research” (default), “exa-research-pro”. | “exa-research” |
output_schema | Optional[Dict] | JSON Schema specification for the desired output structure. See json-schema.org/draft-07. | None |
infer_schema | Optional[bool] | When true and no output schema is provided, an LLM will generate an output schema. | None |
ResearchTask
object:
Field | Type | Description |
---|---|---|
id | str | The unique identifier for the task |
research.get_task
MethodParameter | Type | Description | Default |
---|---|---|---|
task_id | str | The unique identifier of the task | Required |
ResearchTaskDetails
object:
Field | Type | Description |
---|---|---|
id | str | The unique identifier for the task |
status | str | Task status: “running”, “completed”, or “failed” |
instructions | str | The original instructions provided |
schema | Optional[Dict] | The JSON schema specification used |
data | Optional[Dict] | The research results (when completed) |
citations | Optional[Dict[str, List]] | Citations grouped by root field (when completed) |
research.poll_task
MethodParameter | Type | Description | Default |
---|---|---|---|
task_id | str | The unique identifier of the task | Required |
poll_interval | Optional[int] | Seconds between polling attempts | 2 |
max_wait_time | Optional[int] | Maximum seconds to wait before timing out | 300 |
ResearchTaskDetails
object with the completed task data (same structure as get_task
).
research.list_tasks
MethodParameter | Type | Description | Default |
---|---|---|---|
cursor | Optional[str] | Pagination cursor from previous request | None |
limit | Optional[int] | Number of results to return (1-200) | 25 |
Field | Type | Description |
---|---|---|
data | List[ResearchTaskDetails] | List of research task objects |
hasMore | bool | Whether there are more results to paginate |
nextCursor | Optional[str] | Cursor for the next page (if hasMore is true) |