Docs
Dashboard
Guides / WebBeta

Search

Search the web in one request, with the top pages as Markdown if you want them.

POST /v1/search searches the web and returns the top results: their title, URL, a snippet, and the page’s date and site name when they are known. With fetch, the top pages come back as Markdown too, in the same request, so an agent can read them straight away. No session is needed.

curl -X POST https://api.boxline.dev/v1/search \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -d '{"query": "playwright connect over cdp", "limit": 5}'
Response
{  "query": "playwright connect over cdp",  "cached": false,  "ms": 412,  "results": [    {      "title": "BrowserType | Playwright",      "url": "https://playwright.dev/docs/api/class-browsertype",      "snippet": "A CDP websocket endpoint or http url to connect to.",      "siteName": "Playwright"    },    {      "title": "Connecting Playwright to an Existing Browser | BrowserStack",      "url": "https://www.browserstack.com/guide/playwright-connect-to-existing-browser",      "snippet": "Playwright can connect directly to an existing Chromium instance via CDP.",      "publishedAt": "2025-12-23T09:55:22.000Z",      "siteName": "BrowserStack"    }  ]}

Each result has title, url (http or https) and snippet (plain text), and publishedAt (ISO 8601) and siteName when they are known. ms is the time of the whole request, fetched pages included.

Options

FieldDefaultWhat it does
queryrequiredWhat to search for: 1 to 400 characters, at most 75 words. Operators work: "exact words", -word, site:example.com, filetype:pdf.
limit10How many results, 1 to 20. Fewer may come back.
countryUSWhere the results come from: a two-letter code such as DE, GB or JP, or ALL. UK means GB. An unknown country is a 400.
languageenThe language of the results, such as de, fr, pt-br or zh-hans. de-AT becomes de. An unknown language is a 400.
recencynoneOnly pages published or changed in the last "day", "week", "month" or "year".
safeSearch"moderate""off", "moderate" (explicit images and videos are filtered, adult sites may appear) or "strict".
fetchfalsetrue opens the top 3 results, or a number from 0 to 5 opens that many, and returns them as Markdown.
proxynoneA proxy for the pages fetch opens (the search itself never goes through it). Needs fetch.

Every country and language code that works is listed in the API reference.

Read the top pages

With fetch, the top results are also opened like Fetch does: in a real browser inside a sandbox, never by the API itself. Each of those results then has:

  • content: the page as Markdown (links and images absolute, no heading permalinks), or null when it could not be loaded;
  • page: { finalUrl, status, title, captcha, ms }, or null when it failed;
  • error: { code, message } when it failed (page_unreachable, page_timeout, not_a_web_page for a PDF, no_capacity, …), else null.
curl -X POST https://api.boxline.dev/v1/search \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -d '{"query": "playwright connect over cdp", "limit": 5, "fetch": 2}'

One page failing never fails the search. Fetching needs your plan’s quick APIs, and each page counts against the fetch, screenshot and PDF rate limit. A proxy applies to those pages only; without fetch it is a 400.

Cache and allowance

  • The same search (the same words and options) by your project within an hour is answered from memory, with cached: true. It is not sent to the search provider and not counted. Each API server keeps its own cache, and fetched pages are always opened fresh.
  • Every other search counts. Your plan includes searchesPerMonth searches per calendar month (UTC), for all the projects of your organization together. Beyond that, each 1,000 costs extraSearchesPer1000Usd. On a plan without extra searches (Free), the next search is 402 plan_limit until the 1st.
  • The starting allowances are 100 searches a month on Free, 1,000 on Hobby, 10,000 on Startup and 100,000 on Scale, then $5 per 1,000 on the paid plans. GET /v1/pricing has the current numbers in webSearch.byPlan, and GET /v1/project/usage shows searches: { count, costUsd }. See Pricing.
  • Your plan needs web search (webSearch; 402 feature_not_in_plan without it). Every plan has it today.

Errors

StatusCodeWhen
400invalid_requestA value above is out of range, or proxy without fetch.
402plan_limitThis month’s searches are used up, on a plan without extra searches.
402feature_not_in_planYour plan does not include web search (or the quick APIs, for fetch).
429rate_limitedMore than 60 searches a minute for your project. Wait Retry-After seconds.
503search_unavailableSearch is not set up on this server, or the provider did not answer, refused the platform’s key or is limiting the platform. Retry-After says when to try again, when it is known. The SDKs raise SearchUnavailableError, and never repeat a search by themselves.

Privacy

The platform keeps each search’s query text for 30 days, for billing questions and abuse reports. After that it keeps only that a search happened, for 400 days, for invoices.

In the agent and the MCP server

  • AI agent runs have a web_search tool: titles, URLs, snippets and dates, then the agent opens a result in the browser. Each call is a search like POST /v1/search, with the same cache, allowance and billing. See What the agent can do.
  • The MCP server has a web_search tool.

These docs describe a beta API. Endpoints, fields and SDK methods may change before general availability; breaking changes will be listed in the changelog.