websearch.fast
控制台获取密钥

用量

一个密钥在网页调用上花了多少。

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

Reports what the calling key spent on web calls, by day, by endpoint, or both. Days are UTC, the range is at most 400 days, and calls appear within a minute. The report never contains the query.

What is charged

Free. It counts towards the rate limit.

Request

GET https://api.websearch.fast/v1/web/usage

Query parameters

NameTypeDescription
fromstring
tostring
group_bystringOne of day, endpoint, day_endpoint. Default day.

Example request

curl "https://api.websearch.fast/v1/web/usage?from=2026-11-01&to=2026-11-28&group_by=endpoint" \
  -H "Authorization: Bearer $WEBSEARCH_API_KEY"
import os
import httpx

response = httpx.get(
    "https://api.websearch.fast/v1/web/usage",
    headers={"Authorization": f"Bearer {os.environ['WEBSEARCH_API_KEY']}"},
    params={
        "from": "2026-11-01",
        "to": "2026-11-28",
        "group_by": "endpoint",
    },
    timeout=60,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.websearch.fast/v1/web/usage?from=2026-11-01&to=2026-11-28&group_by=endpoint", {
  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

Usage of the calling key.

NameTypeDescription
objectrequiredstringAlways web.usage.
request_idrequiredstringSame as the X-Request-Id header.
createdrequiredintegerUnix seconds (UTC).
fromrequiredstringDate YYYY-MM-DD (UTC).
torequiredstringDate YYYY-MM-DD (UTC).
group_bystringThe grouping of data, as requested. One of day, endpoint, day_endpoint.
totalsrequiredobject
Show fields
NameTypeDescription
callsrequiredinteger
charged_callsrequiredinteger
datarequiredarray of object
Show fields
NameTypeDescription
daystringDate YYYY-MM-DD (UTC).
endpointstring
callsrequiredinteger
charged_callsrequiredinteger
pricingobjectWhat a paid call costs now. Present only while the site has a valid price; the same for every key, also for administrator preview keys, whose calls stay free. A call costs the sum of weight times units in credits, at price_per_1000_credits_usd per 1,000 credits.
Show fields
NameTypeDescription
price_per_1000_credits_usdrequirednumberAbove 0.
weightsrequiredobjectCredit weight of each billing unit the endpoints deliver (section 6.2), such as search_web, content_page, fetch_page, fetch_pdf_pages, geocode and reverse_geocode.

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.