{
  "openapi": "3.1.0",
  "info": {
    "title": "Unit Converter API",
    "version": "1.0.0",
    "description": "Convert length, mass, volume, temperature, speed, energy, pressure and more between units in one call.\n\nConvert between units of length, mass, volume, temperature, area, speed, energy, pressure, time and data in one call, with the list of supported units per category. Exact conversion factors, pure computation, no external service.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/unit-converter.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/unit-converter"
  },
  "servers": [
    {
      "url": "https://unit-converter.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Tools",
      "description": "Unit Converter API belongs to the Tools category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/info": {
      "get": {
        "operationId": "getUnitInfo",
        "summary": "Get Unit Info",
        "description": "Get Unit Info endpoint of the Unit Converter API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/unit-converter/get-unit-info"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "area": [
                    "square kilometer"
                  ],
                  "data-transfer-rate": [
                    "Bit per second"
                  ],
                  "digital-storage": [
                    "Bit"
                  ],
                  "energy": [
                    "Joule"
                  ],
                  "frequency": [
                    "Hertz"
                  ],
                  "fuel-economics": [
                    "Miles per gallon"
                  ],
                  "length": [
                    "kilometer"
                  ],
                  "mass": [
                    "Tonne"
                  ],
                  "plane-angle": [
                    "Arcsecond"
                  ],
                  "pressure": [
                    "Bar"
                  ],
                  "speed": [
                    "Mile per hour"
                  ],
                  "temperature": [
                    "Degree Celsius"
                  ],
                  "time": [
                    "Nanosecond"
                  ],
                  "volume": [
                    "us liquid gallon"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/converter": {
      "get": {
        "operationId": "transformUnits",
        "summary": "Transform Units",
        "description": "Transform Units endpoint of the Unit Converter API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/unit-converter/transform-units"
        },
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Square kilometer"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Square mile"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "area"
          },
          {
            "name": "value",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "from": "Square kilometer",
                  "to": "Square mile",
                  "input": 1,
                  "result": 0.386102
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}