{
  "x402Version": 2,
  "id": 35424,
  "slug": "35424",
  "resource": "https://agentstoolshub.com/api/v1/finance/margin-calculator",
  "description": "Calculate gross profit, profit margin (profit as % of price) and markup (profit as % of cost) from a unit cost and selling price — the two numbers people constantly mix up. Use this when an agent needs to profit margin vs markup, both computed.",
  "type": "http",
  "serviceName": "AgentTools",
  "resourceType": "Market Data",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x8a0F2b0a6C82D1c54B16E2e4DEcd18fF0802b0f6",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "2000",
      "amountUsd": 0.002,
      "maxTimeoutSeconds": 300
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "analytics": {},
    "bazaar": {
      "info": {
        "input": {
          "method": "GET",
          "queryParams": {
            "cost": 60,
            "price": 100
          },
          "type": "http"
        },
        "output": {
          "example": {
            "result": {
              "answer": "40% margin",
              "answerLabel": "Selling at 100 (cost 60)",
              "details": [
                {
                  "label": "Gross profit per unit",
                  "value": "40"
                },
                {
                  "label": "Markup",
                  "value": "66.67% of cost"
                },
                {
                  "label": "Price for a 50% margin",
                  "value": "120"
                }
              ],
              "steps": [
                "Profit = 100 − 60 = 40",
                "Margin = 40 ÷ 100 × 100 = 40%",
                "Markup = 40 ÷ 60 × 100 = 66.67%"
              ],
              "value": 40
            },
            "tool": "margin-calculator"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "method": {
                "enum": [
                  "GET"
                ],
                "type": "string"
              },
              "queryParams": {
                "properties": {
                  "cost": {
                    "description": "Cost",
                    "type": "number"
                  },
                  "price": {
                    "description": "Selling price",
                    "type": "number"
                  }
                },
                "required": [
                  "cost",
                  "price"
                ],
                "type": "object"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "finance",
    "analytics",
    "bazaar"
  ],
  "sourceHost": "agentstoolshub.com",
  "lastUpdated": "2026-10-11T22:54:16.604Z",
  "quality": {
    "calls30d": 2,
    "uniquePayers30d": 2,
    "lastCalledAt": "2026-10-11T22:54:16.44Z"
  },
  "metadata": {
    "serviceName": "AgentTools",
    "extensions": {
      "analytics": {},
      "bazaar": {
        "info": {
          "input": {
            "method": "GET",
            "queryParams": {
              "cost": 60,
              "price": 100
            },
            "type": "http"
          },
          "output": {
            "example": {
              "result": {
                "answer": "40% margin",
                "answerLabel": "Selling at 100 (cost 60)",
                "details": [
                  {
                    "label": "Gross profit per unit",
                    "value": "40"
                  },
                  {
                    "label": "Markup",
                    "value": "66.67% of cost"
                  },
                  {
                    "label": "Price for a 50% margin",
                    "value": "120"
                  }
                ],
                "steps": [
                  "Profit = 100 − 60 = 40",
                  "Margin = 40 ÷ 100 × 100 = 40%",
                  "Markup = 40 ÷ 60 × 100 = 66.67%"
                ],
                "value": 40
              },
              "tool": "margin-calculator"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "method": {
                  "enum": [
                    "GET"
                  ],
                  "type": "string"
                },
                "queryParams": {
                  "properties": {
                    "cost": {
                      "description": "Cost",
                      "type": "number"
                    },
                    "price": {
                      "description": "Selling price",
                      "type": "number"
                    }
                  },
                  "required": [
                    "cost",
                    "price"
                  ],
                  "type": "object"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method"
              ],
              "type": "object"
            },
            "output": {
              "properties": {
                "example": {
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "agentstoolshub.com",
    "manifest_name": "agentstoolshub.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "example": {},
    "type": "string"
  }
}