SearXNG
Point a SearXNG instance URL at Search1API to keep using SearXNG's JSON search API, engine selection and categories without running an instance.
Search1API answers SearXNG's JSON search API. Replace the address of your SearXNG instance with:
https://api.search1api.com/compat/searxng/YOUR_API_KEYClients append /search to this address, or call it directly; both work. GET with query parameters and POST with a form body are accepted.
The URL contains your API key
SearXNG clients cannot send an authentication header, so the key is part of the URL. Treat the whole URL as a secret. Search1API masks the key in its own logs. Create a separate key in the dashboard for this URL so you can revoke it on its own.
Configure your client
In Admin Settings → Web Search, choose searxng and set Searxng Query URL, or set the environment variable:
SEARXNG_QUERY_URL="https://api.search1api.com/compat/searxng/YOUR_API_KEY/search?q=<query>"SEARXNG_API_URL="https://api.search1api.com/compat/searxng/YOUR_API_KEY"RETRIEVER=searx
SEARX_URL="https://api.search1api.com/compat/searxng/YOUR_API_KEY"from langchain_community.utilities import SearxSearchWrapper
search = SearxSearchWrapper(
searx_host="https://api.search1api.com/compat/searxng/YOUR_API_KEY"
)
results = search.results("hono cloudflare workers", num_results=5)Or call it directly:
curl "https://api.search1api.com/compat/searxng/YOUR_API_KEY/search?q=hono+workers&format=json"Parameters
| Parameter | Behavior |
|---|---|
q | The query. Leading !go-style engine bangs, !news-style category bangs and :de-style language prefixes are applied, as in SearXNG. |
format | json or omitted. Other formats return 400. |
engines | Comma-separated SearXNG engine names; see the table below. |
categories | Used when engines is not given: general, news, images, videos (YouTube), science (arXiv) and it (GitHub). Other categories search the web. |
language | en, en-US and similar codes use the primary language. all and auto mean no filter. |
time_range | day, week, month or year. |
pageno | Result page, 10 results per engine. See Result pages. |
Other parameters, such as safesearch, theme and image_proxy, are ignored.
Engines
| SearXNG engine | Bang | Searches |
|---|---|---|
google, bing, duckduckgo, yahoo, yandex, baidu, 360search, quark | !go, !bi, !ddg, !yh, !yd, !bd, !360so, !qk | The same engine |
wikipedia, grokipedia | !wp, !gp | The same source |
youtube, bilibili, imdb | !yt, !bil, !imdb | The same source |
github, arxiv, reddit | !gh, !arx | The same source |
sogou wechat | !sogouw | WeChat articles |
google news, bing news, yahoo news, duckduckgo news, hackernews, reuters | !gon, !bin, !yhn, !ddn, !hn, !reu | News from the same source |
google images, bing images, duckduckgo images | !goi, !bii, !ddi | Images from the same engine |
When engines lists names that are not in this table, they appear in unresponsive_engines with the reason engine not supported. If none of the listed engines is supported, the request falls back to categories, or to a web search.
Credits
Each engine searched costs 1 credit, the price of a native search. A request without engines searches one default engine for each category and costs 1 credit per category. Engines that cannot serve the requested page are skipped and not charged.
Response
The response has SearXNG's JSON shape: query, number_of_results, results, answers, corrections, infoboxes, suggestions and unresponsive_engines.
- Results from several engines are merged. A URL found by more than one engine appears once, with every engine in
enginesand its ranks inpositions. scoreis calculated with SearXNG's formula from those ranks, so clients that sort by score keep working.- Each result has
url,title,content,engine,engines,positions,score,category,template,parsed_urlandpublishedDate. - Image results also have
img_srcandthumbnail_src. Theirurlis the image URL, not the page it appears on. number_of_resultsis always0, andanswers,corrections,infoboxesandsuggestionsare always empty.
Errors
Errors return { "error": "message" } with the status code. When every selected engine fails, the request returns the most relevant error, such as 401 for an invalid key or 429 for the rate limit. When only some engines fail, the request succeeds and lists them in unresponsive_engines.