Skip to content

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

Nick: making it optional for the user

Nicolas4332f18a8fc7
diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts
index 5f3889208..99c3aa6fc 100644
--- a/apps/api/src/controllers/v1/types.ts
+++ b/apps/api/src/controllers/v1/types.ts
@@ -199,6 +199,7 @@ export const extractV1Options = z
includeSubdomains: z.boolean().default(true),
allowExternalLinks: z.boolean().default(false),
origin: z.string().optional().default("api"),
+ urlTrace: z.boolean().default(false),
timeout: z.number().int().positive().finite().safe().default(60000),
})
.strict(strictMessage);
diff --git a/apps/api/src/lib/extract/extraction-service.ts b/apps/api/src/lib/extract/extraction-service.ts
index 1cf47f866..f84a1f34b 100644
--- a/apps/api/src/lib/extract/extraction-service.ts
+++ b/apps/api/src/lib/extract/extraction-service.ts
@@ -20,7 +20,7 @@ interface ExtractResult {
data?: any;
scrapeId: string;
warning?: string;
- urlTrace: URLTrace[];
+ urlTrace?: URLTrace[];
error?: string;
}
@@ -140,6 +140,6 @@ export async function performExtraction(options: ExtractServiceOptions): Promise
data: completions.extract ?? {},
scrapeId,
warning: completions.warning,
- urlTrace: urlTraces,
+ urlTrace: request.urlTrace ? urlTraces : undefined,
};
}
\ No newline at end of file