Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

search tracking: scrape formats track (#3301)

Thomas Kosmas55751dac74fc
diff --git a/apps/api/src/lib/search-tracking.ts b/apps/api/src/lib/search-tracking.ts
index 969fabc9a..092cd082a 100644
--- a/apps/api/src/lib/search-tracking.ts
+++ b/apps/api/src/lib/search-tracking.ts
@@ -46,6 +46,7 @@ interface TrackSearchParams {
teamId: string;
response: SearchV2Response;
zeroDataRetention: boolean;
+ hasScrapeFormats: boolean;
}
export async function trackSearchResults(
@@ -67,6 +68,7 @@ export async function trackSearchResults(
url_domain: extractDomain(url),
result_type: type,
result_index: index,
+ has_scrape_formats: opts.hasScrapeFormats,
created_at,
})),
);
diff --git a/apps/api/src/search/execute.ts b/apps/api/src/search/execute.ts
index 4e7d2221c..d0b4629cc 100644
--- a/apps/api/src/search/execute.ts
+++ b/apps/api/src/search/execute.ts
@@ -180,6 +180,7 @@ export async function executeSearch(
teamId,
response: searchResponse,
zeroDataRetention: zeroDataRetention ?? false,
+ hasScrapeFormats: shouldScrape ?? false,
}).catch(err => logger.warn("Search tracking failed", { error: err }));
return {