Plasmate SOM Action

March 29, 2026 · View on GitHub

GitHub Action

A GitHub Action that fetches a web page with Plasmate and outputs the Semantic Object Model (SOM). SOM uses 4x fewer tokens than raw HTML while preserving page structure, element roles, and interactive affordances.

Usage

- uses: plasmate-labs/som-action@v1
  with:
    url: https://example.com
  id: som

- run: echo "Page title: ${{ steps.som.outputs.title }}"

Inputs

InputRequiredDefaultDescription
urlURL to fetch
formatjsonOutput format (json or text)

Outputs

OutputDescription
somThe full SOM JSON output
titlePage title extracted from the SOM
tokensApproximate token count of the SOM

Examples

Fetch and use in subsequent steps

name: Scrape and Process

on:
  workflow_dispatch:
    inputs:
      url:
        description: 'URL to scrape'
        required: true

jobs:
  scrape:
    runs-on: ubuntu-latest
    steps:
      - uses: plasmate-labs/som-action@v1
        with:
          url: ${{ github.event.inputs.url }}
        id: som

      - name: Display results
        run: |
          echo "Title: ${{ steps.som.outputs.title }}"
          echo "Tokens: ${{ steps.som.outputs.tokens }}"

      - name: Save SOM
        run: echo '${{ steps.som.outputs.som }}' > som.json

      - uses: actions/upload-artifact@v4
        with:
          name: som-output
          path: som.json

Scheduled monitoring

name: Monitor Page Changes

on:
  schedule:
    - cron: '0 */6 * * *'  # Every 6 hours

jobs:
  monitor:
    runs-on: ubuntu-latest
    steps:
      - uses: plasmate-labs/som-action@v1
        with:
          url: https://example.com/status
        id: som

      - name: Check for changes
        run: |
          echo "Current title: ${{ steps.som.outputs.title }}"
          # Add your change detection logic here

How It Works

  1. Builds a Docker container with Plasmate installed
  2. Fetches the specified URL using plasmate fetch
  3. Parses the SOM JSON to extract metadata
  4. Outputs the full SOM and extracted fields as step outputs

License

MIT


Part of the Plasmate Ecosystem

Engineplasmate - The browser engine for agents
MCPplasmate-mcp - Claude Code, Cursor, Windsurf
Extensionplasmate-extension - Chrome cookie export
SDKsPython / Node.js / Go / Rust
FrameworksLangChain / CrewAI / AutoGen / Smolagents
ToolsScrapy / Audit / A11y / GitHub Action
ResourcesAwesome Plasmate / Notebooks / Benchmarks
Docsdocs.plasmate.app
W3CWeb Content Browser for AI Agents