mirror of
https://github.com/firecrawl/firecrawl.git
synced 2026-03-13 08:21:20 +08:00
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:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -13,7 +13,7 @@ export async function search({
|
||||
tbs = undefined,
|
||||
filter = undefined,
|
||||
lang = "en",
|
||||
country = "us",
|
||||
country,
|
||||
location = undefined,
|
||||
proxy = undefined,
|
||||
sleep_interval = 0,
|
||||
|
||||
Reference in New Issue
Block a user