AI Features

AI Web Search

post

Performs a web search using advanced AI-powered search capabilities. This endpoint leverages the Tavily API to provide comprehensive search results with optional LLM-generated answers, image results, and content extraction.

Authorizations
Body
querystringRequired

The query to run a search on

searchDepthstring · enumOptional

The depth of the search. 'advanced' search is tailored to retrieve the most relevant sources and content snippets for your query, while 'basic' search provides generic content snippets from each source

Possible values:
topicstring · enumOptional

The category of the search. Determines which agent will be used

Possible values:
daysinteger · int32 · min: 1 · max: 365Optional

The number of days back from the current date to include in the results. Available only when using the 'news' topic

timeRangestring · enumOptional

The time range back from the current date

Possible values:
maxResultsinteger · int32 · max: 20Optional

The maximum number of search results to return

chunksPerSourceinteger · int32 · min: 1 · max: 10Optional

Maximum number of relevant chunks returned per source. Available only when searchDepth is 'advanced'

includeImagesbooleanOptional

Include a list of query-related images in the response

includeImageDescriptionsbooleanOptional

Include a list of query-related images and their descriptions in the response

includeAnswerany ofOptional

Include an answer to the query generated by an LLM based on search results. A 'basic' (or true) answer is quick but less detailed; an 'advanced' answer is more detailed

booleanOptional
or
string · enumOptionalPossible values:
includeRawContentany ofOptional

Include the cleaned and parsed HTML content of each search result. 'markdown' or True returns search result content in markdown format. 'text' returns the plain text from the results and may increase latency

booleanOptional
or
string · enumOptionalPossible values:
includeDomainsstring[]Optional

A list of domains to specifically include in the search results

excludeDomainsstring[]Optional

A list of domains to specifically exclude from the search results

countrystringOptional

Boost search results from a specific country. This will prioritize content from the selected country in the search results. Available only if topic is general

timeoutinteger · int32 · min: 1 · max: 300Optional

A timeout to be used in requests to the Tavily API

Responses
200
The request has succeeded.
application/json
post
POST /ai/web-search HTTP/1.1
Host: madapi.madkudu.com
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 192

{
  "query": "sustainable technology innovations",
  "includeImages": true,
  "includeImageDescriptions": true,
  "includeDomains": [
    "ieee.org",
    "nature.com",
    "sciencedirect.com"
  ],
  "maxResults": 8,
  "country": "US"
}
200

The request has succeeded.

{
  "query": "latest cloud outages",
  "follow_up_questions": "",
  "answer": "",
  "images": [],
  "results": [
    {
      "title": "Google Cloud down? Current problems and outages",
      "url": "https://downdetector.com/status/google-cloud/",
      "content": "Big Tony's Happy Hen House IMHO, I would hire a new CTO. META has so many issues. So many other people would be better and deserve the job. 2025-06-12 20:23:23 David Shirk Actually, both cloud ... @GadellNet A major cloud outage is impacting platforms like AWS, Google Cloud, Cloudflare, Dialpad, Gmail, and more. OUR PHONES ARE DOWN-PLEASE USE",
      "score": 0.6356076,
      "raw_content": ""
    },
    {
      "title": "Internet Outages Map - ThousandEyes",
      "url": "https://www.thousandeyes.com/outages/",
      "content": "The Internet Outages Map is an at-a-glance visualization of global Internet health over the last 24 hours, tracking Internet outages across ISPs, top application providers, public clouds, and edge service networks. This map automatically updates outage information every 5 minutes and shows ongoing and recently detected outages.",
      "score": 0.46555817,
      "raw_content": ""
    }
  ],
  "response_time": 1.47
}

Last updated

Was this helpful?