def get_with_url(url):
 try:
  params = {'url': url, 'client_id': api_key}
  request = requests.get(API_BASE.format('resolve'), params=params)
  request.raise_for_status()
 except (requests.exceptions.HTTPError, requests.exceptions.ConnectionError) as e:
  raise APIError('{}'.format(e))
 json = request.json()
 if (not json):
  return None
 else:
  return json

def get_with_url ( url ) : try : params = { 'url' : url , 'client_id' : api_key } request = requests . get ( API_BASE . format ( 'resolve' ) , params = params ) request . raise_for_status ( ) except ( requests . exceptions . HTTPError , requests . exceptions . ConnectionError ) as e : raise APIError ( '{}' . format ( e ) ) json = request . json ( ) if ( not json ) : return None else : return json
takes a soundcloud url and returns an item .