openapi: 3.0.4
info:
  title: We > Ultrarich API
  description: How much is billions or trillions of dollars? Understand the scale of extreme wealth inequality by viewing Duration Of Daily Spend, Height Of Stacked Money, Number Of Items Bought Or Paid For/Off, and/or Growth Of Compound Interest.
  version: 0.9
  contact:
    name: Support
    email: info@wegtultrarich.org
    url: https://wegtultrarich.org/faq.html
  license:
    name: CC BY-NC-SA 4.0
    url: https://creativecommons.org/licenses/by-nc-sa/4.0/
externalDocs:
  description: API Documentation
  url: https://api.wegtultrarich.org/readme.md

servers:
  - url: https://api.wegtultrarich.org/v1
    description: Main (Production) Server

paths:
  /durationOfDailySpend:
    get:
      summary: Returns the duration of time an amount could be spent daily.
      description: Given a wealth and amount, returns the duration of time a specified-wealth would last when a specified-amount was spent daily.
      parameters:
        - in: query
          name: wealth
          description: Wealth is the amount of money to be described via this expression.
          required: true
          schema:
            type: number
            minimum: 1
            maximum: 1000000000000000
            example: 1000000000
        - in: query
          name: spend
          description: Spend is the amount of money to be spent daily (the crux of this expression).
          required: true
          schema:
            type: number
            minimum: 1
            maximum: 1000000000000000
            example: 1000
        - in: query
          name: verbose
          description: Whether to provide the result as a complete sentence summarizing the expression and its duration of time result (true) or a duration of time phrase (false).
          required: true
          schema:
            type: boolean
            example: false
      responses:
        200:
          description: a JSON object with response data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  data:
                    type: string
                    examples:
                      default:
                        value: "3 Millennia (2,740 Years)"
                        summary: The duration of time phrase.
                      verbose:
                        value: "A person with a wealth of $1,000,000,000 could spend $1,000 every day for 3 Millennia (2,740 Years)!"
                        summary: A complete sentence summarizing the expression and its duration of time result.
                required:
                  - "status"
                  - "data"
        400:
          description: a JSON object with error data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: "400"
                      message:
                        type: string
                        example: "Wealth Missing"
                    required:
                      - "code"
                      - "message"
                required:
                  - "status"
                  - "error"

  /heightOfMoneyStack:
    get:
      summary: Returns the height of a money stack.
      description: Given a wealth and type of money, returns the height of a stack of the specified-wealth in the specified-type-of-money.
      parameters:
        - in: query
          name: wealth
          description: Wealth is the amount of money to be described via this expression.
          required: true
          schema:
            type: number
            minimum: 1
            maximum: 1000000000000000
            example: 1000000000
        - in: query
          name: typeOfMoney
          schema:
            type: string
            enum: ["1", "100"]
          description: >
            Type Of Money is to be stacked (the crux of this expression):
            * `1` - Dollar Coins
            * `100` - Hundred Dollar Bills
        - in: query
          name: verbose
          description: Whether to provide the result as a complete sentence summarizing the expression and its duration of time result (true) or a duration of time phrase (false).
          required: true
          schema:
            type: boolean
            example: false
      responses:
        200:
          description: a JSON object with response data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  data:
                    type: string
                    examples:
                      default:
                        value: "1,243 Miles (2,000 km)"
                        summary: The height phrase.
                      verbose:
                        value: "A person with a wealth of $1,000,000,000 would have a stack of dollar coins 1,243 Miles (2,000 km) high!"
                        summary: A complete sentence summarizing the expression and its height result.
                required:
                  - "status"
                  - "data"
        400:
          description: a JSON object with error data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: "400"
                      message:
                        type: string
                        example: "Wealth Missing"
                    required:
                      - "code"
                      - "message"
                required:
                  - "status"
                  - "error"

  /numberOfItems:
    get:
      summary: Returns the number of items that could be bought or paid for/off.
      description: Given a wealth and type of item, returns the number of specified-items the specified-wealth could buy or pay for/off.
      parameters:
        - in: query
          name: wealth
          description: Wealth is the amount of money to be described via this expression.
          required: true
          schema:
            type: number
            minimum: 1
            maximum: 1000000000000000
            example: 1000000000
        - in: query
          name: typeOfItem
          schema:
            type: string
            enum: ["10", "15", "175", "1400", "1750", "3000", "15080", "32240", "40000", "50000", "65000", "100000", "275000", "500000", "800000", "4000000", "30000000", "75000000", "200000000", "300000000", "600000000"]
          description: >
            Type Of Item is to be bought or paid for/off (the crux of this expression):
            * `10` - Fancy Coffee
            * `15` - Quick Meal
            * `175` - Dinner With Drinks
            * `1400` - iPhone
            * `1750` - Month Of Childcare
            * `3000` - Rent Or Mortgage Payment
            * `15080` - Year Of Low Minimum Wage Salary
            * `32240` - Year Of High Minimum Wage Salary
            * `40000` - Student Loan Debt
            * `50000` - Car
            * `65000` - Year Of $65,000 Salary
            * `100000` - Year Of $100,000 Salary
            * `275000` - Luxury Car
            * `500000` - House
            * `800000` - Yacht
            * `4000000` - Supercar
            * `30000000` - Island
            * `75000000` - Mansion
            * `200000000` - Estate With A Mega-Mansion
            * `300000000` - Luxury Island
            * `600000000` - Superyacht
        - in: query
          name: verbose
          description: Whether to provide the result as a complete sentence summarizing the expression and its number of items bought or paid for/off result (true) or a number of items bought or paid for/off phrase (false).
          required: true
          schema:
            type: boolean
            example: false
      responses:
        200:
          description: a JSON object with response data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  data:
                    type: string
                    examples:
                      default:
                        value: "2,000"
                        summary: The number of items bought or paid for/off phrase.
                      verbose:
                        value: "A person with a wealth of $1,000,000,000 could buy 2,000 houses all at once!"
                        summary: A complete sentence summarizing the expression and its number of items bought or paid for/off result.
                required:
                  - "status"
                  - "data"
        400:
          description: a JSON object with error data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: "400"
                      message:
                        type: string
                        example: "Wealth Missing"
                    required:
                      - "code"
                      - "message"
                required:
                  - "status"
                  - "error"

  /growthOfCompoundingInterest:
    get:
      summary: Returns the growth of compounding interest.
      description: Given a wealth and a rate, frequency, and period, returns the growth of a specified-wealth's compounding interest at a specified-rate and specified-frequency for a specified-period.
      parameters:
        - in: query
          name: wealth
          description: Wealth is the amount of money to be described via this expression.
          required: true
          schema:
            type: number
            minimum: 1
            maximum: 1000000000000000
            example: 1000000000
        - in: query
          name: rate
          description: Rate is the interest rate at which the wealth is compounded (one-third of the crux of this expression).
          required: true
          schema:
            type: number
            format: float
            minimum: 0
            maximum: 1
            example: 0.01
        - in: query
          name: frequency
          schema:
            type: string
            enum: ["1", "2", "4", "12", "365"]
          description: >
            Frequency is how often the wealth is compounded (one-third of the crux of this expression):
            * `1` - Annually
            * `2` - Semiannually
            * `4` - Quarterly
            * `12` - Monthly
            * `35` - Daily
        - in: query
          name: period
          description: Period is the duration of time over which the wealth is compounded (one-third of the crux of this expression).
          required: true
          schema:
            type: number
            minimum: 1
            maximum: 100
            example: 20
        - in: query
          name: verbose
          description: Whether to provide the result as a complete sentence summarizing the expression and its growth of compounded interest (true) or a growth of compounded interest phrase (false).
          required: true
          schema:
            type: boolean
            example: false
      responses:
        200:
          description: a JSON object with response data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  data:
                    type: string
                    examples:
                      default:
                        value: "By $220,190,040 Every 20 Years"
                        summary: The growth of compounded interest phrase.
                      verbose:
                        value: "With 1% interest compounded annually, a person with $1,000,000,000 would grow their wealth by $220,190,040 every 20 years!"
                        summary: A complete sentence summarizing the expression and its growth of compounded interest result.
                required:
                  - "status"
                  - "data"
        400:
          description: a JSON object with error data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: "400"
                      message:
                        type: string
                        example: "Wealth Missing"
                    required:
                      - "code"
                      - "message"
                required:
                  - "status"
                  - "error"
