{
  "openapi": "3.0.3",
  "info": {
    "title": "CardWorthScanner — Official Public REST & MCP API",
    "version": "1.0.1",
    "description": "CardWorthScanner is a deterministic trading card valuation workbench and border centering calibration tool covering Pokemon, Yu-Gi-Oh!, and Sports cards. Collectors can look up raw Near Mint TCGplayer USD and Cardmarket EUR benchmarks alongside PSA 9, PSA 10 Gem Mint, and BGS 9.5 slab multipliers, measure Left/Right and Top/Bottom border ratios against PSA 55/45 and BGS 50/50 Black Label tolerances, and calculate net grading ROI after marketplace fees. Powered by verified TCGdex v2, TCGCSV, and YGOPRODeck catalog ledgers with free web, CLI, and MCP agent endpoints.",
    "contact": {
      "name": "CardWorthScanner",
      "url": "https://cardworthscanner.com",
      "email": "admin@cardworthscanner.com"
    },
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "externalDocs": {
    "description": "CardWorthScanner Official Web Workbench",
    "url": "https://cardworthscanner.com"
  },
  "servers": [
    {
      "url": "https://cardworthscanner.com",
      "description": "Production Cloudflare Global Edge"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Optional API Key for Albato / automation tracking (e.g. pk_live_cardworthscanner_2026)"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/api/v1/me": {
      "get": {
        "operationId": "verifyApiConnection",
        "summary": "Verify CardWorthScanner API Key & Service Health",
        "description": "Authentication test and metadata endpoint for Albato App Integrator, RapidAPI, Make, and custom workflows.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "responses": {
          "200": {
            "description": "Authenticated connection status and tool count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "example": true
                    },
                    "authenticated": {
                      "type": "boolean",
                      "example": true
                    },
                    "service": {
                      "type": "string",
                      "example": "CardWorthScanner"
                    },
                    "domain": {
                      "type": "string",
                      "example": "cardworthscanner.com"
                    },
                    "version": {
                      "type": "string",
                      "example": "1.0.1"
                    },
                    "toolsCount": {
                      "type": "integer",
                      "example": 8
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools": {
      "get": {
        "operationId": "listAvailableTools",
        "summary": "List All CardWorthScanner Read-Only Tools & Schemas",
        "responses": {
          "200": {
            "description": "Array of available read-only tools"
          }
        }
      }
    },
    "/api/mcp": {
      "get": {
        "operationId": "getMcpServerMetadata",
        "summary": "Get CardWorthScanner MCP Server Metadata",
        "responses": {
          "200": {
            "description": "MCP Server metadata and Grade-A tool annotations"
          }
        }
      },
      "post": {
        "operationId": "invokeMcpJsonRpc",
        "summary": "Execute Streamable HTTP JSON-RPC 2.0 MCP Request",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "id",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "example": "2.0"
                  },
                  "id": {
                    "type": "integer",
                    "example": 1
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "initialize",
                      "tools/list",
                      "tools/call"
                    ],
                    "example": "tools/list"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response envelope"
          }
        }
      }
    },
    "/api/v1/tools/calculate_psa_grading_roi": {
      "post": {
        "operationId": "calculate_psa_grading_roi",
        "summary": "PSA / BGS / CGC Card Grading ROI & Break-Even Calculator",
        "description": "Calculate deterministic PSA / BGS / CGC card grading net profit, ROI %, expected value (EV), and break-even Gem Mint probability after 12.5% marketplace fees.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rawNearMintUsd": {
                    "type": "number",
                    "description": "Raw Near Mint (NM) ungraded card market price in USD"
                  },
                  "psa9MarketUsd": {
                    "type": "number",
                    "description": "PSA 9 Mint market price in USD"
                  },
                  "psa10MarketUsd": {
                    "type": "number",
                    "description": "PSA 10 Gem Mint market price in USD"
                  },
                  "condition": {
                    "type": "string",
                    "enum": [
                      "NM",
                      "LP",
                      "MP",
                      "HP",
                      "DMG"
                    ],
                    "description": "Current ungraded card condition (default: NM)"
                  },
                  "gradingServiceFeeUsd": {
                    "type": "number",
                    "description": "Grading tier fee in USD (default: 25 for PSA Value Bulk)"
                  }
                },
                "required": [
                  "rawNearMintUsd",
                  "psa9MarketUsd",
                  "psa10MarketUsd"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from calculate_psa_grading_roi"
          }
        }
      }
    },
    "/api/v1/tools/calculate_card_centering_grade": {
      "post": {
        "operationId": "calculate_card_centering_grade",
        "summary": "Trading Card Border Centering Ratio & PSA 10 Tolerance Calculator",
        "description": "Calculate trading card border centering ratios (Left/Right and Top/Bottom in mm or px) and determine maximum eligible grades across PSA (55/45), BGS (Black Label 50/50), CGC, and TAG.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "leftMm": {
                    "type": "number",
                    "description": "Left border width in mm or pixels (e.g. 2.4)"
                  },
                  "rightMm": {
                    "type": "number",
                    "description": "Right border width in mm or pixels (e.g. 2.6)"
                  },
                  "topMm": {
                    "type": "number",
                    "description": "Top border width in mm or pixels (e.g. 2.5)"
                  },
                  "bottomMm": {
                    "type": "number",
                    "description": "Bottom border width in mm or pixels (e.g. 2.5)"
                  }
                },
                "required": [
                  "leftMm",
                  "rightMm",
                  "topMm",
                  "bottomMm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from calculate_card_centering_grade"
          }
        }
      }
    },
    "/api/v1/tools/lookup_tcg_card_market_price": {
      "post": {
        "operationId": "lookup_tcg_card_market_price",
        "summary": "Pokemon & Yu-Gi-Oh! Raw vs PSA 10 Market Price Lookup",
        "description": "Look up raw TCGplayer USD, Cardmarket EUR, PSA 9, PSA 10, and BGS 9.5 graded prices for Pokemon, Yu-Gi-Oh!, and Sports cards by name or card number (e.g. \"Charizard\", \"4/102\", \"Umbreon\", \"Blue-Eyes White Dragon\").",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Card name, character, set name, or printed number (e.g. \"Charizard 4/102\", \"Moonbreon\", \"LOB-001\")"
                  },
                  "limit": {
                    "type": "number",
                    "description": "Maximum number of matching cards to return (1 to 10, default 5)"
                  }
                },
                "required": [
                  "query"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from lookup_tcg_card_market_price"
          }
        }
      }
    },
    "/api/v1/tools/lookup_psa_bgs_cgc_grading_standards": {
      "post": {
        "operationId": "lookup_psa_bgs_cgc_grading_standards",
        "summary": "PSA, Beckett (BGS), CGC & TAG Grading Scale Standards Lookup",
        "description": "Look up exact front/back centering tolerances, corner sharpness, edge whitening, and surface rules for PSA 10 Gem Mint, BGS 10 Black Label, CGC 10 Pristine, and TAG 1000.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company": {
                    "type": "string",
                    "enum": [
                      "PSA",
                      "BGS",
                      "CGC",
                      "TAG",
                      "ALL"
                    ],
                    "description": "Grading authority (PSA, BGS, CGC, TAG, or ALL)"
                  }
                },
                "required": [
                  "company"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from lookup_psa_bgs_cgc_grading_standards"
          }
        }
      }
    },
    "/api/v1/tools/identify_vintage_pokemon_edition_markers": {
      "post": {
        "operationId": "identify_vintage_pokemon_edition_markers",
        "summary": "1999 Base Set 1st Edition, Shadowless & Unlimited Identifier",
        "description": "Identify 1999 Wizards of the Coast Pokemon Base Set print runs (1st Edition Thick/Thin Stamp, Shadowless Red Cheeks/Yellow Cheeks, Unlimited, 1999-2000 4th Print UK) from visual border and copyright cues.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hasFirstEditionStamp": {
                    "type": "boolean",
                    "description": "Whether the left middle border has the black Edition 1 stamp"
                  },
                  "hasRightFrameDropShadow": {
                    "type": "boolean",
                    "description": "Whether the right side of the artwork box casts a dark shadow"
                  },
                  "copyrightYearText": {
                    "type": "string",
                    "description": "Bottom copyright text (e.g. \"1995, 96, 98, 99\" or \"1999-2000\")"
                  }
                },
                "required": [
                  "hasFirstEditionStamp",
                  "hasRightFrameDropShadow"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from identify_vintage_pokemon_edition_markers"
          }
        }
      }
    },
    "/api/v1/tools/compare_card_grading_company_tiers": {
      "post": {
        "operationId": "compare_card_grading_company_tiers",
        "summary": "PSA vs BGS vs CGC Submission Service Tier & Declared Value Comparator",
        "description": "Compare submission fees, maximum declared value caps, and estimated turnaround business days across PSA, Beckett (BGS), and CGC based on post-grading card value.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "estimatedGradedValueUsd": {
                    "type": "number",
                    "description": "Estimated post-grading value of the card in USD (e.g. 180, 600, 2500)"
                  }
                },
                "required": [
                  "estimatedGradedValueUsd"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from compare_card_grading_company_tiers"
          }
        }
      }
    },
    "/api/v1/tools/estimate_ebay_tcgplayer_seller_net_payout": {
      "post": {
        "operationId": "estimate_ebay_tcgplayer_seller_net_payout",
        "summary": "eBay Authenticity Guarantee vs TCGplayer Seller Fee & Net Payout Calculator",
        "description": "Calculate net seller take-home payout after platform final value fees (eBay 13.25%, TCGplayer Pro/Level 4, Goldin/PWCC vault) and shipping insurance.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "salePriceUsd": {
                    "type": "number",
                    "description": "Gross card sale price in USD (e.g. 250)"
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ebay",
                      "tcgplayer",
                      "cardmarket",
                      "vault-auction"
                    ],
                    "description": "Selling marketplace"
                  }
                },
                "required": [
                  "salePriceUsd",
                  "platform"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from estimate_ebay_tcgplayer_seller_net_payout"
          }
        }
      }
    },
    "/api/v1/tools/check_card_sleeve_and_holder_dimensions": {
      "post": {
        "operationId": "check_card_sleeve_and_holder_dimensions",
        "summary": "Trading Card Size, Penny Sleeve & Grading Semi-Rigid Holder Spec Guide",
        "description": "Look up exact card dimensions in mm/inches and required submission holder specs (Card Saver 1 semi-rigid vs 35pt/55pt/130pt toploader) for Standard (Pokemon/MTG/Sports) vs Japanese (Yu-Gi-Oh!) cards.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cardGame": {
                    "type": "string",
                    "enum": [
                      "pokemon",
                      "yugioh",
                      "mtg",
                      "sports-standard",
                      "sports-thick-patch"
                    ],
                    "description": "Trading card game or card stock thickness type"
                  }
                },
                "required": [
                  "cardGame"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from check_card_sleeve_and_holder_dimensions"
          }
        }
      }
    }
  }
}
