README

# We > Ultrarich API Overview

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.

Our APIs are served over HTTPS with a Base URL of https://api.wegtultrarich.org/v1. We provide our APIs without authentication, but with a rate limit of 100 requests per minute.

We > Ultrarich (We Are Greater Than The Ultrarich) and this work are licensed under CC BY-NC-SA 4.0.


## List Available Wealth Expressions

GET /v1/expressions

Example Request
```bash
curl "https://api.wegtultrarich.org/v1/expressions"
```

Example Response
```bash
{"status":"success","data":[{"route":"/v1/durationOfDailySpend"},{"route":"/v1/heightOfMoneyStack"},{"route":"/v1/numberOfItems"},{"route":"/v1/growthOfCompoundingInterest"}]}
```


## Duration Of Daily Spend
The "Duration Of Daily Spend" expression describes a specified wealth as the duration of time a specified amount of money could be spent daily.

GET /v1/durationOfDailySpend

Parameters Or Queries

wealth			<number or string>		Required
Wealth is the amount of money to be described via this expression. Supports a range of money-related ways to specify the value of wealth (from 1000000000 to 1,000,000,000 to 1B). Must contain a numeric value ("one billion" is not valid). Must be positive (-1B is not valid). Can contain a symbol-based currency indicator if it is URL-encoded ("$" and dollar" are not valid, but "%24" is valid). Notes: Currency defaults to $. No currency conversion/exchange will be done.

spend			<number or string>		Required
Spend is the amount of money to be spent daily (the crux of this expression). Supports a range of money-related ways to specify the value of wealth (from 1000 to 1,000 to 1K). Must contain a numeric value ("one thousand" is not valid). Must be positive (-1K is not valid). Can contain a symbol-based currency indicator if it is URL-encoded ("$" and dollar" are not valid, but "%24" is valid). Notes: Currency defaults to whatever wealth had. No currency conversion/exchange will be done.

verbose			<boolean>
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). Optional. Defaults to 0 or false (duration of time phrase).

Example Request #1
```bash
curl "https://api.wegtultrarich.org/v1/durationOfDailySpend?wealth=1B&spend=1000"
```

Example Response #1
```bash
{"status":"success","data":"3 Millennia (2,740 Years)"}
```

Example Request #2
```bash
curl "https://api.wegtultrarich.org/v1/durationOfDailySpend?wealth=1B&spend=1000&verbose=1"
```

Example Response #2
```bash
{"status":"success","data":"A person with a wealth of $1,000,000,000 could spend $1,000 every day for 3 Millennia (2,740 Years)."}
```

Example Request #3
```bash
curl "https://api.wegtultrarich.org/v1/durationOfDailySpend?wealth=%E2%82%AC1,000,000,000&spend=1K&verbose=1"
```

Example Response #3
```bash
{"status":"success","data":"A person with a wealth of €1,000,000,000 could spend €1,000 every day for 3 Millennia (2,740 Years)."}  
```

Example Request #4
```bash
curl "https://api.wegtultrarich.org/v1/durationOfDailySpend?wealth=$1B&spend=1K&verbose=0"
```

Example Response #4
```bash
{"status":"error","error":{"code":400,"message":"Wealth Zero Or Not-a-Number"}}
```

Example Request #5
```bash
curl "https://api.wegtultrarich.org/v1/durationOfDailySpend?wealth=1B&spend=-1,000&verbose=0"
```

Example Response #5
```bash
{"status":"error","error":{"code":400,"message":"Spend Negative Or Not-a-Number"}}
```

Example Request #6
```bash
curl "https://api.wegtultrarich.org/v1/durationOfDailySpend?spend=1000"
```

Example Response #6
```bash
{"status":"error","error":{"code":400,"message":"Wealth Missing"}}
```


## Height Of Money Stack
The "Height Of Money Stack" expression describes a specified wealth as the height of a stack of specified money.

GET /v1/heightOfMoneyStack

Parameters Or Queries

wealth			<number or string>		Required
Wealth is the amount of money to be described via this expression. Supports a range of money-related ways to specify the value of wealth (from 1000000000 to 1,000,000,000 to 1B). Must contain a numeric value ("one billion" is not valid). Must be positive (-1B is not valid). Can contain a symbol-based currency indicator if it is URL-encoded ("$" and dollar" are not valid, but "%24" is valid). Notes: Currency defaults to $. No currency conversion/exchange will be done.

typeOfMoney		<enum>					Required
Type Of Money is to be stacked (the crux of this expression). This value must be either:
* 1 for Dollar Coins; or
* 100 for Hundred Dollar Bills.

verbose		<boolean>
Whether to provide the result as a complete sentence summarizing the expression and its height result (true) or a height phrase (false). Optional. Defaults to 0 or false (height phrase).

Example Request #1
```bash
curl "https://api.wegtultrarich.org/v1/heightOfMoneyStack?wealth=1B&typeOfMoney=1"
```

Example Response #1
```bash
{"status":"success","data":"1,243 Miles (2,000 km)"}
```

Example Request #2
```bash
curl "https://api.wegtultrarich.org/v1/heightOfMoneyStack?wealth=1B&typeOfMoney=1&verbose=1"
```

Example Response #2
```bash
{"status":"success","data":"A person with a wealth of $1,000,000,000 would have a stack of dollar coins 1,243 Miles (2,000 km) high."}
```

Example Request #3
```bash
curl "https://api.wegtultrarich.org/v1/heightOfMoneyStack?wealth=%E2%82%AC1,000,000,000&typeOfMoney=100&verbose=1"
```

Example Response #3
```bash
{"status":"success","data":"A person with a wealth of €1,000,000,000 would have a stack of hundred dollar bills 3,608.9 Feet (1 km) high."}
```

Example Request #4
```bash
curl "https://api.wegtultrarich.org/v1/heightOfMoneyStack?wealth=$1B&typeOfMoney=1&verbose=0"
```

Example Response #4
```bash
{"status":"error","error":{"code":400,"message":"Wealth Zero Or Not-a-Number"}}
```

Example Request #5
```bash
curl "https://api.wegtultrarich.org/v1/heightOfMoneyStack?wealth=1B&typeOfMoney=2&verbose=0"
```

Example Response #5
```bash
{"status":"error","error":{"code":400,"message":"Type Of Money Invalid"}}
```

Example Request #6
```bash
curl "https://api.wegtultrarich.org/v1/heightOfMoneyStack?typeOfMoney=100"
```

Example Response #6
```bash
{"status":"error","error":{"code":400,"message":"Wealth Missing"}}
```


## Number Of Items Bought Or Paid For/Off
The "Number Of Items" expression describes a specified wealth as the number of specified items that could be bought or paid for/off.

GET /v1/numberOfItems

Parameters Or Queries

wealth			<number or string>		Required
Wealth is the amount of money to be described via this expression. Supports a range of money-related ways to specify the value of wealth (from 1000000000 to 1,000,000,000 to 1B). Must contain a numeric value ("one billion" is not valid). Must be positive (-1B is not valid). Can contain a symbol-based currency indicator if it is URL-encoded ("$" and dollar" are not valid, but "%24" is valid). Notes: Currency defaults to $. No currency conversion/exchange will be done.

typeOfItem		<enum>					Required
Type Of Item is to be bought or paid for/off (the crux of this expression). This value must be one of the following:
* 10 for Fancy Coffee;
* 15 for Quick Meal;
* 175 for Dinner With Drinks;
* 1400 for iPhone;
* 1750 for Month Of Childcare;
* 3000 for Rent Or Mortgage Payment;
* 15080 for Year Of Low Minimum Wage Salary;
* 32240 for Year Of High Minimum Wage Salary;
* 40000 for Student Loan Debt;
* 50000 for Car;
* 65000 for Year Of $65,000 Salary;
* 100000 for Year Of $100,000 Salary;
* 275000 for Luxury Car;
* 500000 for House;
* 800000 for Yacht;
* 4000000 for Supercar;
* 30000000 for Island;
* 75000000 for Mansion;
* 200000000 for Estate With A Mega-Mansion;
* 300000000 for Luxury Island; or
* 600000000 for Superyacht.

verbose		<boolean>
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). Optional. Defaults to 0 or false (number of items bought or paid for/off phrase).

Example Request #1
```bash
curl "https://api.wegtultrarich.org/v1/numberOfItems?wealth=1B&typeOfItem=500000"
```

Example Response #1
```bash
{"status":"success","data":"2,000"}
```

Example Request #2
```bash
curl "https://api.wegtultrarich.org/v1/numberOfItems?wealth=1B&typeOfItem=500000&verbose=1"
```

Example Response #2
```bash
{"status":"success","data":"A person with a wealth of $1,000,000,000 could buy 2,000 houses all at once!"}
```

Example Request #3
```bash
curl "https://api.wegtultrarich.org/v1/numberOfItems?wealth=%E2%82%AC1,000,000,000&typeOfItem=500000&verbose=1"
```

Example Response #3
```bash
{"status":"success","data":"A person with a wealth of €1,000,000,000 could buy 2,000 houses all at once!"}
```

Example Request #4
```bash
curl "https://api.wegtultrarich.org/v1/numberOfItems?wealth=$1B&typeOfItem=500000&verbose=0"
```

Example Response #4
```bash
{"status":"error","error":{"code":400,"message":"Wealth Zero Or Not-a-Number"}}
```

Example Request #5
```bash
curl "https://api.wegtultrarich.org/v1/numberOfItems?wealth=1B&typeOfItem=2&verbose=0"
```

Example Response #5
```bash
{"status":"error","error":{"code":400,"message":"Type Of Item Invalid"}}
```

Example Request #6
```bash
curl "https://api.wegtultrarich.org/v1/numberOfItems?typeOfItem=500000"
```

Example Response #6
```bash
{"status":"error","error":{"code":400,"message":"Wealth Missing"}}
```



## Growth Of Compounding Interest
The "Growth Of Compounding Interest" expression describes the growth over a specified period of time that would result from a specified wealth compounding at a specified frequency at a specified interest rate.

GET /v1/growthOfCompoundingInterest

Parameters Or Queries

wealth			<number or string>		Required
Wealth is the amount of money to be described via this expression. Supports a range of money-related ways to specify the value of wealth (from 1000000000 to 1,000,000,000 to 1B). Must contain a numeric value ("one billion" is not valid). Must be positive (-1B is not valid). Can contain a symbol-based currency indicator if it is URL-encoded ("$" and dollar" are not valid, but "%24" is valid). Notes: Currency defaults to $. No currency conversion/exchange will be done.

rate			<number>				Required
Rate is the interest rate at which the wealth is compounded (one-third of the crux of this expression). Must be a positive number between 0 and 1 (non-inclusive), where 0.01 represents 1%.

frequency		<enum>					Required
Frequency is how often the wealth is compounded (one-third of the crux of this expression). This value must be one of the following:
* 1 for Annually;
* 2 for Semiannually;
* 4 for Quarterly;
* 12 for Monthly; or
* 365 for Daily.

period			<number>				Required
Period is the duration of time over which the wealth is compounded (one-third of the crux of this expression). Must be a positive number between 0 and 100 (non-inclusive), where 1 represents one year.

verbose		<boolean>
Whether to provide the result as a complete sentence summarizing the expression and its growth of compounding interest result (true) or a growth of compounding interest phrase (false). Optional. Defaults to 0 or false (growth of compounding interest phrase).

Example Request #1
```bash
curl "https://api.wegtultrarich.org/v1/growthOfCompoundingInterest?wealth=1B&rate=0.01&frequency=1&period=20"
```

Example Response #1
```bash
{"status":"success","data":"By $220,190,040 Every 20 Years"}
```

Example Request #2
```bash
curl "https://api.wegtultrarich.org/v1/growthOfCompoundingInterest?wealth=1B&rate=0.01&frequency=1&period=20&verbose=1"
```

Example Response #2
```bash
{"status":"success","data":"With 1% interest compounded annually, a person with $1,000,000,000 would grow their wealth by $220,190,040 every 20 years!"}
```

Example Request #3
```bash
curl "https://api.wegtultrarich.org/v1/growthOfCompoundingInterest?wealth=%E2%82%AC1,000,000,000&rate=0.01&frequency=1&period=20&verbose=1"
```

Example Response #3
```bash
{"status":"success","data":"With 1% interest compounded annually, a person with €1,000,000,000 would grow their wealth by €220,190,040 every 20 years!"}
```

Example Request #4
```bash
curl "https://api.wegtultrarich.org/v1/growthOfCompoundingInterest?wealth=$1B&rate=0.01&frequency=1&period=20&verbose=0"
```

Example Response #4
```bash
{"status":"error","error":{"code":400,"message":"Wealth Zero Or Not-a-Number"}}
```

Example Request #5
```bash
curl "https://api.wegtultrarich.org/v1/growthOfCompoundingInterest?wealth=1B&rate=2&frequency=1&period=20&verbose=0"
```

Example Response #5
```bash
{"status":"error","error":{"code":400,"message":"Rate Invalid"}}
```

Example Request #6
```bash
curl "https://api.wegtultrarich.org/v1/growthOfCompoundingInterest?rate=0.01&frequency=1&period=20&verbose=0"
```

Example Response #6
```bash
{"status":"error","error":{"code":400,"message":"Wealth Missing"}}
```
