{
  "openapi": "3.1.0",
  "info": {
    "title": "RevenueLab Public API",
    "version": "1.0.0",
    "description": "Run any of RevenueLab's 1685+ calculators and pull transparent revenue, RPM, payout, and business benchmarks as JSON. All data is CC BY 4.0 — cite as \"RevenueLab — {title} ({url})\". No API key required.",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "contact": {
      "url": "https://www.revenuelab.fyi/cite"
    }
  },
  "servers": [
    {
      "url": "https://www.revenuelab.fyi"
    }
  ],
  "paths": {
    "/api/public/calc": {
      "get": {
        "operationId": "runCalculator",
        "summary": "Run a calculator. Pass tool={slug} plus one query param per input id. Omit 'tool' (optionally with q=) to search available tools.",
        "parameters": [
          {
            "name": "tool",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Calculator slug, e.g. 'mortgage-payment'. Omit to list/search tools."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Search term used when 'tool' is omitted."
          },
          {
            "name": "describe",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Present with a tool slug and no inputs: return the input/output schema instead of a result."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "runCalculatorPost",
        "summary": "Run a calculator with a JSON body: { tool, inputs }.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tool": {
                    "type": "string"
                  },
                  "inputs": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "tool"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/tool/{slug}.json": {
      "get": {
        "operationId": "getToolDetail",
        "summary": "Full machine-readable detail for one calculator: inputs, outputs, formula, worked example, FAQ, and citation.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/toolbox-index.json": {
      "get": {
        "operationId": "toolbox_index",
        "summary": "Index of all 1685 calculators with slugs, formulas, inputs, and outputs.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/rpm-by-niche.json": {
      "get": {
        "operationId": "rpm_by_niche",
        "summary": "YouTube long-form RPM ranges across niches (low / median / high, USD).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/country-rpm.json": {
      "get": {
        "operationId": "country_rpm",
        "summary": "YouTube RPM and CPM for 80+ countries with tier classification.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/youtube-shorts-rpm-by-country.json": {
      "get": {
        "operationId": "shorts_rpm_by_country",
        "summary": "YouTube Shorts RPM estimates by country tier.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/sponsorship-rates.json": {
      "get": {
        "operationId": "sponsorship_rates",
        "summary": "Creator sponsorship rate card by platform and follower tier.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/tiktok-creator-rewards.json": {
      "get": {
        "operationId": "tiktok_creator_rewards",
        "summary": "TikTok Creator Rewards modeled payouts per 1,000 qualified views.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/saas-ltv-cac-benchmarks.json": {
      "get": {
        "operationId": "saas_ltv_cac",
        "summary": "SaaS LTV:CAC and payback benchmarks by segment.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/ai-model-pricing.json": {
      "get": {
        "operationId": "ai_model_pricing",
        "summary": "AI model pricing per million tokens across providers.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/ai-benchmarks.json": {
      "get": {
        "operationId": "ai_benchmarks",
        "summary": "AI cost and productivity benchmarks.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/comparisons.json": {
      "get": {
        "operationId": "comparisons",
        "summary": "Head-to-head comparisons with crossover points and worked math.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/changelog.json": {
      "get": {
        "operationId": "changelog",
        "summary": "Dataset freshness: what changed and when, so agents can prefer current data.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}