AgentSearch API Documentation

Build powerful AI applications with our search API

Overview

Two endpoints give your agent the live web: Search finds the pages, Fetch reads one of them.

One call to our web index gathers the pages for a query, and the results come back scored, sorted and rendered as Markdown. Reading a page is a separate action, done on our own servers, so it carries no per-page fee.

Base URL

https://agentsearch.tech/v1

Every endpoint is also mounted under /api/v1 - /v1/search and /api/v1/search are the same endpoint.

📌 Image search

The search we run does not support image search yet, so neither do we. Text search, and fetching a page that happens to contain images, are unaffected.

Authentication

All API requests require authentication using an API key. You can generate API keys in your dashboard.

Example Request

curl -X POST "https://agentsearch.tech/v1/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "hello"}'

Search Syntax

The query is passed to the search service as it is, so the search syntax works inside it. Operators can be combined in one query.

Operator Example What it does
site:search api site:github.comRestrict the results to a site. Several sites are joined with OR: site:github.com OR site:huggingface.co.
-site:search api -site:example.comExclude a site.
-search api -adsExclude pages containing the word.
-"..."search api -"release notes"Exclude pages containing the phrase.
"..."search api "exact phrase"Match the phrase exactly.
lang:search api lang:zh,enRestrict the results to a language.
after:search api after:2025-01-01Only pages published after the date.
before:search api before:2026-06-01Only pages published before the date.
curl -X POST "https://agentsearch.tech/v1/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "search api site:github.com OR site:huggingface.co lang:en after:2025", "limit": 10}'

Fetch API

Read one page and get its text. The page is fetched by us - not by the search - and the call is counted against the fetch allowance, which is separate from the search allowance.

Endpoint

POST /v1/fetch

Request Body

Parameter Type Description
urlstringThe page to read (required)
max_charsintegerHow much text to return (200-100000, default: 20000)

Only public addresses are fetched: a URL that resolves to a private or loopback address is refused.

Example Request

curl -X POST "https://agentsearch.tech/v1/fetch" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/article"}'

Limits

  • At most 2 MB of the page body is read; a bigger page is truncated and truncated says so.
  • One page may take up to 15 seconds.
  • Up to 5 redirects are followed, and every hop is checked against the same public-address rule.
  • The page text is returned in text - not content, which is the search endpoint's field.

💚 No per-page fee

The page is read on our own servers, so reading a page carries no per-page fee and is not billed per page. It is only counted against your fetch allowance.

Response Format

Every response is a flat JSON object. There is no data envelope and no code field: a successful call is HTTP 200 with the body below, and a failed one is an HTTP error with a detail string.

Search response

{
  "query_id": "search_e6bb86e4b7ed",
  "intent": "tech",
  "results": [
    {
      "title": "Page title",
      "url": "https://example.com/page",
      "content": "The summary of the page, or its full body when need_content is true.",
      "snippet": "The first 300 characters of the content.",
      "source": "web",
      "quality_score": 0.89,
      "published_date": "2026-06-01T00:00:00+00:00",
      "author": null,
      "authority": 3,
      "rerank_score": 2.4,
      "site_name": "Example News"
    }
  ],
  "total_results": 5,
  "structured_markdown": "# Search Results for: ...\n\n...",
  "total_tokens": 2117,
  "latency_ms": 443,
  "cached": false,
  "sources_used": ["web"],
  "unavailable_sources": []
}
Field What it is
query_idIdentifier of this search, for your own logging.
intentHow the query was classified: news, tech, finance, academic or general.
resultsThe pages that were found, best first.
total_resultsHow many results were found.
structured_markdownThe same results rendered as Markdown, ready to drop into a prompt.
total_tokensThe size of the text you received, estimated in tokens. It is what the results cost you to read - the search calls no language model.
latency_msHow long the call took, in milliseconds.
cachedTrue when the answer came from our cache.
sources_usedWhich source served the search. Always "web".
unavailable_sourcesSources that could not be used. Empty for a web search.

Per result

