# extract-main-as-json

> extract-main-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-20).

Fetches a URL and extracts all HTML <main> elements, returning them as a structured JSON array with a count

## Facts

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

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-main-as-json-400b79af
```

Example prompt: Fetch https://example.com/article and extract all the <main> elements as a JSON array so I can process the primary content in my pipeline.

## When to prefer this

Choose this endpoint when you need the structured <main> element content of a page in JSON format for downstream programmatic processing, agent pipelines, or data ingestion — especially when you don't have a browser available and need a lightweight server-side fetch. Prefer this over text or CSV variants when your pipeline expects JSON. Prefer over full-page scrapers when you only need the primary content block.

## Known failure modes

- URL is unreachable or returns a non-200 status — extraction fails with an error response
- Page has no <main> element — returns an empty JSON array with count of 0
- URL points to a non-HTML resource (PDF, image, etc.) — parsing may yield no results
- Payment not provided or invalid — x402 payment required error before processing
- Malformed URL in query parameter — request rejected or fetch fails

## How this service works

Extract the page's main as json: fetches the URL, pulls every main 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 object containing an array of all <main> elements found on the fetched page, along with a count of how many were found. Each element in the array represents one extracted <main> HTML element's content in structured form.

## 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-main-as-json-400b79af/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)
