Skip to content

Scanner Commands Reference

Low-level reference for scanner protocol actions used by Oryn backends.

Message Format

Request

Use action as the canonical command key:

{
  "action": "scan"
}

Compatibility: scanner.js also accepts cmd for legacy callers.

Success

{
  "status": "ok",
  "success": true,
  "message": "Action completed"
}

Error

{
  "status": "error",
  "code": "INVALID_REQUEST",
  "message": "Missing command"
}

Core Actions

scan

{
  "action": "scan",
  "max_elements": 200,
  "include_hidden": false,
  "viewport_only": false,
  "near": null,
  "monitor_changes": false,
  "full_mode": false
}

Returns page, elements, stats, and optionally patterns, changes, available_intents.

click

{
  "action": "click",
  "id": 5,
  "button": "left",
  "double": false,
  "force": false,
  "modifiers": []
}

type

{
  "action": "type",
  "id": 1,
  "text": "hello",
  "clear": true,
  "submit": false,
  "delay": 0
}

select

{
  "action": "select",
  "id": 3,
  "value": null,
  "label": "Canada",
  "index": null
}

wait_for

{
  "action": "wait_for",
  "condition": "visible",
  "selector": "#success",
  "timeout": 30000
}

extract

{
  "action": "extract",
  "source": "links",
  "selector": null
}

Intent-Style Scanner Actions

login

{
  "action": "login",
  "username": "user@example.com",
  "password": "secret"
}
{
  "action": "search",
  "query": "oryn"
}

dismiss

{
  "action": "dismiss",
  "target": "popups"
}

accept

{
  "action": "accept",
  "target": "cookies"
}

Script/Data Actions

execute

{
  "action": "execute",
  "script": "return document.title;",
  "args": []
}

get_text

{
  "action": "get_text",
  "selector": null
}

get_html

{
  "action": "get_html",
  "selector": null,
  "outer": true
}

Error Codes

Common scanner-facing codes:

  • ELEMENT_NOT_FOUND
  • ELEMENT_STALE
  • ELEMENT_NOT_VISIBLE
  • ELEMENT_DISABLED
  • ELEMENT_NOT_INTERACTABLE
  • INVALID_ELEMENT_TYPE
  • OPTION_NOT_FOUND
  • SELECTOR_INVALID
  • TIMEOUT
  • NAVIGATION_ERROR
  • SCRIPT_ERROR
  • UNKNOWN_COMMAND
  • INVALID_REQUEST
  • INTERNAL_ERROR

See Error Codes for recovery guidance.