magento2 – How to calculate dynamic shipping amount based on address in Magento 2.4

In my shopping card build using Magento2.4.2 , I need a dynamic calculation of shipping amount after going to next step after entering the shipping address. What I need is to make a third party api call to calculate shipping value based on address entered. I begin with the following URL but It gives a static shipping value only. I have attached the screenshot of step1 and step2 which will make some sense of what I need. I want to customise the module given in the link to achieve this. I have reffed many articles but could not find a solution. Someone please help to achieve this. The code I have added in same as in the link here

Step 1 : After entering address
Screen 1

Step 2 : Before finalising payment. Here the shipping should not be 0 it should vary according to the address value
enter image description here

Note: I can manage to do the third party call, leave it for me, What I need is to get is where to hook the magento to modify the shipping value.

Thanks in advance