diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2026-09-03 07:52:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-03 07:52:31 +0200 |
| commit | 745d5b6fc506da30b3f275a80497de5d509df540 (patch) | |
| tree | 18148d1cb3096b60f31d74bdf5120efa3672587b /searx/engines/braveapi.py | |
| parent | 05cd77f71b466b7674658429d834a8db3b26811f (diff) | |
[fix] engine: braveapi - braveapi pagination sends an invalid offset (#6627)
Closes: https://github.com/searxng/searxng/issues/6545
Diffstat (limited to 'searx/engines/braveapi.py')
| -rw-r--r-- | searx/engines/braveapi.py | 6 |
1 files 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, } |
