Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nickscamara committed Nov 7, 2024
1 parent ec0542e commit b9e732b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/api/src/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ export async function search({
timeout?: number;
}): Promise<SearchResult[]> {
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(
Expand Down

0 comments on commit b9e732b

Please sign in to comment.