{
  "x402Version": 2,
  "id": 2606,
  "slug": "2606",
  "resource": "https://apiacre.com/v1/developer/code-metrics",
  "description": "Measure caller-supplied source code with Python AST analysis or a deterministic lexical fallback, including per-function complexity, a SHA-256 fingerprint, density ratios, syntax status, and actionable maintainability signals without retaining or forwarding the code.",
  "type": "http",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xa0BFa4f07281c9b248DC3AED2217836BcA24869B",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "25000",
      "maxTimeoutSeconds": 300
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "B4CHWQeQn7GDLZD2aW6hpGG2bEseisBFLZYECA3HDLan",
      "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount": "25000",
      "maxTimeoutSeconds": 300
    }
  ],
  "outputSchema": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "code": "def greet(name):\n    return f'Hello {name}'",
            "language": "python"
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "data": {
              "analysis": {
                "limitations": [
                  "AST complexity is a static heuristic, not a runtime or co...",
                  "Comment counts include comment-only lines, not inline com..."
                ],
                "method": "Python AST with deterministic lexical metrics",
                "version": "apiacre-code-metrics/3"
              },
              "averageLineLength": 21,
              "blankLineDensity": 0,
              "branchPoints": 0,
              "classes": 0,
              "commentDensity": 0,
              "complexityPerFunction": 1,
              "estimatedCyclomaticComplexity": 1,
              "functionMetrics": [
                {
                  "endLine": 2,
                  "kind": "function",
                  "line": 1,
                  "name": "greet"
                }
              ],
              "functions": 1,
              "functionsTruncated": false,
              "language": "python",
              "lines": {
                "blank": 0,
                "code": 2,
                "comments": 0,
                "total": 2
              },
              "longLineCount": 0,
              "maintainabilitySignal": 95,
              "maximumFunctionComplexity": 1,
              "maximumLineLength": 26,
              "reviewSignals": [],
              "source": {
                "characters": 43,
                "sha256": "d588756864c1c6b9016a1829ea9283915950ef23e5b1c04018413ed71...",
                "utf8Bytes": 43
              },
              "syntax": {
                "engine": "python-ast",
                "error": null,
                "valid": true
              },
              "workMarkerCount": 0
            },
            "meta": {
              "cached": false,
              "duration_ms": 42,
              "next_actions": [
                {
                  "method": "POST",
                  "reason": "Compare the measured source with a caller-supplied baseli...",
                  "service": "developer.code-change-review",
                  "title": "Code change review"
                }
              ],
              "sources": [],
              "warnings": []
            },
            "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a",
            "service": "developer.code-metrics",
            "version": "1"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json",
                  "form-data",
                  "text"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST",
                  "PUT",
                  "PATCH"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method",
              "bodyType",
              "body"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "analysis": {
                        "type": "object"
                      },
                      "averageLineLength": {
                        "type": "number"
                      },
                      "blankLineDensity": {
                        "type": "number"
                      },
                      "branchPoints": {
                        "type": "integer"
                      },
                      "classes": {
                        "type": "integer"
                      },
                      "commentDensity": {
                        "type": "number"
                      },
                      "complexityPerFunction": {
                        "type": "number"
                      },
                      "estimatedCyclomaticComplexity": {
                        "type": "integer"
                      },
                      "functionMetrics": {
                        "items": {
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "functions": {
                        "type": "integer"
                      },
                      "functionsTruncated": {
                        "type": "boolean"
                      },
                      "language": {
                        "type": "string"
                      },
                      "lines": {
                        "type": "object"
                      },
                      "longLineCount": {
                        "type": "integer"
                      },
                      "maintainabilitySignal": {
                        "type": "integer"
                      },
                      "maximumFunctionComplexity": {
                        "type": "integer"
                      },
                      "maximumLineLength": {
                        "type": "integer"
                      },
                      "reviewSignals": {
                        "items": {
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "source": {
                        "type": "object"
                      },
                      "syntax": {
                        "type": "object"
                      },
                      "workMarkerCount": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "language",
                      "source",
                      "lines",
                      "classes",
                      "functions",
                      "branchPoints",
                      "estimatedCyclomaticComplexity",
                      "complexityPerFunction",
                      "maximumFunctionComplexity",
                      "functionMetrics",
                      "functionsTruncated",
                      "syntax",
                      "maximumLineLength",
                      "averageLineLength",
                      "commentDensity",
                      "blankLineDensity",
                      "longLineCount",
                      "workMarkerCount",
                      "maintainabilitySignal",
                      "reviewSignals",
                      "analysis"
                    ],
                    "type": "object"
                  },
                  "meta": {
                    "properties": {
                      "cached": {
                        "type": "boolean"
                      },
                      "duration_ms": {
                        "type": "integer"
                      },
                      "next_actions": {
                        "items": {
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "sources": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "warnings": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "duration_ms",
                      "cached",
                      "sources",
                      "warnings",
                      "next_actions"
                    ],
                    "type": "object"
                  },
                  "request_id": {
                    "type": "string"
                  },
                  "service": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string"
                  }
                },
                "required": [
                  "request_id",
                  "service",
                  "version",
                  "data",
                  "meta"
                ],
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    },
    "payment-identifier": {
      "info": {
        "required": false
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "id": {
            "maxLength": 128,
            "minLength": 16,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "type": "string"
          },
          "required": {
            "type": "boolean"
          }
        },
        "required": [
          "required"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "bazaar",
    "payment-identifier"
  ],
  "sourceHost": "apiacre.com",
  "lastUpdated": "2026-08-31T00:32:32.418Z",
  "quality": {
    "calls30d": 1,
    "uniquePayers30d": 1,
    "lastCalledAt": "2026-08-31T00:32:31.921Z"
  },
  "liveness": {},
  "verified": false,
  "featured": false,
  "provider": {
    "host": "apiacre.com",
    "manifest_name": "apiacre.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-09-18T22:00:31.484Z"
  }
}