Skip to main content
Kimi Open Platform provides three search and page-fetching APIs: Web Search Basic, Web Search Pro, and URL Fetch. This page covers how to pick the right API, control costs, write effective queries, and configure parameters, so you get more accurate results with fewer calls.

Choose the right API

The three APIs are billed per call; see Pricing. Common tasks and the recommended API: After Web Search Basic finds the pages, Web Search Pro takes one more step: it reads the content, picks the passages most relevant to your question, and ranks them by relevance. When the results are meant for a model, Web Search Pro has three benefits:
  • More accurate answers: the model reads the passages most relevant to the question instead of full pages mixed with navigation and ads, so key information is not diluted by noise.
  • Less engineering: chunking and relevance ranking are done on the server, so you do not build or maintain that pipeline yourself; the results go straight to the model.
  • Traceable sources: every passage keeps its page’s title, URL, and site, so answers can cite and be checked.
If the results go straight to users instead of a model (search result pages, source cards), or you want to process the content yourself (chunking, filtering), Web Search Pro’s extra processing is wasted, so choose Web Search Basic.

Control costs

Beyond how much content each call returns, the number of calls also affects cost. We recommend rewriting follow-up questions on the same information need as one more complete query and merging them into a single call. Similar queries return heavily overlapping pages, so splitting the work across calls spends your money on the same pages over and over; after merging, the same money covers more distinct sources. For example, to research the 2025 Nobel Prize in Physics:
  • ✗ Split it into three calls: 2025 Nobel Prize in Physics, 2025 Nobel Prize in Physics awarded work, 2025 Nobel Prize in Physics experimental verification
  • ✓ Merge them into one call: 2025 Nobel Prize in Physics awarded work experimental verification
For the pricing of search and page-fetching calls, see Pricing. If a single search does not give you enough detail, make the query more specific.

Write effective queries

The APIs search exactly what you submit in text_query, with no automatic rewriting, completion, or expansion. The query decides what gets searched. A vague query wastes calls on irrelevant pages, while a specific one makes every result count. There are three dimensions to making a query specific: With all three dimensions in place, one call returns material you can use directly:
  • Nobel Prize
  • 2025 Nobel Prize in Physics awarded work experimental verification
Two more points to note:
  • One information need per call. Stacking unrelated questions into a single query just produces a long, scattered query, and result quality drops.
  • Don’t retry with synonym rewrites. Two near-identical queries return heavily overlapping results, so you pay twice for the same results. When the first result is poor, add an entity, a time term, or a qualifier, or come at the question from a different angle (a different dimension, or a different language).

Filter results by site and time

Web Search Pro offers two constraint parameters that directly limit the search scope:
  • sites: restrict sources to specific sites, up to 5; multiple sites are treated as OR. For example, ["nobelprize.org", "nature.com"] limits results to those sites.
  • time_window: restrict the publication date range. Dates accept three formats: YYYY, YYYY-MM, and YYYY-MM-DD. Time terms in the query influence searching and ranking, while time_window filters results directly by date; the two can be combined.

Set result count and timeout

Web Search Basic and Web Search Pro also accept limit and timeout_seconds; set them explicitly:
  • limit: the maximum number of results, default 5, range 1 to 20. Start with a few results to gauge direction, then decide whether to go deeper.
  • timeout_seconds: the timeout, range 1 to 60 seconds. Returning page content (include_content=true) or using Web Search Pro takes longer, so allow enough time.

Handle edge cases

  • Whether a page’s content can be fetched depends on site accessibility, login requirements, anti-scraping policies, page structure, and network conditions. When the search APIs cannot fetch the content, they still return the page’s title, URL, and snippet, so you can judge relevance from the snippet first and then decide whether to switch sources.
  • The Markdown returned by URL Fetch is an extraction of the page body and does not include images, videos, or other multimedia resources.

Full example

The following example uses Web Search Pro to search for the 2025 Nobel Prize in Physics: the query carries a time term and an entity, sites restricts sources to the official Nobel Prize site, and time_window bounds the publication date range:
Each result in the response contains the page’s title, URL, site, date, and several content passages, ranked by relevance and ready to hand to a model:
chunks[].score is the relevance score of a passage to the query. It is only meaningful relative to other chunks from the same query; do not compare absolute scores across queries.