# extract-scripts-as-json

> extract-scripts-as-json is a paid API for AI agents from page.intel.rallylive.ca, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-23).

Fetches a web page URL and extracts all script elements, returning them as a structured JSON array with a count

## Facts

- Endpoint: GET https://page.intel.rallylive.ca/page/scripts/json?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/extract-scripts-as-json-bf55e7e3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_x_YX01vl7WP710ge0-QoI

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability extract-scripts-as-json-bf55e7e3
```

Example prompt: Can you extract all the script elements from https://example.com and give me the full list as JSON so I can see what scripts the page is loading?

## When to prefer this

Choose this endpoint when you need a fast, structured JSON extraction of all script elements from a static or server-rendered web page without spinning up a headless browser. Ideal for pipelines and agents that need machine-readable output at low cost ($0.01/page). Prefer this over full-page scrapers when you only need script tags and want a clean, focused JSON array rather than raw HTML.

## Known failure modes

- URL is unreachable or returns a non-200 status — endpoint may return empty array or error
- Page blocks server-side fetches (e.g. bot protection) — scripts may be missing or incomplete
- Dynamically injected scripts (added by JavaScript at runtime) will not be captured since no browser is used
- Malformed or invalid URL input causes request failure
- Page with no script elements returns an empty array with count 0

## How this service works

Extract the page's scripts as json: fetches the URL, pulls every scripts element and returns them as a JSON array, with a count. Structured, one-element-type extraction for agents and pipelines; no browser needed. $0.01 per page.

## Output

A JSON array containing every script element found on the fetched page, along with a count of how many scripts were found. Each array entry represents one script element (inline or external src reference) extracted from the page's HTML.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/extract-scripts-as-json-bf55e7e3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from page.intel.rallylive.ca](https://www.zero.xyz/host/page.intel.rallylive.ca/llms.txt)
