You can connect with the API by sending a POST request to the following endpoint:
https://do-calculate.com/api/calculate-pregnancy-conception
Request Body:
The API expects a JSON object in the request body with the following properties:
{ "firstDayOfLastPeriod": 70, "cycleLength": 170 }
The API will respond with a JSON object containing the calculated values as shown in the following example:
{ "results": [ { "mostProbableConceptionWindowStart": "2023-01-13", "mostProbableConceptionWindowEnd": "2023-01-17", "mostProbableDatesSexualIntercourseStart": "2023-01-10", "mostProbabledatesSexualIntercourseEnd": "2023-01-17", "possibleConceptionWindowStart": "2023-01-12", "possibleConceptionWindowEnd": "2023-01-22", "possibleDatesSexualIntercourseStart": "2023-01-07", "possibleDatesSexualIntercourseEnd": "2023-01-22" } ] }
If the request is missing the required properties (firstDayOfLastPeriod or cycleLength), the API will respond with a 400 Bad Request status code and an error message.
If the weight or height is negative, the API will also respond with a 400 Bad Request status code and an error message.
curl -X POST -H "Content-Type: application/json" -d '{"firstDayOfLastPeriod":70,"cycleLength":170}' https://do-calculate.com/api/calculate-pregnancy-conception