From b9e732bdd54b6a37263ec67eb6adf7d6715e1c48 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 7 Nov 2024 14:55:06 -0500 Subject: [PATCH] Update index.ts --- apps/api/src/search/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/api/src/search/index.ts b/apps/api/src/search/index.ts index 83d23bc61..5899af87d 100644 --- a/apps/api/src/search/index.ts +++ b/apps/api/src/search/index.ts @@ -31,24 +31,24 @@ export async function search({ timeout?: number; }): Promise { try { - if (process.env.SEARCHAPI_API_KEY) { - return await searchapi_search(query, { + if (process.env.SERPER_API_KEY) { + return await serper_search(query, { num_results, tbs, filter, lang, country, - location + location, }); } - if (process.env.SERPER_API_KEY) { - return await serper_search(query, { + if (process.env.SEARCHAPI_API_KEY) { + return await searchapi_search(query, { num_results, tbs, filter, lang, country, - location, + location }); } return await googleSearch(