This document provides detailed information about the AgentSearch API endpoints and their usage through the TypeScript SDK.
The Answer API provides methods for getting answers and performing advanced searches.
Get an answer to a specific query.
agentSearch.answer.get(params: AnswerRequest): Promise<any>
Parameters:
query
(string, required): The question or query to answer.additionalInstructions
(string, optional): Additional instructions for processing the query.dateFilter
(DateFilter, optional): Filter results by date ('hour' | 'day' | 'week' | 'month' | 'year').
Perform an advanced search with more complex parameters.
agentSearch.answer.advancedSearch(params: AdvancedSearchRequest): Promise<any>
Parameters:
query
(string, required): The search query.additionalInstructions
(string, optional): Additional instructions for the search.
The Browse API allows you to browse and extract information from web pages.
Browse a web page and extract information.
agentSearch.browse.explode(params: BrowseRequest): Promise<any>
Parameters:
url
(string, required): The URL of the web page to browse.scrapeOptions
(ScrapeParams, optional): Options for scraping the page.crawlOptions
(CrawlOptions, optional): Options for crawling the page.extractorOptions
(ExtractorOptions, optional): Options for extracting information.mergeDocuments
(boolean, optional): Whether to merge multiple documents into one.query
(string, optional): A query to filter the browsed content.singlePage
(boolean, optional): Whether to browse only a single page or follow links.
The Crawl API provides functionality to crawl websites.
Crawl a website starting from a given URL.
agentSearch.crawl.start(params: CrawlRequest): Promise<any>
Parameters:
url
(string, required): The starting URL for the crawl.crawlOptions
(CrawlOptions, optional): Options for the crawl operation.
The Search API offers various search capabilities, including Serper search, LinkedIn search, result reranking, and query generation.
Perform a search using the Serper search engine.
agentSearch.search.serperSearch(params: SearchRequest | SearchRequest[]): Promise<any>
Parameters:
q
(string, required): The search query.type
(string, optional): The type of search ('search' | 'news' | 'images' | 'places').num
(number, optional): The number of results to return.tbs
(string, optional): Time-based search parameter.dateFilter
(DateFilter, optional): Filter results by date.
Perform a LinkedIn-specific search.
agentSearch.search.linkedInSearch(params: LinkedInSearchRequest): Promise<any>
Parameters:
query
(string, required): The LinkedIn search query.page
(number, optional): The page number of results to retrieve.resultsPerPage
(number, optional): The number of results per page.serperOptions
(object, optional): Additional options for the Serper search engine.
Rerank search results based on relevance.
agentSearch.search.rerank(params: RerankRequest): Promise<any>
Parameters:
query
(string, required): The query to use for reranking.
Generate optimized search queries based on an initial query.
agentSearch.search.generateQueries(params: GenerateQueriesRequest): Promise<any>
Parameters:
query
(string, required): The initial query to generate optimized queries from.
The Scrape API allows you to extract content from web pages.
Scrape content from a specific URL.
agentSearch.scrape.extract(params: ScrapeRequest): Promise<any>
Parameters:
url
(string, required): The URL to scrape.scrapeOptions
(ScrapeParams, optional): Options for the scrape operation.
For more detailed information about the types and interfaces used in these methods, please refer to the types.ts
file in the SDK source code.