add tag
I pulled this code from here:

I made some changes:

So the changed code:

# Quick script to check your Dell asset's warranty status
# Just drop your service tag as parameters for the script and go.

import sys
import requests

APIKEY = 'd676cf6e1e0ceb8fd14e8cb69acd812d'
URL = '{0}&apikey=' + APIKEY

def get_warr_from_dell(svctag):
    res = requests.get(URL.format(svctag))

    if res.status_code != 200:
        sys.stderr.write('[%s] Caught %i as the response code.\n' % (svctag, res.status_code))
        sys.stderr.write('[%s] Unable to get details for given service tag.\n'
                % svctag)
        return False

    fault = res.json['GetAssetWarrantyResponse']['GetAssetWarrantyResult']['Faults']
    if fault is not None:
        sys.stderr.write("[%s] Failed to find details. Sure it's a valid TAG?\n" % svctag )
        return False

    asset = res.json['GetAssetWarrantyResponse']['GetAssetWarrantyResult']['Response']['DellAsset']
    model = asset['MachineDescription']
    ent = asset['Warranties']['Warranty']
    shipped = asset['ShipDate']

print ('Service Tag:        ', svctag)
    print (' Model:             ', model)
    print (' Shipped:           ', shipped, '\n')
    print ('{0:<20} {1:>15}'.format(*('Warranty Ends','ServiceLevelDescription')))
    for warr in [(d['EndDate'],d['ServiceLevelDescription']) for d in ent]:
        print ('{0:<20} {1:>15}'.format(*warr))

if __name__ == '__main__':

[The errors and updates that come after running the above - scroll to the last code block of the highlighted comment][1].

The error that come after running the above:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /support/v2/assetinfo/detail/tags.json? (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fa83d980850>: Failed to establish a new connection: [Errno -3] Try again'))

** Process exited - Return Code: 1 **
Press Enter to exit terminal 
I have tried searching parts of errors but landed on nothing. Help is highly appreciated.
Also I tried making myself an API link(dunno if I made it correctly) by putting the api key and a working service tag to the URL and got something - and I can't find the browser history for it. But it looked exacltly like this, which is what you get on the
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<soapenv:envelope xmlns:soapenv="">
<faultstring>Policy Falsified
<l7:policyresult xmlns:l7="" status="Service Not Found. The request may have been sent to an invalid URL, or intended for an unsupported operation.">


Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.