Searxng API icon

Searxng API

Consume Searxng API

Search

AI-generated

Overview

This node integrates with the Searxng API to perform web searches. It allows users to send search queries and retrieve results in various formats such as JSON, HTML, CSV, or RSS. The node supports both GET and POST HTTP methods for making requests.

Typical use cases include:

  • Automating web search queries within workflows.
  • Filtering search results by categories, language, time range, and safe search levels.
  • Retrieving search results formatted specifically for large language models (LLMs).
  • Paginating through search results by specifying page numbers.

For example, a user can input a query like "latest technology news," specify categories such as "news" and "IT," set the language to English, and get back JSON-formatted search results limited to 10 items.

Properties

Name Meaning
Method HTTP method used to retrieve results: GET or POST.
Query The search query string to use. This is required.
Max Results Maximum number of results to return (only applies when format is JSON). Default is 0, meaning unlimited. Valid range is 0 to 1000.
Additional Fields A collection of optional parameters to refine the search:
- Categories Categories to search in. Options include: Files, General, Images, IT, Maps, Music, News, Science, Social Media, Videos. Default is General.
- Format Format of the results returned. Options: HTML, JSON, CSV, RSS. Default is JSON.
- Language Language filter for results. Many language options are available including automatic detection.
- LLM Mode Boolean flag to format results for Large Language Models. Only applicable if format is JSON.
- Page Number Page number of results to retrieve. Default is 1.
- Safe Search Level of safe search filtering: Off (0), Moderate (1), Strict (2). Default is Off.
- Time Range Time range filter for results: Anytime, Past 24 Hours, Past Month, Past Year. Default is Anytime.

Output

The node outputs an array of items where each item's json property contains the search results from the Searxng API.

  • When the format is JSON, the output includes a results array with individual search result objects containing fields such as title, url, content, snippet, and tags.
  • If the "LLM Mode" is enabled, each result is simplified to only include title, url, content, snippet, and tags fields, optimized for consumption by language models.
  • For other formats (HTML, CSV, RSS), the raw response content is returned as-is.
  • Binary data output is not supported by this node.

Dependencies

  • Requires an API key credential for authenticating with the Searxng API.
  • The base URL for the Searxng instance must be configured in the credentials.
  • Uses the form-data package internally for POST requests.
  • Requires network access to the specified Searxng API endpoint.

Troubleshooting

  • Missing Credentials Error: If no API credentials are provided, the node throws an error prompting to configure the Searxng API credentials.
  • Missing Query Parameter: The node requires a non-empty search query; otherwise, it throws an error indicating the query parameter is required.
  • Unsupported Operation: Only the "search" operation is supported. Using any other operation value will cause an error.
  • API Request Failures: Network issues, invalid API keys, or incorrect base URLs may cause request failures. Verify credentials and endpoint configuration.
  • Result Parsing Errors: If the API returns a non-JSON response when JSON is expected, parsing errors might occur. Check the format setting and API response.
  • Max Results Limit: Setting max results above 1000 is not allowed and will be constrained by the node.

Links and References

Discussion