Hi @Krithika K ,Welcome to Microsoft Q&A.
Don't know the api, but you can refer to this link:Install .NET on Windows.
You need to use it according to the system you need. At present, if you don't want to go directly to the official website to download the exe for free, you can use the command line to download it.
You can also use: https://github.com/dotnet/runtime/releases/latest to get the latest resources.
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.