fix(search): fix geo-targeting params not being applied correctly

Two bugs fixed:

1. Remove hardcoded country="us" default in search() that overrode the
   schema transform's intentional undefined when location is provided
   without country. The schema already defaults country to "us" when
   neither country nor location is set — the search function's
   destructuring default was silently overriding the location-only case
   back to "us".

2. Add missing filter parameter to Fire Engine search payloads (v1, v2,
   and map). The filter param was accepted in the function signature but
   never included in the payload sent to Fire Engine.

Co-Authored-By: devhims <himanshu@sideguide.dev>
This commit is contained in:
firecrawl-spring[bot]
2026-03-10 17:42:40 +00:00
parent 4baaa1d1a7
commit efefd43c85
3 changed files with 4 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ export async function fire_engine_search(
country: options.country,
location: options.location,
tbs: options.tbs,
filter: options.filter,
numResults: options.numResults,
page: options.page ?? 1,
};
@@ -77,6 +78,7 @@ export async function fireEngineMap(
country: options.country,
location: options.location,
tbs: options.tbs,
filter: options.filter,
numResults: options.numResults,
page: options.page ?? 1,
};

View File

@@ -65,6 +65,7 @@ export async function fire_engine_search_v2(
country: options.country,
location: options.location,
tbs: options.tbs,
filter: options.filter,
numResults: options.numResults,
page: options.page ?? 1,
type: options.type || "web",

View File

@@ -13,7 +13,7 @@ export async function search({
tbs = undefined,
filter = undefined,
lang = "en",
country = "us",
country,
location = undefined,
proxy = undefined,
sleep_interval = 0,