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 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/api/src/search/index.ts b/apps/api/src/search/index.ts index 83d23bc6..5899af87 100644 --- a/apps/api/src/search/index.ts +++ b/apps/api/src/search/index.ts @@ -31,16 +31,6 @@ export async function search({ timeout?: number; }): Promise { try { - if (process.env.SEARCHAPI_API_KEY) { - return await searchapi_search(query, { - num_results, - tbs, - filter, - lang, - country, - location - }); - } if (process.env.SERPER_API_KEY) { return await serper_search(query, { num_results, @@ -51,6 +41,16 @@ export async function search({ location, }); } + if (process.env.SEARCHAPI_API_KEY) { + return await searchapi_search(query, { + num_results, + tbs, + filter, + lang, + country, + location + }); + } return await googleSearch( query, advanced,