Get api url by javascript