Skip to content

Search and Fetch API

Search the web and read web pages through /v1, charged to your Cloud project per request.

Search the web and read the text of web pages with your API key at https://api.dexto.ai. Each request is Dexto Cloud usage of your key’s Cloud project: it is charged from your organization’s credits, counts toward the project’s and key’s monthly spend limits, and returns what it cost in usage.charge_usd.

Use a developer API key, or the key Dexto gives a deployed Function or Site. A CLI sign-in key gets 403.

POST /v1/search
Terminal window
curl -X POST https://api.dexto.ai/v1/search \
-H "Authorization: Bearer $DEXTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"Cloudflare Workers limits","num_results":5}'
FieldTypeDefaultNotes
querystring1-2,000 characters.
num_resultsinteger81-20.
typestringautoauto, or fast for lightweight lookups.
max_charactersinteger2000Highlight characters per result, 100-10,000.
max_age_hoursintegerUse cached pages only when younger; 0 always reads live.
{
"id": "8f1c6b55-7d6c-4ad6-9a8e-0f1a33a1c0de",
"object": "search",
"results": [
{
"title": "Limits · Cloudflare Workers docs",
"url": "https://developers.cloudflare.com/workers/platform/limits/",
"published_date": "2026-09-30",
"highlights": ["Workers on the Paid plan can run for up to 5 minutes of CPU time..."]
}
],
"usage": { "charge_usd": 0.01625 }
}
POST /v1/fetch
Terminal window
curl -X POST https://api.dexto.ai/v1/fetch \
-H "Authorization: Bearer $DEXTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"urls":["https://developers.cloudflare.com/workers/platform/limits/"]}'
FieldTypeDefaultNotes
urlsstring[]1-10 absolute http or https URLs without credentials.
max_charactersinteger20000Text characters per page, 100-100,000.
max_age_hoursintegerAs for search.

Each distinct URL gets one result. A page that could not be read has status: "error" and an error with a code and the page’s http_status when there was one; it is not charged.

{
"id": "0d1c6b55-7d6c-4ad6-9a8e-0f1a33a1c0de",
"object": "fetch",
"results": [
{
"url": "https://developers.cloudflare.com/workers/platform/limits/",
"status": "ok",
"title": "Limits · Cloudflare Workers docs",
"text": "Limits ...",
"error": null
}
],
"usage": { "charge_usd": 0.00125 }
}

Search and fetch are charged at the provider’s cost plus 25%. A search with 8 results is about $0.019; a fetched page is about $0.00125. Each request is checked against your credits and spend limits before anything is fetched.

StatusCodeWhen
400validation_failedThe body is invalid; nothing is charged.
402insufficient_creditsThe organization’s credits do not cover the request.
402spend_limit_reachedThe project or key reached its monthly spend limit.
403forbiddenThe key is not a developer key or a deployed key.
429rate_limitedMore than 120 requests a minute for the organization.
502upstream_failureThe search provider failed; nothing is charged.
import { createCapabilitiesClient } from "@dexto-cloudflare/capabilities-client";
const cloud = createCapabilitiesClient({ apiKey: process.env.DEXTO_API_KEY });
const { results } = await cloud.web.search({
query: "Cloudflare Workers limits",
});
const pages = await cloud.web.fetch({ urls: [results[0].url] });