Git Product home page Git Product logo

y2l-apis-intro-lab's Introduction

Before you start: Fork and clone this repository

  1. Fork this repository by clicking "Fork" on this page: forking

  2. Copy this repository's url by clicking the green clone button: copying url

Part 1: JSON manipulation

Start the server by running the app.py file (python app.py) and go to the homepage and click around to understand what's already provided for you.

Change the /moviefunction (in app.py). Look at the json_string variable change it form JSON string to python idct format and return to the user the details about the movie specified in the variable json_string

  • When you visit http://127.0.0.1:5000/movie you should be able to see the title of the movie, the release date, and display an image of the movie

Bonus:

Change the /tv_shows function and use the json_string variable to show now a list of the tv shows (you will have to change it from a JSON string to python dict like you did before). Visiting http://127.0.0.1:5000/tv_shows should show you a list of TV shows that have name, language, and genres for the show

Part 2: Calling your first APIs!

The documentation for thefirst API you will be working with can be found here: https://dog.ceo/dog-api/documentation/

If you visit https://dog.ceo/api/breeds/list/all a list of all dog breeds is returned. Try this in your browser! (Chrome/firefox)

Using the requests library (as shown in the slides) Do a GET request to the link above to get all dog breeds and return them to them as a list to the user as a bullet pointed list

Bonus:

Calling https://dog.ceo/api/breed/BREED_NAME_HERE_INSTEAD/images/random

With a provided returns an image, Example:

Create a new route and html page that has a text box, when the user write a name of a breed it returns an image using the API url above

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.