# Graph Algorithms – Graph Statistics

> Graph Algorithms – Graph Statistics is a paid API for AI agents from graph-algorithms.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-02).

Computes graph statistics including degree sequence, density, bipartite check, tree/forest test, and diameter for a given edge list.

## Facts

- Endpoint: GET https://graph-algorithms.x402tookit.com/graph-stats?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/graph-algorithms-graph-statistics-44252476
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jV2MNOaiDR4SEXhZDZDO7

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 graph-algorithms-graph-statistics-44252476
```

Example prompt: Can you analyze this graph and tell me its degree sequence, density, whether it's bipartite, whether it's a tree or forest, and its diameter? The edges are: A,B; B,C; C,D; D,A; A,C — treat it as undirected.

## When to prefer this

Use this endpoint when you need a broad structural overview of a small-to-medium graph (up to 200 nodes, 1000 edges) in a single call — covering degree distribution, density, bipartite/tree/forest classification, cycle detection, and diameter all at once. Prefer this over the sibling shortest-path or flow endpoints when you need structural characterization rather than a specific path or flow result.

## Known failure modes

- Edge list exceeds 200 nodes or 1000 edges — returns error
- Node names contain invalid characters outside allowed set — returns error
- Malformed edge format (not 'from,to' or 'from,to,weight') — returns parse error
- Graph is disconnected so diameter is not computed — returns null for diameter
- Empty edge list with no nodes provided — may return degenerate/null statistics

## How this service works

Graph statistics: degree sequence, density, bipartite check, tree or forest test, and diameter if connected.

## Output

Returns a JSON object with degree sequence (distribution of node degrees), graph density, bipartite check result, tree/forest classification, cycle detection, diameter (if connected), radius, directed flag, summary text, and any degraded/warning reasons.

## 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",
     "required": [
      "edges"
     ],
     "properties": {
      "edges": {
       "type": "string",
       "description": "Edges separated by ; or newline, each 'from,to' or 'from,to,weight' (default weight 1), or a JSON array of [from,to,weight]; up to 200 nodes, 1000 edges, 60000 characters; node names 1-32 characters of letters, digits, _ . : + - (weights ignored)"
      },
      "nodes": {
       "type": "string",
       "description": "Optional extra node names (comma or space separated) so isolated nodes are counted; the total still counts toward the 200-node cap"
      },
      "directed": {
       "type": "boolean",
       "description": "false (default). true reports in/out degrees and directed density; structure tests then use the undirected skeleton"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "isTree": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "radius": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "degrees": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "0": {
         "type": [
          "null",
          "number"
         ]
        },
        "1": {
         "type": [
          "null",
          "number"
         ]
        },
        "2": {
         "type": [
          "null",
          "number"
         ]
        },
        "3": {
         "type": [
          "null",
          "number"
         ]
        },
        "4": {
         "type": [
          "null",
          "number"
         ]
        },
        "5": {
         "type": [
          "null",
          "number"
         ]
        },
        "6": {
         "type": [
          "nu
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/graph-algorithms-graph-statistics-44252476/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from graph-algorithms.x402tookit.com](https://www.zero.xyz/host/graph-algorithms.x402tookit.com/llms.txt)
