A little patch:

if self.p.apikey is not None: urlargs.append('api_key=%s' % self.p.apikey)

There was a typo previously.