# extract-code-as-csv

> extract-code-as-csv 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, extracts all <code> elements from the page, and returns them as CSV rows with a count

## Facts

- Endpoint: GET https://page.intel.rallylive.ca/page/code/csv?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-code-as-csv-c4ca7936
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gbltPlmRcuUb2hUoMuJNA

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-code-as-csv-c4ca7936
```

Example prompt: Can you fetch https://docs.example.com/api-reference and extract all the code elements into a CSV, so I can see every code snippet on the page along with a total count?

## When to prefer this

Use this endpoint when you need a lightweight, structured CSV extraction of all <code> elements from a single web page without spinning up a browser. Ideal for agents and pipelines that need to inventory, audit, or analyze code snippets on documentation, tutorial, or developer pages in a structured, machine-readable format. Prefer this over generic scraping tools when you specifically want code-element extraction in CSV format for downstream spreadsheet or data-pipeline consumption.

## Known failure modes

- URL is unreachable or returns a non-200 status — extraction fails with an error
- Page has no <code> elements — returns empty CSV with a count of zero
- Payment not provided or insufficient — request rejected due to x402 payment requirement
- Malformed or missing URL query parameter — request returns a validation error
- Target page blocks server-side crawlers — may return empty or partial results

## How this service works

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

## Output

A CSV-formatted response where each row represents one <code> element found on the fetched page, plus a total count of all code elements extracted. No browser is required; the service fetches and parses the HTML server-side.

## 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-code-as-csv-c4ca7936/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)
