You can connect with the API by sending a POST request to the following endpoint:
https://do-calculate.com/api/calculate-gold-karat
Request Body:
The API expects a JSON object in the request body with the following properties:
{ "goldWeight": 42, "goldKarat": 22 }
The API will respond with a JSON object containing the calculated weights for different karats of gold. The response will have the following structure:
{ "result": { "karat_24": "45.82", "karat_22": "42.00", "karat_21": "40.09", "karat_18": "34.36", "karat_14": "26.73", "karat_10": "19.09" } }
IIf the request is missing any of the required properties (goldWeight or goldKarat), the API will respond with a 400 Bad Request status code and an error message.
curl -X POST -H "Content-Type: application/json" -d '{"goldWeight":42,"goldKarat":22}' https://do-calculate.com/api/calculate-gold-karat