Skip to content

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

feat: Screenshot quality (#1721)

Nicolasd8796e453610
diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts
index 3b3a37d13..7ed6c3fab 100644
--- a/apps/api/src/controllers/v1/types.ts
+++ b/apps/api/src/controllers/v1/types.ts
@@ -195,6 +195,7 @@ export const actionSchema = z
z.object({
type: z.literal("screenshot"),
fullPage: z.boolean().default(false),
+ quality: z.number().min(1).max(100).optional(),
}),
z.object({
type: z.literal("write"),
diff --git a/apps/api/src/scraper/scrapeURL/engines/fire-engine/index.ts b/apps/api/src/scraper/scrapeURL/engines/fire-engine/index.ts
index fcd366918..91cea606f 100644
--- a/apps/api/src/scraper/scrapeURL/engines/fire-engine/index.ts
+++ b/apps/api/src/scraper/scrapeURL/engines/fire-engine/index.ts
@@ -194,6 +194,8 @@ export async function scrapeURLWithFireEngineChromeCDP(
{
type: "screenshot" as const,
fullPage: meta.options.formats.includes("screenshot@fullPage"),
+ // Note: If needed to specify quality, do it in the action itself
+ quality: 100
},
]
: []),
diff --git a/apps/js-sdk/firecrawl/src/index.ts b/apps/js-sdk/firecrawl/src/index.ts
index 4c49b99a5..04def686f 100644
--- a/apps/js-sdk/firecrawl/src/index.ts
+++ b/apps/js-sdk/firecrawl/src/index.ts
@@ -138,6 +138,7 @@ export type Action = {
} | {
type: "screenshot",
fullPage?: boolean,
+ quality?: number,
} | {
type: "write",
text: string,
diff --git a/apps/python-sdk/firecrawl/firecrawl.py b/apps/python-sdk/firecrawl/firecrawl.py
index 38ed8ace8..fbd458f8c 100644
--- a/apps/python-sdk/firecrawl/firecrawl.py
+++ b/apps/python-sdk/firecrawl/firecrawl.py
@@ -172,6 +172,7 @@ class ScreenshotAction(pydantic.BaseModel):
"""Screenshot action to perform during scraping."""
type: Literal["screenshot"]
fullPage: Optional[bool] = None
+ quality: Optional[int] = None
class ClickAction(pydantic.BaseModel):
"""Click action to perform during scraping."""