Convert Amounts
GET {{baseUrl}}/recipes/convert?ingredientName=flour&sourceAmount=2.5&sourceUnit=cups&targetUnit=grams
Convert amounts like 2 cups of flour to grams
.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
ingredientName | string | (Required) The ingredient which you want to convert. | |
sourceAmount | string | (Required) The amount from which you want to convert, e.g. the 2.5 in "2.5 cups of flour to grams". | |
sourceUnit | string | (Required) The unit from which you want to convert, e.g. the grams in "2.5 cups of flour to grams". You can also use "piece", e.g. "3.4 oz tomatoes to piece" | |
targetUnit | string | (Required) The unit to which you want to convert, e.g. the grams in "2.5 cups of flour to grams". You can also use "piece", e.g. "3.4 oz tomatoes to piece" |
RESPONSES
status: OK
{"sourceAmount":2.5,"sourceUnit":"cups","targetAmount":312.5,"targetUnit":"grams","answer":"2.5 cups flour translates to 312.5 grams."}