websearch.fast
控制台获取密钥

深度研究

针对一个问题生成附来源的报告,以任务方式运行。

本参考页为英文。字段名、示例和错误码在所有语言版本中都一样。

Plans searches, reads pages and writes a report as an asynchronous job. Every claim in the report cites a numbered source that the job read. depth (quick, standard, deep) sets the default limits of searches, pages and report length.

Progress can be read as events, either as a server-sent event stream or as a JSON list. A job and its report are kept for 30 days after the job ends.

What is charged

Charged per unit used while the job runs (searches, pages read and model work), when the job produced a report (complete or partial) or was cancelled by you. A job that failed on our side without a report is free. max_cost_usd caps what one job can charge.

Units: research_search, research_page, research_model. usage.items in the response lists them.

Start a research job

POST https://api.websearch.fast/v1/web/research

Planned. Until it ships, calls return 501 api_not_implemented.

Headers

NameTypeDescription
Idempotency-Keystring1 to 128 bytes; a retry with the same key and body within 24 hours returns the same job. 1 to 128 characters.

Body

NameTypeDescription
queryrequiredstring1 to 4000 characters.
instructionsstringAt most 8000 characters.
depthstringOne of quick, standard, deep. Default standard.
max_searchesinteger1 to 200.
max_pagesinteger1 to 400.
languagestringBCP 47 language tag. At most 12 characters.
countrystringISO 3166-1 alpha-2 country code, case-insensitive.
freshnessstringOnly results published within this period. One of hour, day, week, month, year.
date_fromstringDate YYYY-MM-DD (UTC).
date_tostringDate YYYY-MM-DD (UTC).
include_domainsarray of stringHost names; subdomains included. At most 20 items.
exclude_domainsarray of stringAt most 50 items.
outputobject
Show fields
NameTypeDescription
formatstringOne of markdown, json. Default markdown.
schemaobjectJSON Schema 2020-12 subset; root must be an object; at most 16 KB, depth 5, 200 properties.
max_wordsinteger100 to 10,000.
webhook_urlstringPublic https URL that receives the final job object, signed with webhook_secret. At most 500 characters.
metadataobjectYour own string values, echoed on the job; at most 4 KB.

Example request

curl https://api.websearch.fast/v1/web/research \
  -H "Authorization: Bearer $WEBSEARCH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "How did residential heat pump sales in the EU change in 2025 and why?",
    "depth": "standard"
  }'
import os
import uuid
import httpx

response = httpx.post(
    "https://api.websearch.fast/v1/web/research",
    headers={"Authorization": f"Bearer {os.environ['WEBSEARCH_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
    json={
        "query": "How did residential heat pump sales in the EU change in 2025 and why?",
        "depth": "standard",
    },
    timeout=60,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.websearch.fast/v1/web/research", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WEBSEARCH_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "How did residential heat pump sales in the EU change in 2025 and why?",
    depth: "standard",
  }),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());

Example response

{
  "object": "web.research",
  "id": "wr_01JD7Q9R2M",
  "status": "queued",
  "created_at": 1795867205,
  "input": {
    "query": "How did residential heat pump sales in the EU change in 2025 and why?",
    "depth": "standard",
    "max_searches": 30,
    "max_pages": 50,
    "output": {"format": "markdown", "max_words": 1500}
  },
  "progress": {
    "steps_done": 0,
    "searches": 0,
    "pages_read": 0,
    "sources_kept": 0
  },
  "poll_after_ms": 5000,
  "expires_at": 1798459205
}

Response fields

Job created; the ceiling is reserved.

NameTypeDescription
objectrequiredstringAlways web.research.
idrequiredstringAt most 64 characters. Starts with wr_.
statusrequiredstringOne of queued, running, succeeded, failed, cancelled.
stop_reasonstringOne of completed, budget, limit, cancelled, deadline, error.
created_atrequiredinteger
started_atinteger
completed_atinteger
inputrequiredobject
usagerequiredobject
Show fields
NameTypeDescription
itemsrequiredarray of object
Show fields
NameTypeDescription
unitrequiredstringBillable unit, for example search_web, content_page, fetch_page, geocode, autocomplete, knowledge.
countrequiredinteger
errorobject
Show fields
NameTypeDescription
coderequiredstring
messagestring
poll_after_msinteger
webhook_secretstringOnly in the create response, when webhook_url was set.
metadataobject
expires_atinteger
progressobject
Show fields
NameTypeDescription
steps_doneinteger
searchesinteger
pages_readinteger
sources_keptinteger
reportobject
Show fields
NameTypeDescription
formatrequiredstringOne of markdown, json.
textstring
dataobject
sourcesrequiredarray of object
Show fields
NameTypeDescription
indexrequiredintegerAt least 1.
urlrequiredstring
titlestring
site_namestring
published_atstring

