import requests
import time


def call_crossref_api(doi):
    """
    Calls the crossref works API for a given DOI.
    """
    url = "http://api.crossref.org/works/{}".format(doi)
    headers = {
        "User-Agent": "JournalsDB/1.1 (https://journalsdb.org; mailto:team@ourresearch.org)"
    }
    r = requests.get(url, headers=headers)
    time.sleep(0.2)
    return r