Javascript is increasingly becoming my language of choice and I’m moving more closer and love staying on the Web. With great power, comes great responsibility. Anyway… this was my first experiments with API within JS. The API were simple JSON REST that I borrowed from An API of Ice and Fire, which is basically, a user-generated API for Game of Thrones.

I created a very simple HTML structure, with simple CSS hover animations and pulled the characters information to populate the page. The page loads at random, where I generate a random variable and map it to the character number on the API, thus pulling all the character’s relevant info. For simplicity, I mapped this to only 10 characters from the 580+ that are present on the API. Reason being, this API is pretty incomplete and doesn’t have images, as they are built by fans/users. Hence I also had to additionally map the background image generation.

It’s itching me to explore this (API in general) so much more, but I’m kinda cold with just managing to make so much. I hope to generate much more entertaining applications with APIs in future. For now, a little ice and loads of fire to follow. You can see the full working of this demo at Github.

Note: Of course, the music is borrowed from the original soundtrack of Game of Thrones, HBO series.