Errors

StatusCodes
400invalid_request, invalid_url, invalid_schema or invalid_image. Not charged.
401invalid_token. Not charged.
403pre_consume_token_quota_failed (the key's own spending limit), access_denied, web_not_allowed or model_not_in_plan (customer keys while plans cannot include the web tools). Not charged.
404not_found or invalid_endpoint. Not charged.
409idempotency_conflict or request_in_progress. Not charged.
413read_request_body_failed: the request body is over the limit. Not charged.
429rate_limited, concurrency_limited, api_key_temporarily_frozen, or the failure guard. Not charged.
500internal_error. Not charged.
501api_not_implemented: the endpoint, type or option has not shipped. Not charged.
503source_unavailable, web_api_disabled, token_cache_busy or billing_busy (the charge could not be prepared in time; retry after Retry-After). Not charged.
504timeout. Not charged.

Get a research job

GET https://api.websearch.fast/v1/web/research/{id}

Planned. Until it ships, calls return 501 api_not_implemented.

Path parameters

NameTypeDescription
idrequiredstringStarts with wr_.

Example request

curl https://api.websearch.fast/v1/web/research/wr_01JD7Q9R2M \
  -H "Authorization: Bearer $WEBSEARCH_API_KEY"
import os
import httpx

response = httpx.get(
    "https://api.websearch.fast/v1/web/research/wr_01JD7Q9R2M",
    headers={"Authorization": f"Bearer {os.environ['WEBSEARCH_API_KEY']}"},
    timeout=60,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.websearch.fast/v1/web/research/wr_01JD7Q9R2M", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.WEBSEARCH_API_KEY}`,
  },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());

Response fields

The job.

NameTypeDescription
objectrequiredstringAlways web.research.
idrequiredstringAt most 64 characters. Starts with wr_.
statusrequiredstringOne of queued, running, succeeded, failed, cancelled.
stop_reasonstringOne of completed, budget, limit, cancelled, deadline, error.
created_atrequiredinteger
started_atinteger
completed_atinteger
inputrequiredobject
usagerequiredobject
Show fields
NameTypeDescription
itemsrequiredarray of object
Show fields
NameTypeDescription
unitrequiredstringBillable unit, for example search_web, content_page, fetch_page, geocode, autocomplete, knowledge.
countrequiredinteger
errorobject
Show fields
NameTypeDescription
coderequiredstring
messagestring
poll_after_msinteger
webhook_secretstringOnly in the create response, when webhook_url was set.
metadataobject
expires_atinteger
progressobject
Show fields
NameTypeDescription
steps_doneinteger
searchesinteger
pages_readinteger
sources_keptinteger
reportobject
Show fields
NameTypeDescription
formatrequiredstringOne of markdown, json.
textstring
dataobject
sourcesrequiredarray of object
Show fields
NameTypeDescription
indexrequiredintegerAt least 1.
urlrequiredstring
titlestring
site_namestring
published_atstring

Errors

StatusCodes
400invalid_request, invalid_url, invalid_schema or invalid_image. Not charged.
401invalid_token. Not charged.
403pre_consume_token_quota_failed (the key's own spending limit), access_denied, web_not_allowed or model_not_in_plan (customer keys while plans cannot include the web tools). Not charged.
404not_found or invalid_endpoint. Not charged.
413read_request_body_failed: the request body is over the limit. Not charged.
429rate_limited, concurrency_limited, api_key_temporarily_frozen, or the failure guard. Not charged.
500internal_error. Not charged.
501api_not_implemented: the endpoint, type or option has not shipped. Not charged.
503source_unavailable, web_api_disabled, token_cache_busy or billing_busy (the charge could not be prepared in time; retry after Retry-After). Not charged.
504timeout. Not charged.

Cancel a research job

POST https://api.websearch.fast/v1/web/research/{id}/cancel

Planned. Until it ships, calls return 501 api_not_implemented.

Path parameters

NameTypeDescription
idrequiredstringStarts with wr_.

Example request

curl -X POST https://api.websearch.fast/v1/web/research/wr_01JD7Q9R2M/cancel \
  -H "Authorization: Bearer $WEBSEARCH_API_KEY"
import os
import httpx

response = httpx.post(
    "https://api.websearch.fast/v1/web/research/wr_01JD7Q9R2M/cancel",
    headers={"Authorization": f"Bearer {os.environ['WEBSEARCH_API_KEY']}"},
    timeout=60,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.websearch.fast/v1/web/research/wr_01JD7Q9R2M/cancel", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WEBSEARCH_API_KEY}`,
  },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());

