How to read an OTP out of an email programmatically

The endpoint extracts the code server-side and returns it as a JSON field, so you do not parse MIME or HTML.

Run it

curl -s https://api.model.tools/api/v1/inbox/myinbox/latest_otp | jq -r .otp

Response

448291