There are quite a multiple options that you can use to get the JSON data from this API URL. You can use ajax requests to download the data from the API. The following code would depict a scenario,
$.ajax({
url: 'http://transapi.ksoftware.co.in/api/CityApi',
success: function (data) {
}
});
The above method can be applied even if your HTML page is not backed up by a server-side code; you can execute it through JavaScript's library jQuery. It would download your data and perform the actions that you will write in the
success
handler.
If you are using some other sort of third-party library. That library would expose a very efficient function or class that would download this JSON string. If there is none, you can still use .NET framework's
HttpClient[
^] to send requests to server and download the data in JSON format and use libraries like
Newtonsoft.Json[
^] and deserialize the data.