import requests
import json


def CoinNames(n=None):
    """Gets ID's of all coins on cmc"""

    names = []
    response = requests.get("https://api.coinmarketcap.com/v1/ticker/?limit=0")
    respJSON = json.loads(response.text)
    for i in respJSON[:n]:
        names.append(i['id'])
    return names