Code Challenge 16 - Query Your Favorite API - Review

Posted by PyBites on Sun 30 April 2017 in Challenges • 2 min read

It's end of the week again so we review the code challenge of this week: Query Your Favorite API. It's never late to join, just fork us and start coding.

PyBites

Julian

As I discussed in my post this week about learning Python, this code challenge was pretty much directed at me.

Going into this one, I'd never accessed an API in my life!

I spent the entire week playing around with different APIs but primarily the World of Warcraft and Gmail APIs.

The work with the Gmail API was great learning but essentially a bust when it came to having a working script. I had an idea in mind as to what I wanted from it but I just wasn't able to get it done.

I did have a little more success with the World of Warcraft API however. I'm sure it means nothing to most of you reading this but I was able to pull down data about my player character and have it presented in a readable format. (JSON was also new to me!).

The code for this is here. As it was my first API attempt, it is definitely quite simplistic. The intention is to wrap it all up such that I can recreate my character profile locally.

Bob

I used various APIs this week:

google books autocomplete 1

When you select a title it redirects to a page where it pulls more details from the Google Books API (buttons not yet implemented):

google books autocomplete 2

Community

We got 2 cool Pull Requests. We are really stoked you submit code to our repo. Good work folks, keep up the momentum!

Clamytoe

Martin submitted a cool project called GitHub-Profiler where he queries the Github API for a given user, entering 'pybites' it generates this nice page, awesome:

github api 1

If bio and repos was not enough, scrolling towards the end it also lists gists:

github api 2

Code merged on our community branch.

Dseptem

Another usage of APIs we got from Dante who used the Forismatic API to pull random quotes. The author's bio gets crawled from Wikipedia, really nice:

Forismatic api 1

When you hit "Another Quote!" the page refreshes and shows another random quote and its author + bio:

Forismatic api 2

Code merged on our community branch.


We hope you are enjoying these challenges, learning along the way. Let us know if you have any issue and/or contact us if you want to submit a cool challenge. See you next week ...


Keep Calm and Code in Python!

-- Bob and Julian


See an error in this post? Please submit a pull request on Github.

Join our community and grab our Become a Better Python Developer cheat sheet. Learn Python. Receive bonus material. Challenge yourself!