Made a few tweaks, that helped me below. Each lookup is a direct query by id, so it only returns one row. Also if a id isnt found, returns 0, instead of the BITCOIN price.
function search(cmcId, myArray) {
for (var i=0; i < myArray.length; i++) {
if (myArray[i].id == cmcId) {
return myArray[i];
}
}
return 0;
}
function cmc(cmcId, key, rand) {
var url = "https://api.coinmarketcap.com/v1/ticker/" + cmcId + "?convert=USD&limit=0";
var response = UrlFetchApp.fetch(url);
var text = response.getContentText();
var obj_array = JSON.parse(text);
var obj = search(cmcId, obj_array);
var value = obj[key];
return parseFloat(value);
}