Git Product home page Git Product logo

api-scavenger-hunt's Introduction

API Scavenger Hunt

Part One

API Scavenger Hunt!

For each of the questions below, identify a website and search query that will give you the appropriate JSON. Once you find the API's site, read the docs and use Insomnia or curl to find the URL that gives you the JSON response you're looking for.

Paste the URL and a snippet of the JSON below. You will edit this very document as part of the assignment.

Put the json between two sets of three backticks. If you want, put the word json right after the first set of three backticks.

It might help you to look at the below section in the non-rendered README view.

Googling the category + API will generally take you to where you need. e.g. "cat fact api".

Example:

  • A random cat fact

https://catfact.ninja/fact

{
  "fact": "The name \"jaguar\" comes from a Native American word meaning \"he who kills with one leap\".",
  "length": 89
}

Here are all the APIs to find!

  • A list of 150 random users in English.

https://randomuser.me/api/?results=150

 "info": {
    "seed": "3524f08526d05b27",
    "results": 150,
    "page": 1,
    "version": "1.3"
  }
  • All the repos on Github with Pursuit their name

https://api.github.com/search/repositories?q={pursuit}

{
  "total_count": 1100,
  "incomplete_results": false,
  "items": [
    {
  • All the JavaScript repos on Github with Pursuit in their name

  • All the Swift repos on Github with Pursuit in their name

  • A list of all Pokemon https://pokeapi.co/api/v2/pokemon

  "count": 1118,
  "next": "https://pokeapi.co/api/v2/pokemon?offset=20&limit=20",
  "previous": null,

  "lastUpdate": 0,
  "lanuage": "en",
  "data": [
    {
      "itemId": "5bac8575-992e-41db-b23c-8d5646d8f586",
      "lastUpdate": 1615175701,
      "item": {
        "name": "Silver Surfer (Bundle)",
        "description": null,
        "type": "bundle",
        "rarity": "epic",
        "series": "marvel",
        "cost": 2200,
        "upcoming": false,
  • A list of all Game of Thrones Episodes.

  • A list of all songs with "Love" in the title.

  • All information about Petyr Baelish from the Game of Thrones books

  • All the movies Leonardo Dicaprio has acted in

Part Two

For this exercise use the Todos API.

Try out all requests you can think of in this API, the docs are a good starting point.

  1. Create an answers.json file in the root of this repo. Copy the json below to your file.
  2. For each request add a new object to the requests array in your json file, in the same format seen below. Try to keep your json syntax valid.
  3. Find all the 9 possible status codes this API returns and add them to statusCodesFound in your json file. You will have to use different HTTP methods, as well as query strings
{
  "requests": [
    {
      "method": <METHOD>,
      "endpoint": /api/something,
      "description": EXPLAIN WHAT THE REQUEST DOES IN YOUR OWN WORDS,
      "responseStatusCode": ###,
      "statusCodeMeaning": WHAT DOES THIS STATUS CODE MEAN
    },
    {
      "method": "GET",
      "endpoint": "/api/todos",
      "description": "Returns a list of all todos",
      "responseStatusCode": 200,
      "statusCodeMeaning": "The request was successful"
    }
  ],
  "statusCodesFound": [200, ...]
}

Hints

  • It went just ๐Ÿ†—
  • Users cannot have fullname
  • There's one hint "hidden in plain sight" in the documentation of the API.
  • Bad, bad, bad request!
  • What does God got to do?
  • Can't remove it twice?!?
  • There's a lot of methods to try.
  • How does this API handle duplicates?
  • 200 is different from 201?

Bonuses

  1. Take a look at the upcoming lessons to learn how to make make network requests with JavaScript (hint: fetch). Since you previously had build a simple Todos App with HTML and now you know how to manipulate the DOM, add some JS to try to connect your Todos app to this API so that todos you enter in the page are saved to the API. Marking a todo as complete or uncompleted should work.
  2. Find the easter egg hidden in the API. You'll know it when you see a gif appear.

References

api-scavenger-hunt's People

Contributors

benstone1 avatar davidlawrencer avatar jabyess avatar coreyladovsky avatar bedonjonathan avatar

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.