Field What it is
quality_scoreOur own score, 0 to 1. It combines the search engine's authority rating and ranking with the relevance, recency and completeness of the page.
authorityThe search engine's own authority rating, 0 to 4 (-1 when unknown). 3 or more is a highly authoritative page.
rerank_scoreThe search engine's own ranking, 0 to 3. 1.5 or more marks a strong result.
published_dateThe publication date in UTC (RFC 3339), or null when the source does not know it. It is a field of its own - nothing has to be parsed out of the text.
site_nameThe name of the site the page came from, when the engine knows it.

📅 Publication dates

The date is the published_date field, in UTC. It is null when the engine has no date for the page - not a string with a date glued onto the content.

Fetch response

{
  "url": "https://example.com/article",
  "requested_url": "https://example.com/article",
  "status": 200,
  "content_type": "text/html",
  "title": "Example article",
  "text": "The readable text of the page.",
  "bytes": 17089,
  "truncated": false,
  "latency_ms": 876,
  "fetches_used": 1,
  "fetch_limit": 20
}

⚠️ Timeout and retry

A search may take up to 30 seconds before it is given up on, and the call then answers 504. Retry a 504, a 429 or a 502 after a short pause. Do not retry a 400 or a 422 unchanged - the request itself is wrong and will fail the same way.

Error Codes

An error answers with a JSON body carrying a detail string that says what went wrong: {"detail": "..."}

HTTP Code Meaning
400The request was rejected - a field is invalid. The detail names the field.
401The API key is missing, invalid or expired.
402Your plan does not include this action at all - there is no search or fetch allowance on it. Going over the allowance is not this error: an overage is served and priced.
422The body does not validate - a missing query, a limit outside 1-50, a query longer than 128 characters.
429Rate limit exceeded. Back off and retry.
502The search backend failed or answered something unusable. Retry.
503The search backend is not available or not configured. This one is ours to fix, not yours.
504The search did not answer in time. Retry.

Rate Limits

Search and Fetch are two separate meters. The allowance below is what each plan includes per period, and the request rate is the maximum number of requests per second:

  • Free: 100 searches + 20 fetches per month, 2 requests/second
  • Pro ($9/month): 3,000 searches + 1,000 fetches per month, 20 requests/second
  • Team ($79/month): 30,000 searches + 10,000 fetches per month, 50 requests/second

Calls beyond the allowance are counted and priced at $2.5 per 1000 - Search and Fetch are priced separately - and the request is still served: an overage never interrupts a call.

Billing

A search is billed per successful call - not per token, and not per result. The number of results you ask for does not change what a call costs.

  • limit: 1 and limit: 50 cost the same.
  • A search that fails or finds nothing is not billed.
  • Fetching a page is billed separately, and carries no per-page fee.
  • Reading a page does not use up the search allowance, and a search does not use up the fetch one.

The plans and what they include are on the pricing page.

AI Agent Integration

Add AgentSearch to your AI agent system prompt for web search capabilities.

Skill URL

https://agentsearch.tech/v1/search/mcp-skill

Add to System Prompt

## AgentSearch API Access

Base URL: https://agentsearch.tech/v1

Authentication: Bearer Token
Token: YOUR_API_KEY

Example curl command:
curl -X POST "https://agentsearch.tech/v1/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "your search query here", "limit": 10}'

API Endpoints:
• POST /v1/search - Search the web. Body: {"query": "...", "limit": 10, "need_content": false}
• POST /v1/search/stream - The same search, as an SSE stream
• POST /v1/fetch - Read one page and return its text. Body: {"url": "https://..."}
• GET  /v1/search/sources - The source the search gathers from ("web")
• GET  /v1/usage/ - How much of your allowance is left
• POST /v1/mcp - MCP (JSON-RPC): agentsearch_search, agentsearch_fetch,
  agentsearch_classify_intent, agentsearch_list_sources

Notes:
• Search and Fetch are two separate allowances: reading a page does not
  use up the search allowance, and a search does not use up the fetch one.
• The query accepts the search syntax: site:, -site:, -, -"...", "...",
  lang:, after:, before:.

MCP

The same two tools are served over MCP (JSON-RPC) on the same key:

POST https://agentsearch.tech/v1/mcp

Tools: agentsearch_search, agentsearch_fetch, agentsearch_classify_intent, agentsearch_list_sources.

Claude Code Skill

For Claude Code agents, the Claude Code setup page generates the skill file and the commands to install it.

~/.claude/skills/agentsearch/skill.json