Skip to content

Ferret API Reference

Web search engine for AI agents — Open source, production-ready API Version 0.21 — 313+ parsers, 300+ routes

Quickstart

Installation

# Clone and build
git clone https://github.com/duan78/ferret.git
cd ferret
cargo build --release

# Start the server
./target/release/ferret serve
# → http://localhost:9093

# Or start MCP server
./target/release/ferret mcp --port 9094
# → http://localhost:9094/mcp
curl -X POST http://localhost:9093/research \
  -H "Content-Type: application/json" \
  -d '{"query": "AI developments 2026"}'

Python SDK

from ferret import FerretClient

client = FerretClient("http://localhost:9093")

# Search
results = client.search("Who is Leo Messi?")
print(results)

# Research (multi-engine + summary)
report = client.research("AI developments 2026")
print(report["answer"])

# Extract
content = client.extract("https://example.com")
print(content["raw_content"])

API Reference

Base URL: http://localhost:9093

Single search engine:

curl "http://localhost:9093/search/bing?q=web+scraping"

Multi-engine aggregate:

curl "http://localhost:9093/search?q=web+scraping"

Parameters:

ParamTypeDefaultDescription
qstringSearch query (required)
pagecountint5Number of result pages
no_cacheboolfalseBypass cache
formatstringjsonOutput format (json or csv)

Response:

{
  "success": true,
  "items": [
    {
      "title": "Result Title",
      "url": "https://...",
      "snippet": "Description...",
      "source": "bing"
    }
  ],
  "time_ms": 123
}

Available search engines: /search/bing, /search/ddg, /search/brave, /search/yahoo, /search/aol, /search/seznam, /search/baidu, /search/rambler, /search/qwant, /search/startpage, /search/dogpile, /search/you, /search/google

2. Extract

Extract clean content from one or more URLs:

curl "http://localhost:9093/extract?q=https://example.com&include_images=true"

Parameters:

ParamTypeDefaultDescription
qstringURL to extract (required)
include_imagesboolfalseInclude page images
include_raw_contentbooltrueReturn raw text content

Response:

{
  "results": [
    {
      "url": "https://example.com",
      "raw_content": "Page content as plain text...",
      "images": [],
      "favicon": "https://example.com/favicon.ico"
    }
  ],
  "failed_results": [],
  "response_time": "0.02"
}

3. Crawl

Crawl an entire website:

curl "http://localhost:9093/crawl?q=https://docs.ferret.guru"

Crawl multiple URLs:

curl "http://localhost:9093/crawl/v1?q=https://docs.ferret.guru"

Response:

{
  "base_url": "docs.ferret.guru",
  "results": [
    {
      "url": "https://docs.ferret.guru/page",
      "raw_content": "...",
      "favicon": "https://docs.ferret.guru/favicon.ico"
    }
  ],
  "failed_results": [],
  "response_time": "1.23"
}

4. Map

Discover all URLs on a domain without extracting content:

curl "http://localhost:9093/map?q=https://example.com"

Response:

{
  "urls": [
    "https://example.com",
    "https://example.com/about",
    "https://example.com/contact"
  ],
  "total": 3,
  "response_time": "0.35"
}

5. Research

Deep research: multi-engine search with aggregated results and summary:

curl -X POST http://localhost:9093/research \
  -H "Content-Type: application/json" \
  -d '{"query": "AI developments 2026", "max_results": 20}'

Parameters:

ParamTypeDefaultDescription
querystringResearch topic (required)
max_resultsint20Max results to return
modelstringminimini (fast) or pro (deep)
streamboolfalseSSE streaming

Response:

{
  "query": "AI developments 2026",
  "answer": "Summary of findings from 5 search engines...",
  "results": [
    {
      "title": "Article Title",
      "url": "https://...",
      "content": "Snippet...",
      "score": 0.95,
      "source": "bing"
    }
  ],
  "usage": {"searches": 5, "results_total": 42},
  "response_time": "2.34"
}

SDKs

Python

pip install ferret-client
from ferret import FerretClient

client = FerretClient("http://localhost:9093")

# Search
client.search("rust programming", engine="bing")

# Multi-search
client.search_all("rust programming")

# Extract
client.extract("https://example.com")

# Research
client.research("AI 2026")

# Crawl
client.crawl("https://docs.ferret.guru")

JavaScript

npm install ferret-client
import { FerretClient } from 'ferret-client';

const client = new FerretClient('http://localhost:9093');
const results = await client.search('web scraping');

LangChain

from langchain_ferret import FerretSearchTool, FerretResearchTool

tools = [
    FerretSearchTool(),
    FerretResearchTool(),
]

See LangChain Integration.


MCP Server

Ferret exposes a Model Context Protocol (MCP) server compatible with Cursor, Claude Desktop, Claude Code, and OpenAI.

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "ferret-remote": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:9094/mcp"],
      "env": {}
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "ferret-mcp": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:9094/mcp"],
      "env": {}
    }
  }
}

Claude Code

claude mcp add ferret --transport http http://localhost:9094/mcp

Available MCP Tools

ToolDescription
web_searchSearch the web (multi-engine)
web_extractExtract content from URLs
web_crawlCrawl a website
web_researchDeep research with summary
web_suggestSearch suggestions
web_imagesImage search
web_positionSEO position check
web_whoisDomain WHOIS lookup
web_cmsCMS detection
+180 more toolsFrench data, finance, crypto…

Rate Limits

Ferret is self-hosted — there are no rate limits. Your infrastructure, your rules.

EnvironmentRPM
DevelopmentUnlimited
ProductionUnlimited
CrawlUnlimited
ResearchUnlimited

Best Practices

Optimize performance

# Use cache
curl "http://localhost:9093/search/bing?q=rust&no_cache=false"

# Limit results
curl "http://localhost:9093/search/bing?q=rust&pagecount=1"

# Batch multiple queries
curl -X POST http://localhost:9093/batch \
  -H "Content-Type: application/json" \
  -d '[
    {"parser": "bing", "query": "rust"},
    {"parser": "ddg", "query": "web scraping"}
  ]'

Error handling

All endpoints return {"success": true/false, "error": "..."} on failure.


Support