import requests


def get_from_url(url, headers):
	"""
	Given a url, return the API response.
	Parameters: 
		url: string, the url
		headers: dict, the headers to send with the request to the URL
	Returns: API response, in dict form
	"""
	r = requests.get(url, headers=headers).json()
	if 'error' in r.keys():
		raise RuntimeError('API response error' + str(r))
	return r