DOCS
API reference
Gyaansetu has two endpoints: Search turns a Query into ranked Results from the open web, and Extract turns URLs you already have into clean Raw Content. Both take and return JSON.
API tools can read the OpenAPI 3.1 description.
Base URL and authentication
Send every request to this base URL:
https://web-search.gyaansetu.comAuthenticate with an API Key from your dashboard, sent as a bearer token. A missing or invalid API Key gets 401. An Account can hold up to five API Keys.
curl https://web-search.gyaansetu.com/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "Who deciphered Linear B?"}'Search: POST /search
Turns a Query into a list of Results, each a web page with its Content and a Score from 0 to 1 for how relevant it is to the Query. Results are ordered by Score, highest first.
| Field | Meaning |
|---|---|
query | Required. The text to search for. |
max_results | 0 to 20 (default 10): how many Results to return. |
search_depth | basic (default) or advanced; see Search Depth below. fast and ultra-fast run as basic. |
chunks_per_source | 1 to 3 (default 3): how many passages make up an advanced Result's Content. |
include_raw_content | true or markdown adds each page's cleaned main content as raw_content in markdown; text as plain text. Works at either Search Depth. A page that fails to load has raw_content: null at basic. |
topic | general (default) or news. finance runs as general. |
time_range | day, week, month or year (or d, w, m, y). |
start_date, end_date | YYYY-MM-DD, best effort: Results dated outside the range are dropped; undated Results are kept. |
include_images | Adds image URLs to images (at most max_results). |
include_domains, exclude_domains | Lists of domains to keep (up to 300) or drop (up to 150). A domain covers its subdomains. |
language | An ISO 639-1 code or English name, such as fr or French. |
include_usage | Adds "usage": {"credits": n}, the Credits the request cost. |
Other fields are accepted and ignored.
Search Depth
basicis fast and costs 1 Credit. Each Result's Content is the snippet the search index returned, and its Score comes from its rank.advancedcosts 2 Credits. It reads each page, splits it into passages, and ranks them against the Query with a reranking model. A Result's Content is its bestchunks_per_sourcepassages in page order, joined with[...], and its Score is its best passage's score. Pages that fail to load are replaced by spare Results rather than leaving the Search short.
Response
An example:
{
"query": "Who deciphered Linear B?",
"answer": null,
"images": [],
"results": [
{
"title": "Linear B - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Linear_B",
"content": "Linear B was deciphered in 1952 by English architect and self-taught linguist Michael Ventris based on the research of the American classicist Alice Kober. It is the only Bronze Age Aegean script to have been deciphered, with Linear A, Cypro-Minoan, and Cretan hieroglyphic remaining unreadable.",
"score": 0.9977,
"raw_content": null,
"published_date": null
}
],
"response_time": 1.84,
"request_id": "…"
}contentis the Result's Content: the passages most relevant to the Query.raw_contentis the page's Raw Content, its full cleaned text, wheninclude_raw_contentasks for it, andnullotherwise.answeris alwaysnull;imagesandresultsare always lists.- A Search that finds nothing returns
200withresults: []. If the search service itself fails, the Search gets a500instead, so an agent can tell "nothing found" from "try again".
Extract: POST /extract
Turns URLs you already have into their Raw Content: the page's main content, with navigation, footers, scripts, popups, hidden elements and diagram source removed. Code blocks are kept.
| Field | Meaning |
|---|---|
urls | Required. One URL, or a list of 1 to 20. |
extract_depth | basic (default) reads each page as the site serves it; advanced renders it in a real browser first, so pages built by JavaScript come out complete. |
format | markdown (default) or text. |
timeout | Seconds each page may take to load, 1 to 60 (default 10 at basic, 30 at advanced). |
query | Cuts each page's raw_content to its passages most relevant to the query, ranked as in an advanced Search. |
chunks_per_source | 1 to 5 (default 3): how many passages each page is cut to. Ignored without a query. |
include_usage | Adds "usage": {"credits": n}, the Credits the request cost. |
Response
An example:
{
"results": [
{ "url": "https://en.wikipedia.org/wiki/Linear_B", "raw_content": "# Linear B\n\n…", "images": [] }
],
"failed_results": [
{ "url": "https://example.com/missing", "error": "…" }
],
"response_time": 0.92,
"request_id": "…"
}A URL that fails (an invalid URL, a timeout, an HTTP error, a response that isn't HTML, a page that fails to render, or a page with nothing left after cleanup) is listed in failed_results with its error, and the rest of the Extract still succeeds. results, failed_results and each result's images are always lists; images is always empty. Cleaned pages are cached for 24 hours.
Credits and pricing
Every Account has a free Quota of 1,000 Credits a month, shared by all its API Keys. It refills on the 1st of every month (UTC).
| Request | Cost |
|---|---|
A basic Search | 1 Credit |
An advanced Search | 2 Credits |
| An Extract | 1 Credit per 5 URLs extracted successfully, rounded up per request (7 cost 2) |
You are charged after the work, for what it actually cost: a Search with no Results, an Extract where every URL failed, a bad request and a server error cost nothing. Your dashboard shows this month's usage.
Credit Packs
When the Quota isn't enough, buy a Credit Pack on your dashboard. It is a one-time purchase that adds Credits to your Account's Credit Balance; there is no subscription.
| Credit Pack | Price |
|---|---|
| 5,000 Credits | $10 |
| 25,000 Credits | $40 |
| 100,000 Credits | $120 |
Prices are in US dollars and include any tax where you live. Dodo Payments sells the packs as the merchant of record, at its hosted checkout, which may show the price in your currency. The Credits land once Dodo confirms the payment.
- Spending order. Requests spend the Quota first, then the Credit Balance. A request that crosses from one to the other takes what is left of the Quota and the rest from the Credit Balance.
- No expiry. Purchased Credits never expire; the Credit Balance carries over from month to month.
- A higher rate limit. While the Credit Balance is above zero, the rate limit is 300 requests a minute instead of 60.
- Refunds. An unused Credit Pack is refundable within 14 days of buying it: ask support through the Contact page. A refund or a chargeback removes the pack's Credits, and a chargeback can take the Credit Balance below zero, which can't be spent. The Terms cover payments in full.
The Quota and the Credit Balance are checked before any work. Once both are used up, requests get 432 until the Quota refills or you buy more Credits. Requests made at the same moment near the end of either may overshoot it slightly.
Rate limit
Each Account can make 60 requests a minute, across all its API Keys, or 300 a minute while its Credit Balance is above zero. The API, the Playground and MCP share the limit. Past it, requests get 429 with a Retry-After header in seconds.
Errors
Every error has the same body:
{"detail": {"error": "<message>"}}| Status | Meaning |
|---|---|
| 400 | Bad request: a field is missing or invalid. The message says which. |
| 401 | Missing or invalid API Key. |
| 404 | Unknown path. |
| 429 | Rate limit reached. Wait for Retry-After seconds. |
| 432 | Quota and Credit Balance used up. The Quota refills on the 1st (UTC). |
| 500 | Server error. Safe to retry. |
Connect over MCP
MCP clients connect to https://web-search.gyaansetu.com/mcp. Send your Gyaansetu API Key as an Authorization: Bearer header; this is the recommended option because the key stays out of the URL. Clients that cannot set headers can send the key as ?apiKey=YOUR_GYAANSETU_API_KEY instead. A missing or invalid key gets HTTP 401 before the MCP handshake.
Tools and results
The server exposes gyaansetu_search and gyaansetu_extract. They take the same inputs as /search and /extract and run the same Search and Extract pipelines. MCP Search defaults to 5 Results, while HTTP Search defaults to 10. MCP returns text rather than JSON: each Result's Title, URL and Content, plus Raw Content and image URLs when asked for. It has no Answer: section. Extract returns each successful URL with its Raw Content and lists failed URLs with their errors. Inputs Gyaansetu cannot honour, including country, exact_match and include_favicon, are accepted and ignored.
Account Tools
Six more tools let an agent read what the Account sees on its dashboard. They are read-only, act for the Account whose API Key you send, and never return an API Key's secret. No tool creates, renames or revokes a key.
gyaansetu_usage: Credits and requests per UTC day and Channel. Takesstart_dateandend_date(YYYY-MM-DD, inclusive; the last 30 days by default, at most 366 days).gyaansetu_credits: the monthly Quota, Free Credits, Credit Balance and Available Credits.gyaansetu_refusals: requests turned away, counted per day and reason. Takesdays(1 to 90, default 30).gyaansetu_purchases: Credit Pack purchases, newest first. Takeslimit(1 to 100, default 20);moresays whether older ones were left out.gyaansetu_api_keys: API Keys by name, prefix (null for keys made before prefixes were recorded), created and last used.gyaansetu_buy_credits: the link where the Account's owner buys a Credit Pack, the packs on offer, and whether they are on sale.
Credits, Quota and rate limit
MCP tool calls share the Account's Credits, monthly Quota and rate limit (60 requests a minute, or 300 with a Credit Balance) with HTTP and the Playground. Search and Extract cost the same as their HTTP equivalents; the Account Tools cost no Credits but count toward the rate limit. Only tool calls count; initialize and tools/list require a valid API Key but do not count toward usage or the rate limit. Invalid tool inputs, a used-up Quota and the rate limit return tool errors with the same messages as the HTTP errors.
Claude Code and Cursor
Replace the placeholder with an API Key from your dashboard.
Claude Code
claude mcp add --transport http gyaansetu https://web-search.gyaansetu.com/mcp \
--header "Authorization: Bearer YOUR_GYAANSETU_API_KEY"Cursor
{
"mcpServers": {
"gyaansetu": {
"url": "https://web-search.gyaansetu.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_GYAANSETU_API_KEY"
}
}
}
}Migrating from another agent search SDK
Gyaansetu's API is compatible with Tavily's: it answers the same /search and /extract requests in the same response shape. If your agent already uses Tavily's Python SDK, its JavaScript SDK or LangChain's Tavily tool, keep your code: use a Gyaansetu API Key and add one line that sets the base URL.
Python
$ pip install tavily-pythonfrom tavily import TavilyClient client = TavilyClient( api_key="YOUR_GYAANSETU_API_KEY", api_base_url="https://web-search.gyaansetu.com",)JavaScript
$ npm install @tavily/coreimport { tavily } from "@tavily/core"; const client = tavily({ apiKey: "YOUR_GYAANSETU_API_KEY", apiBaseURL: "https://web-search.gyaansetu.com",});LangChain
$ pip install langchain-tavilyfrom langchain_tavily import TavilySearch search = TavilySearch( max_results=5, tavily_api_key="YOUR_GYAANSETU_API_KEY", api_base_url="https://web-search.gyaansetu.com",)Tavily's Python SDK raises Gyaansetu's 432 (Quota used up) as ForbiddenError. Over MCP, point your client at https://web-search.gyaansetu.com/mcp and call gyaansetu_search and gyaansetu_extract.
Guides
Step-by-step help for common integrations.