Response fields

The job.

NameTypeDescription
objectrequiredstringAlways web.research.
idrequiredstringAt most 64 characters. Starts with wr_.
statusrequiredstringOne of queued, running, succeeded, failed, cancelled.
stop_reasonstringOne of completed, budget, limit, cancelled, deadline, error.
created_atrequiredinteger
started_atinteger
completed_atinteger
inputrequiredobject
usagerequiredobject
Show fields
NameTypeDescription
itemsrequiredarray of object
Show fields
NameTypeDescription
unitrequiredstringBillable unit, for example search_web, content_page, fetch_page, geocode, autocomplete, knowledge.
countrequiredinteger
errorobject
Show fields
NameTypeDescription
coderequiredstring
messagestring
poll_after_msinteger
webhook_secretstringOnly in the create response, when webhook_url was set.
metadataobject
expires_atinteger
progressobject
Show fields
NameTypeDescription
steps_doneinteger
searchesinteger
pages_readinteger
sources_keptinteger
reportobject
Show fields
NameTypeDescription
formatrequiredstringOne of markdown, json.
textstring
dataobject
sourcesrequiredarray of object
Show fields
NameTypeDescription
indexrequiredintegerAt least 1.
urlrequiredstring
titlestring
site_namestring
published_atstring

Errors

StatusCodes
400invalid_request, invalid_url, invalid_schema or invalid_image. Not charged.
401invalid_token. Not charged.
403pre_consume_token_quota_failed (the key's own spending limit), access_denied, web_not_allowed or model_not_in_plan (customer keys while plans cannot include the web tools). Not charged.
404not_found or invalid_endpoint. Not charged.
413read_request_body_failed: the request body is over the limit. Not charged.
429rate_limited, concurrency_limited, api_key_temporarily_frozen, or the failure guard. Not charged.
500internal_error. Not charged.
501api_not_implemented: the endpoint, type or option has not shipped. Not charged.
503source_unavailable, web_api_disabled, token_cache_busy or billing_busy (the charge could not be prepared in time; retry after Retry-After). Not charged.
504timeout. Not charged.

Progress events of a research job

GET https://api.websearch.fast/v1/web/research/{id}/events

Planned. Until it ships, calls return 501 api_not_implemented.

Headers

NameTypeDescription
Last-Event-IDstring

Path parameters

NameTypeDescription
idrequiredstringStarts with wr_.

Query parameters

NameTypeDescription
afterinteger

Example request

curl "https://api.websearch.fast/v1/web/research/wr_01JD7Q9R2M/events?after=0" \
  -H "Authorization: Bearer $WEBSEARCH_API_KEY"
import os
import httpx

response = httpx.get(
    "https://api.websearch.fast/v1/web/research/wr_01JD7Q9R2M/events",
    headers={"Authorization": f"Bearer {os.environ['WEBSEARCH_API_KEY']}"},
    params={
        "after": 0,
    },
    timeout=60,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.websearch.fast/v1/web/research/wr_01JD7Q9R2M/events?after=0", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.WEBSEARCH_API_KEY}`,
  },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());

Response fields

text/event-stream with Accept: text/event-stream (reconnect with Last-Event-ID), otherwise a JSON list.

NameTypeDescription
objectrequiredstringAlways list.
datarequiredarray of object
Show fields
NameTypeDescription
seqrequiredinteger
eventrequiredstringOne of status, search, page, note, report, error, done.
dataobject
createdrequiredinteger
has_morerequiredboolean
next_cursorstring

Errors

StatusCodes
400invalid_request, invalid_url, invalid_schema or invalid_image. Not charged.
401invalid_token. Not charged.
403pre_consume_token_quota_failed (the key's own spending limit), access_denied, web_not_allowed or model_not_in_plan (customer keys while plans cannot include the web tools). Not charged.
404not_found or invalid_endpoint. Not charged.
413read_request_body_failed: the request body is over the limit. Not charged.
429rate_limited, concurrency_limited, api_key_temporarily_frozen, or the failure guard. Not charged.
500internal_error. Not charged.
501api_not_implemented: the endpoint, type or option has not shipped. Not charged.
503source_unavailable, web_api_disabled, token_cache_busy or billing_busy (the charge could not be prepared in time; retry after Retry-After). Not charged.
504timeout. Not charged.