title: how to download JSON file using Python from a URL with authentication key
body: <p>I am trying to download JSON files from a website that is being accessed with username and password (API service), but without success.</p>
  
  <p>I am using Python3.</p>
  
  <p>Using the one below, I get an 'invalid syntax' error:</p>
  
  <pre><code>NG_AT = urllib.request.urlretrieve(('https://agsi.gie.eu/api/data/AT?limit=7', auth=(username, api_token)), 'AT.json')
  </code></pre>
  
  <p>I need to be able to download the <code>.json</code> file that exists in the above link directly to a file called 'AT.json'.</p>