Skip to content

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

feat(actions): add scroll

Gergő Móriczd663bbf0cacf
diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts
index 67d66742c..b7ca551b2 100644
--- a/apps/api/src/controllers/v1/types.ts
+++ b/apps/api/src/controllers/v1/types.ts
@@ -78,6 +78,10 @@ export const actionsSchema = z.array(z.union([
type: z.literal("pressKey"),
key: z.string(),
}),
+ z.object({
+ type: z.literal("scroll"),
+ direction: z.enum(["up", "down"]),
+ }),
]));
export const scrapeOptions = z.object({
diff --git a/apps/api/src/lib/entities.ts b/apps/api/src/lib/entities.ts
index 1186583a1..7723f0f26 100644
--- a/apps/api/src/lib/entities.ts
+++ b/apps/api/src/lib/entities.ts
@@ -25,6 +25,9 @@ export type Action = {
} | {
type: "pressKey",
key: string,
+} | {
+ type: "scroll",
+ direction: "up" | "down"
};
export type PageOptions = {
diff --git a/apps/js-sdk/firecrawl/src/index.ts b/apps/js-sdk/firecrawl/src/index.ts
index 23241a5dd..7004d86fd 100644
--- a/apps/js-sdk/firecrawl/src/index.ts
+++ b/apps/js-sdk/firecrawl/src/index.ts
@@ -99,7 +99,10 @@ export type Action = {
} | {
type: "pressKey",
key: string,
-};;
+} | {
+ type: "scroll",
+ direction: "up" | "down",
+};
export interface ScrapeParams<LLMSchema extends zt.ZodSchema = any, ActionsSchema extends (Action[] | undefined) = undefined> extends CrawlScrapeOptions {
extract?: {