What the heck is an API?

API stands for 'Application Programming Interfaces'

They are like special instructions that help different computer programs talk to each other.

Imagine you and your friend speak different languages, but you have a magic translator who helps you understand each other.

In the world of computers, APIs are like those magic translators. They allow one computer program to ask another program for information or help with tasks. For example, when you use a weather app on your tablet, it talks to a weather API to find out what the weather is like outside and then shows you the forecast.

APIs are like secret codes that let programs share information and work together, making your favorite apps and games even more amazing!

Introduction to Using APIs

You don’t need advanced JS knowledge to use APIs but it helps to understand the following:

  1. Arrays
  2. Objects
  3. DOM manipulation basics (getting elements by ID and handling click events)
  4. The window.fetch method and promises (not totally necessary but helps)

Here’s an intro video to get you started 👉 https://youtu.be/4naH4qczQCg

New York Times API Challenge

Now that you know the basics of APIs, let’s build something more advanced.

We are going to build a small app that searches the New York Times API for articles based on a user’s input.

Let’s get started:

  1. Create an account at https://developer.nytimes.com/accounts/create

Screenshot 2023-11-21 at 4.32.25 PM.png

  1. Login with your credentials and create a new app

    Screenshot 2023-11-21 at 4.34.47 PM.png