developer · developer · research · code · metrics · complexity · maintainability

Code metrics

Measure source-code size, functions, branching complexity, and maintainability signals for supported languages.

$0.025 USDCBasex402 v2POST

Endpoint

https://apiacre.com/v1/developer/code-metrics

Send the JSON body below. An unpaid request returns HTTP 402 with a PAYMENT-REQUIRED header; an x402-compatible buyer signs the requirement and retries with PAYMENT-SIGNATURE.

Input example

{
  "code": "def greet(name):\n    return f'Hello {name}'",
  "language": "python"
}

Response shape

{
  "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a",
  "service": "developer.code-metrics",
  "version": "1",
  "data": {
    "language": "example",
    "lines": 1,
    "functions": 1,
    "estimatedCyclomaticComplexity": 1,
    "maximumLineLength": 1,
    "maintainabilitySignal": "example"
  },
  "meta": {
    "duration_ms": 42,
    "cached": false,
    "sources": [],
    "warnings": []
  }
}

Try the payment challenge

curl -i -X POST 'https://apiacre.com/v1/developer/code-metrics' \
  -H 'content-type: application/json' \
  --data '{"code":"def greet(name):\n    return f'Hello {name}'","language":"python"}'