There's a site called NPI registry lookup which will show the information about the doctor you're searching for. i am getting this error XMLHttpRequest cannot load https://npiregistry.cms.hhs.gov/api/?number=1306935523. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:58202' is therefore not allowed access.
<script type="text/javascript">
$(document).ready(function () {
$('#btnGetNpi').click(function () {
$.ajax({
async: true,
crossDomain: true,
url: 'https://npiregistry.cms.hhs.gov/api/?number=' + $('#txtnpi').val(),
method: 'get',
dataType: 'json',
success: function (data) {
debugger;
resultElement.html('FirstName:' + data.basic[0].first_name);
},
error: function (jqXHR, exception) {
alert(exception);
}
});
});
});
</script>
</div>