From 745d5b6fc506da30b3f275a80497de5d509df540 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 3 Sep 2026 07:52:31 +0200 Subject: [fix] engine: braveapi - braveapi pagination sends an invalid offset (#6627) Closes: https://github.com/searxng/searxng/issues/6545 --- searx/engines/braveapi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/searx/engines/braveapi.py b/searx/engines/braveapi.py index 2efa099d1..767808a0a 100644 --- a/searx/engines/braveapi.py +++ b/searx/engines/braveapi.py @@ -40,7 +40,7 @@ if t.TYPE_CHECKING: about = { "website": "https://api.search.brave.com/", "wikidata_id": None, - "official_api_documentation": "https://api-dashboard.search.brave.com/documentation", + "official_api_documentation": "https://api-dashboard.search.brave.com/api-reference/web/search/get", "use_official_api": True, "require_api_key": True, "results": "JSON", @@ -63,6 +63,8 @@ base_url = "https://api.search.brave.com/res/v1/web/search" time_range_map = {"day": "past_day", "week": "past_week", "month": "past_month", "year": "past_year"} """Mapping of SearXNG time ranges to Brave API time ranges.""" +max_page = 10 + def setup(_: dict[str, t.Any]) -> bool | None: """Initialize the engine.""" @@ -75,7 +77,7 @@ def request(query: str, params: "OnlineParams") -> None: search_args: dict[str, str | int | None] = { "q": query, "count": results_per_page, - "offset": (params["pageno"] - 1) * results_per_page, + "offset": params["pageno"] - 1, "text_decorations": False, } -- cgit v1.2.3