Hi guys, I'm new here. Just started getting serious about Mathematica yesterday and I'm already getting stumped. What I'm trying to do is import a JSON file from an API of a card game and then make it into a dataset that I can query. At the moment this is the code I have:
apiURL = "https://api.hearthstonejson.com/v1/13921/enUS/cards.json";
hearthJSON = Import[apiURL, "JSON"];
hearthDB = Dataset[hearthJSON];
card001 = hearthDB[[1]]
I get this when I evaluate the last line above. The problem is this output is in a formatted table of some sort inside of Mathematica, it doesn't seem to be an association despite how it pastes on here. Another problem is that Part[] would easier to use if the keys were mapped to the names of the cards instead of an integer.
"type"->"MINION"
"set"->"EXPERT1"
"mechanics"->{"CHARGE"}
"health"->1
"race"->"BEAST"
"name"->"Hound"
"id"->"EX1_538t"
"cost"->1
"text"->"<b>Charge</b>"
"playerClass"->"HUNTER"
"attack"->1
Basically I want to figure out how to do two things:
(*Return cards by using the name of the card*)
hearthDB[["Hound"]]
(*Return a list of cards that share an attribute*)
hearthDB[["HUNTER"]]
I've been digging around the documentation for about six hours now. I think maybe I should be using Lookup[] instead. Anyway, thanks in advance!