Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pratyay360/searchapi/llms.txt

Use this file to discover all available pages before exploring further.

SearchAPI is a self-hostable REST service that returns structured search results over HTTP. This guide walks you through getting the server running and making your first request. You do not need an API key or an account — the service uses DuckDuckGo’s meta-search library under the hood.

Run SearchAPI

1

Start the server

Choose the method that matches your environment.
git clone https://github.com/Pratyay360/search-api.git
cd search-api
uv sync
uv fastapi run
The server starts on port 8000 in all cases.
2

Verify the server is healthy

Confirm the service is running by calling the health endpoint.
curl http://localhost:8000/health
You should receive:
{"status": "ok"}
3

Make your first search call

Call the general web search endpoint with a query and a result limit.
curl "http://localhost:8000/search/?query=machine+learning&limit=5"
Parameters
query
string
required
The search query string.
limit
number
required
Maximum number of URLs to return.
Example response
[
  "https://en.wikipedia.org/wiki/Machine_learning",
  "https://developers.google.com/machine-learning/crash-course",
  "https://www.coursera.org/specializations/machine-learning-introduction",
  "https://scikit-learn.org/stable/",
  "https://pytorch.org/tutorials/"
]
The response is a JSON array of URLs ranked by relevance. You can pipe this output directly into a dataset pipeline or downstream processing script.

Response structure

All search endpoints return a JSON array of strings. Each string is a URL (or a DOI for the /search/paper endpoint).
[]
string[]
An ordered list of result URLs. The length is bounded by the limit parameter you supply.

What to try next

All endpoints

Browse every endpoint — papers, PDFs, books, news, repositories, and more.

Deployment options

Deploy to Render, Docker, or Podman for production use.

MCP server

Connect SearchAPI directly to Claude or Cursor via MCP.

Dataset generation

Strategies for building LLM training datasets with SearchAPI.
SearchAPI is intended for educational and research use. You are responsible for complying with the terms of service of any upstream search engine and applicable laws in your jurisdiction.

Build docs developers (and LLMs) love