-
Notifications
You must be signed in to change notification settings - Fork 0
API Structure
The API has three main routes:
-
/: Home page -
/search: Main route for interacting with the software and performing web searches -
/docs: Documentation automatically generated by FastAPI
The search endpoint accepts the following input parameters:
| Parameter | Description | Data Type | Notes |
|---|---|---|---|
q |
Search query (required) | String | Userβs search text. Max length: 1900 characters (default: longer input is truncated) |
engines |
Active search engines | String or List | One or more engines from different categories. Default: all engines |
enabled_plugins |
Active plugins | String or List | One or more plugins (both pre and post types). Default: all plugins |
time_range |
Time range filter | String | Expected values: hour, day, week, month, year
|
language |
Filter results by language | String | Language code such as en, ar, etc. |
limit |
Maximum number of results | Integer | Limits the number of returned results |
pageno |
Page number | Integer | Page number of search results (default is 1) |
seafesearch |
Explicit content filter | Integer (0,1,2) | 0: off, 1: moderate, 2: strict |
country |
Filter results by country | String | Country code such as US
|
categories |
Search categories | String | Expected values: general (default), images, videos, news, books, maps, shaping, other
|
api_mode |
API output mode | String | Values: merged (default), normal, stream
|
-
The main search query text entered by the user.
-
Active search engines. Can include one or multiple engines from different categories. Defaults to all engines if not specified.
-
Active plugins including both
preandposttypes. Defaults to all plugins. -
Filters results by time. Valid values:
hour,day,week,month,year -
Filters results by language; expects language codes like
en,ar, etc. -
Limits the maximum number of results returned.
-
Page number of search results; defaults to 1.
-
Explicit content filter levels:
- 0: off
- 1: moderate
- 2: strict
-
Filters results based on the specified country code.
-
Search within specific categories:
general(default),images,videos,news,books,maps,shaping,other -
Different API output modes:
-
merged (default):
Results from all active search engines are merged and the total number of results is limited.
{
"number_of_results": 0,
"results": {
"<index>": {
"title": "str",
"url": "str",
"content": "str",
"engine": ["str"] // or just "str"
}
},
"pre_plugins": {
"<plugin_name>": "Any"
},
"post_plugins": {
"<plugin_name>": "Any"
}
}<index> is a numeric counter from 0 up to x.
- normal: Raw results from each engine are returned separately without merging.
{
"number_of_results": 0,
"results": {
"<engine_name>": {
"results": [
{
"title": "str",
"url": "str",
"content": "str"
}
],
"metadata": {
"page": "int (optional)",
"category": "str (optional)",
"status": "str (optional)"
}
}
},
"pre_plugins": {
"<plugin_name>": "Any"
},
"post_plugins": {
"<plugin_name>": "Any"
}
}- stream: A more dynamic mode where results from each engine are sent separately and incrementally in multiple JSON lines.
Example output:
{"type": "engine_result", "name": "<engine_name>", "result": {"error": "error...", "metadata": {"status": "failed"}}}
{"type": "engine_result", "name": "<engine_name>", "result": {"results": [{"title": "", "url": "", "content": ""},]}}
{"type": "number_of_results", "data": 0}
{"type": "done", "data": "[DONE]"}Each line is a separate JSON object. After all engines send their results, a summary with the number of results and a final done message are sent.
Important Notes
Some parameters may not be supported by all engines. Unsupported values by any engine will be ignored.