import requests
import json


def getJSON(api_url):
    
    """ Return list containing details relating to articles from news API

    Parameters:
        api_url (str):The url string to access news API

    Returns:
        article_list:list   

    """
    response = requests.get(api_url)
    articles = response.json()
    articles_prettify = json.dumps(articles, indent = 2)
    articles_dict = json.loads(articles_prettify)
    article_list = articles_dict['articles']
    return(article_list)