/v1/tools/web-search is deprecated and will be removed on December 22, 2025.Migration path: Use the web search tool in chat completions to perform web searches during conversations. The web search tool provides the same search capabilities within a chat completion workflow.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your Writer API key.
Body
The search query.
The search topic category. Use news for current events and news articles, or general for broader web search.
general, news Controls search comprehensiveness:
basic: Returns fewer but highly relevant resultsadvanced: Performs a deeper search with more results
basic, advanced Only applies when search_depth is advanced. Specifies how many text segments to extract from each source. Limited to 3 chunks maximum.
Limits the number of search results returned. Cannot exceed 20 sources.
Filters results to content published within the specified time range back from the current date. For example, week or w returns results from the past 7 days.
day, week, month, year, d, w, m, y For news topic searches, specifies how many days of news coverage to include.
Controls how raw content is included in search results:
text: Returns plain text without formatting markupmarkdown: Returns structured content with markdown formatting (headers, links, bold text)true: Same asmarkdownfalse: Raw content is not included (default if unset)
text, markdown Whether to include a generated answer to the query in the response. If false, only search results are returned.
Domains to include in the search. If unset, the search includes all domains.
Domains to exclude from the search. If unset, the search includes all domains.
Localizes search results to a specific country. Only applies to general topic searches.
afghanistan, albania, algeria, andorra, angola, argentina, armenia, australia, austria, azerbaijan, bahamas, bahrain, bangladesh, barbados, belarus, belgium, belize, benin, bhutan, bolivia, bosnia and herzegovina, botswana, brazil, brunei, bulgaria, burkina faso, burundi, cambodia, cameroon, canada, cape verde, central african republic, chad, chile, china, colombia, comoros, congo, costa rica, croatia, cuba, cyprus, czech republic, denmark, djibouti, dominican republic, ecuador, egypt, el salvador, equatorial guinea, eritrea, estonia, ethiopia, fiji, finland, france, gabon, gambia, georgia, germany, ghana, greece, guatemala, guinea, haiti, honduras, hungary, iceland, india, indonesia, iran, iraq, ireland, israel, italy, jamaica, japan, jordan, kazakhstan, kenya, kuwait, kyrgyzstan, latvia, lebanon, lesotho, liberia, libya, liechtenstein, lithuania, luxembourg, madagascar, malawi, malaysia, maldives, mali, malta, mauritania, mauritius, mexico, moldova, monaco, mongolia, montenegro, morocco, mozambique, myanmar, namibia, nepal, netherlands, new zealand, nicaragua, niger, nigeria, north korea, north macedonia, norway, oman, pakistan, panama, papua new guinea, paraguay, peru, philippines, poland, portugal, qatar, romania, russia, rwanda, saudi arabia, senegal, serbia, singapore, slovakia, slovenia, somalia, south africa, south korea, south sudan, spain, sri lanka, sudan, sweden, switzerland, syria, taiwan, tajikistan, tanzania, thailand, togo, trinidad and tobago, tunisia, turkey, turkmenistan, uganda, ukraine, united arab emirates, united kingdom, united states, uruguay, uzbekistan, venezuela, vietnam, yemen, zambia, zimbabwe Enables streaming of search results as they become available.