def get_with_search(endpoint, term):
 try:
  params = {'q': term, 'client_id': api_key}
  request = requests.get(API_BASE.format(endpoint), params=params)
  request.raise_for_status()
 except (requests.exceptions.HTTPError, requests.exceptions.ConnectionError) as e:
  raise APIError('Could not find {}: {}'.format(endpoint, e))
 json = request.json()
 if (not json):
  return None
 else:
  return json[0]

def get_with_search ( endpoint , term ) : try : params = { 'q' : term , 'client_id' : api_key } request = requests . get ( API_BASE . format ( endpoint ) , params = params ) request . raise_for_status ( ) except ( requests . exceptions . HTTPError , requests . exceptions . ConnectionError ) as e : raise APIError ( 'Could not find {}: {}' . format ( endpoint , e ) ) json = request . json ( ) if ( not json ) : return None else : return json [ 0 ]
searches :endpoint on soundcloud for :term and returns an item .