import requests
import time
import json


def getinfo(IDs):
    """
    Pulls and returns data about specific loans from the Kiva API.
    Includes a time sleep to ensure that usage limits aren't exceeded.
    :param IDs: A list of up to 100 loan ids to get info for.
    :return loans: A list of dictionaries containing the full information.
    """
    response = requests.get("http://api.kivaws.org/v1/loans/" + IDs + ".json",
                            params={"appid": "com.woodside.autotag"})
    time.sleep(60 / 55)
    loans = json.loads(response.text)["loans"]
    return loans