You can use a Panchang API that returns tithi, nakshatra, yoga, and karana based on the selected date. One option: Panchang API. Just call the API with the date and update your UI with the response.