# Baseball Rate Stats Calculator

> Baseball Rate Stats Calculator is a paid API for AI agents from sports-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Calculates baseball rate statistics for batters (AVG, OBP, SLG, OPS, ISO, BABIP) and pitchers (ERA, WHIP, K/9, BB/9, FIP) from raw counting stats.

## Facts

- Endpoint: GET https://sports-calc.x402tookit.com/baseball-stats?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/baseball-rate-stats-calculator-f3cfe558
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_j-1-J41yH-y5yYaadMDUb

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 baseball-rate-stats-calculator-f3cfe558
```

Example prompt: Can you calculate all the standard batting stats — AVG, OBP, SLG, OPS, ISO, and BABIP — for a player who had 145 hits, 520 at bats, 62 walks, 28 home runs, 30 doubles, 4 triples, 5 sacrifice flies, and 3 hit by pitches?

## When to prefer this

Use this endpoint when you need to convert raw baseball counting stats into standard rate statistics for batters or pitchers. It handles both offensive metrics (AVG, OBP, SLG, OPS, ISO, BABIP) and pitching metrics (ERA, WHIP, K/9, BB/9, FIP) in a single call, making it ideal for fantasy baseball analysis, scouting reports, or any sabermetric evaluation workflow.

## Known failure modes

- Missing required counting stats result in null values for affected metrics
- Invalid innings pitched format may cause pitching stat calculation failures
- Division-by-zero scenarios (e.g. zero at bats) return null for dependent stats
- Negative or out-of-range stat values may produce unexpected results

## How this service works

Baseball rate stats from counting stats: AVG, OBP, SLG, OPS, ISO, BABIP for batters; ERA, WHIP, K/9, BB/9, FIP for pitchers.

## Output

Returns computed baseball rate statistics including batting metrics (AVG, OBP, slugging, OPS, ISO, BABIP, walk rate) for batters and pitching metrics (ERA, WHIP, K/9, BB/9, FIP) for pitchers, along with a summary, any reasons or caveats, and a degraded flag if inputs were insufficient for some calculations.

## 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": [],
     "properties": {
      "h": {
       "type": "integer",
       "description": "Hits"
      },
      "ab": {
       "type": "integer",
       "description": "At bats (batting)"
      },
      "bb": {
       "type": "integer",
       "description": "Walks"
      },
      "er": {
       "type": "integer",
       "description": "Earned runs (pitching)"
      },
      "hr": {
       "type": "integer",
       "description": "Home runs"
      },
      "ip": {
       "type": "string",
       "description": "Innings pitched in baseball notation, 180.1 = 180 1/3 (pitching)"
      },
      "sf": {
       "type": "integer",
       "description": "Sacrifice flies"
      },
      "so": {
       "type": "integer",
       "description": "Strikeouts"
      },
      "hbp": {
       "type": "integer",
       "description": "Hit by pitch"
      },
      "doubles": {
       "type": "integer",
       "description": "Doubles"
      },
      "triples": {
       "type": "integer",
       "description": "Triples"
      },
      "bbIssued": {
       "type": "integer",
       "description": "Walks issued (pitching)"
      },
      "hAllowed": {
       "type": "integer",
       "description": "Hits allowed (pitching)"
      },
      "hrAllowed": {
       "type": "integer",
       "description": "Home runs allowed (pitching)"
      },
      "soPitched": {
       "type": "integer",
       "description": "Strikeouts recorded (pitching)"
      },
      "hbpPitched": {
       "type": "integer",
       "description": "Batters hit by pitch (pitching)"
      },
      "fipConstant": {
       "type": "number",
       "description": "League FIP constant, default 3.10"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "ops": {
       "type": [
        "null",
        "number"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "str
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/baseball-rate-stats-calculator-f3cfe558/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from sports-calc.x402tookit.com](https://www.zero.xyz/host/sports-calc.x402tookit.com/llms.txt)
