Skip to content

feat: Complete API overhaul matching Scrappey documentation#63

Open
pim97 wants to merge 2 commits into
Automations-Project:mainfrom
pim97:main
Open

feat: Complete API overhaul matching Scrappey documentation#63
pim97 wants to merge 2 commits into
Automations-Project:mainfrom
pim97:main

Conversation

@pim97
Copy link
Copy Markdown

@pim97 pim97 commented Jan 7, 2026

This major update brings complete API coverage:

Session Management:

  • sessions.create - Create persistent browser sessions
  • sessions.destroy - Destroy sessions
  • sessions.list - List active sessions
  • sessions.active - Check session status
  • websocket.create - Create WebSocket connections

Browser Actions (20+ types):

  • click, type, goto, wait, scroll, hover
  • wait_for_selector, wait_for_function, wait_for_load_state
  • wait_for_cookie, execute_js, keyboard, dropdown
  • switch_iframe, set_viewport, if/while conditionals
  • solve_captcha (15 captcha types), discord_login, remove_iframes

Antibot Bypass Options:

  • cloudflareBypass, datadomeBypass, kasadaBypass
  • disableAntiBot, detectIncapsula, spsnspidChallenge

Captcha Solving:

  • automaticallySolveCaptchas, alwaysLoad (multi-select)
  • Support for turnstile, recaptcha, hcaptcha, funcaptcha, etc.

Response Options:

  • screenshot, screenshotUpload, screenshotWidth/Height
  • pdf, base64, base64Response, binary
  • innerText, includeImages, includeLinks
  • regex extraction, filter fields, listAllRedirects

Request Interception:

  • abortOnDetection, abortOnPostRequest
  • blackListedDomains, neverCacheDomains
  • dontLoadMainSite, dontLoadFirstRequest

Browser Configuration:

  • browser type/version, userAgent, locales
  • forceUniqueFingerprint, webrtcIpv4/Ipv6

Advanced Options:

  • localStorage, cookiejar, fullPageLoad
  • waitForUrl, removeIframes, blockCookieBanners
  • AI parsing with autoparse, structure, model

Error Handling:

  • Added missing CODE-0038 (FingerprintJS challenge)

BREAKING CHANGE: Major API expansion with new operations

This major update brings complete API coverage:

Session Management:
- sessions.create - Create persistent browser sessions
- sessions.destroy - Destroy sessions
- sessions.list - List active sessions
- sessions.active - Check session status
- websocket.create - Create WebSocket connections

Browser Actions (20+ types):
- click, type, goto, wait, scroll, hover
- wait_for_selector, wait_for_function, wait_for_load_state
- wait_for_cookie, execute_js, keyboard, dropdown
- switch_iframe, set_viewport, if/while conditionals
- solve_captcha (15 captcha types), discord_login, remove_iframes

Antibot Bypass Options:
- cloudflareBypass, datadomeBypass, kasadaBypass
- disableAntiBot, detectIncapsula, spsnspidChallenge

Captcha Solving:
- automaticallySolveCaptchas, alwaysLoad (multi-select)
- Support for turnstile, recaptcha, hcaptcha, funcaptcha, etc.

Response Options:
- screenshot, screenshotUpload, screenshotWidth/Height
- pdf, base64, base64Response, binary
- innerText, includeImages, includeLinks
- regex extraction, filter fields, listAllRedirects

Request Interception:
- abortOnDetection, abortOnPostRequest
- blackListedDomains, neverCacheDomains
- dontLoadMainSite, dontLoadFirstRequest

Browser Configuration:
- browser type/version, userAgent, locales
- forceUniqueFingerprint, webrtcIpv4/Ipv6

Advanced Options:
- localStorage, cookiejar, fullPageLoad
- waitForUrl, removeIframes, blockCookieBanners
- AI parsing with autoparse, structure, model

Error Handling:
- Added missing CODE-0038 (FingerprintJS challenge)

BREAKING CHANGE: Major API expansion with new operations
Comment thread nodes/Scrappey/browserActions.ts Outdated
Comment on lines +800 to +802
baseAction.then = JSON.parse(action.thenActions || '[]');
} catch {
baseAction.then = [];

This comment was marked as outdated.

Previously, invalid JSON in thenActions/orActions fields for 'if' and 'while'
browser actions was silently caught and replaced with empty arrays. This caused
workflows to fail silently without any error feedback to the user.

Now throws descriptive Error with the specific JSON parsing issue, consistent
with jsonHeaders error handling in requestBodyBuilder.ts.

Fixes silent workflow failure when users provide malformed JSON in conditional
browser action configurations.
Comment thread nodes/Scrappey/methods.ts
Comment on lines +172 to +182
}

const customProxy = this.getNodeParameter('custom_proxy', itemIndex, false) as boolean;
if (customProxy && credentials?.proxyUrl) {
body.proxy = credentials.proxyUrl as string;
}
}

const response = await genericHttpRequest.call(this, 'POST', '', { body });
return response;
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The sessionCreate and websocketCreate methods ignore the "No Proxy" option, causing the user's selection to have no effect and potentially use a proxy unexpectedly.
Severity: HIGH | Confidence: High

πŸ” Detailed Analysis

The UI provides a "No Proxy" option for sessionCreate and websocketCreate operations. However, the implementation in methods.ts for these functions only handles 'proxyFromCredentials' and 'proxyFromScrappey'. It lacks a case for 'noProxy'. Consequently, when a user selects "No Proxy", the noProxy: true flag is not added to the request body, and the selection is silently ignored. This can lead to the request unintentionally using a default proxy instead of being sent directly, which contradicts the user's explicit configuration.

πŸ’‘ Suggested Fix

In methods.ts, update the SessionCreate and WebSocketCreate methods to handle the 'noProxy' case. Add a condition similar to the one in requestBodyBuilder.ts: if whichProxyToUse is 'noProxy', set body.noProxy = true. This will ensure the user's selection is respected.

πŸ€– Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: nodes/Scrappey/methods.ts#L136-L182

Potential issue: The UI provides a "No Proxy" option for `sessionCreate` and
`websocketCreate` operations. However, the implementation in `methods.ts` for these
functions only handles `'proxyFromCredentials'` and `'proxyFromScrappey'`. It lacks a
case for `'noProxy'`. Consequently, when a user selects "No Proxy", the `noProxy: true`
flag is not added to the request body, and the selection is silently ignored. This can
lead to the request unintentionally using a default proxy instead of being sent
directly, which contradicts the user's explicit configuration.

Did we get this right? πŸ‘ / πŸ‘Ž to inform future reviews.
Reference ID: 527205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant