Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
API for beginners JavaScript Getting Started with APIs AJAX
Rating: 4.1 out of 5(110 ratings)
3,898 students

API for beginners JavaScript Getting Started with APIs AJAX

Explore using JavaScript XHR and fetch to connect to multiple web API endpoints retrieve JSON data and update HTML
Created byLaurence Svekis
Last updated 11/2024
English
English [Auto],

What you'll learn

  • Use AJAX to get JSON data into their web pages
  • Use XHR requests to connect to servers and APIs
  • Explore how to connect to APIs

Course content

2 sections25 lectures1h 39m total length
  • API course introduction4:13

    Learn to connect to APIs with JavaScript and Ajax, retrieve JSON data, and dynamically update HTML without page refresh. Build familiarity with fetch, JSON parse, and API endpoints.

  • Source Code and downloadable files for the course.0:24
  • web developer setup4:53

    Explore API tools with the brackets editor and Chrome DevTools, and set up a simple HTML page to practice fetch requests against JSON placeholder endpoints.

  • JavaScript XHR request AJAX4:57

    Create and configure an XMLHttpRequest to fetch API data with GET, open and send the request, track readyState changes, and log the response to the console.

  • Tweak and Adjust AJAX request2:49

    Learn how ajax requests fetch data from a web API, handle status codes like 200, 404, and 500, and convert response text to an object using JavaScript methods.

  • JSON methods Parse to JavaScript Objects4:53

    Turn string data into a JavaScript object with JSON.parse to access category, icon URL, id, url, and value, then display it on the page.

  • Quick Jokes api Click Button Get Joke1:49

    Learn to wire a button click to a joke API using querySelector and an event listener in JavaScript, fetching a new joke via Ajax and updating the page content.

  • Code Tweak AJAX.2:35

    Learn to enhance ajax requests by checking ready state and status 200, handling errors, and using event listeners such as progress, load, and error to monitor API calls.

  • Getting Results AJAX8:52

    Connect to the random user API using an XMLHttpRequest, pass a numeric results parameter, and handle onload to retrieve and display emails on the page.

  • Error handling and updates2:15

    Master error handling in API requests by checking on load, ready state, and status 200, grasp JSON over CSV, and prepare for promises with fetch in the next lesson.

  • Introduction JavaScript fetch4:22

    Learn to use the fetch API in JavaScript to connect to an API endpoint, handle promises, convert responses to JSON, and iterate results.

  • Fetch array objects2:15

    Fetch array objects from a dynamic url, iterate over data.results with a for loop, and render each name to the page using JavaScript fetch.

  • fetch response methods3:47

    Learn to fetch various response types with JavaScript: convert responses to json, blob for images via createObjectURL, and text for plain strings, and dynamically display or log results.

  • Fetch Error Handling1:25

    Master fetch error handling in JavaScript by using JSON payloads, catch blocks, and console logging to return a callback and gracefully handle incorrect urls.

  • Fetch Adding Headers Params2:13

    Learn to enhance fetch requests by adding parameters and headers, creating a request object with a URL, and using the get method with mode and caching options.

  • Using myJSON endpoints3:26

    Set up your own endpoint with a JSON service and connect to it using fetch. Retrieve JSON objects and arrays from the endpoint and display messages on your webpage.

  • Short functions new JavaScript2:19

    Learn to shorten JavaScript functions using arrow syntax in fetch calls, replacing function and return with concise one-line arrow expressions, and handle JSON responses.

  • More fun with APIs5:54

    Experiment with fetch to retrieve JSON data from a placeholder API, practice posts, comments, and images, and explore the Star Wars API and countries API for hands-on learning.

  • Country Questions mini app6:03

    Build a mini country finder app using the rest countries API. Fetch all 250 countries, populate a dynamic dropdown, and show selected country details such as capital, currency, and language.

  • Country Application complete.4:26

    Learn to fetch countries from an api, populate a dynamic dropdown, handle on-change events, and display country details such as flag and population in html.

  • API Conclusion Lesson1:54

    Learn to connect to APIs using AJAX methods, including XMLHttpRequest and fetch, experiment with data from various APIs, and build a simple JavaScript app that outputs API data into HTML.

  • Resources and Source Code0:04

Requirements

  • JavaScript Experience and HTML and CSS
  • You should have web development Experience

Description

Access several popular web APIs and retrieve response content for web applications.  Step by step instruction on how to access web APIs using JavaScript XHR and fetch to get JSON data and update your web content.

JavaScript is a prerequisite to this course - do not take this course if you do not have JavaScript core knowledge

HTML and using an editor is also a prerequisite to the course - the scope of the course is to focus on JavaScript APIs

This course covers how to make AJAX requests using the XMLHttpRequest within JavaScript as well as fetch.  JavaScript code knowledge is a prerequisite for the course.  Scope of this course is focused on using JavaScript to connect to web APIs.

Examples and source code accessing over 7 different APIs

Course Covers

  • Explore what XHR is and how it works

  • How to use JSON response data

  • Connect to Joke API to get new content and update it in your HTML page

  • JavaScript Objects and how it relates to JSON data

  • How to iterate JSON data and output it on your HTML

  • Use JavaScript fetch

  • Error handling and responses

  • Setting up your own JSON endpoints to practice connecting to JSON content

  • ES6 JavaScript fetch and short functions

  • Learn how to build an api that output country data

  • Online resources and more

  • Connecting to web APIs

  • Practice AJAX

You'll get friendly support in the Q&A area and all the source code available for download

You will be amazed at how easy it can be to do some much. 
Go ahead and hit that "take this course" button to start learning the how to use JavaScript to connect to web APIs Today.  

Taught by an instructor with over 20 years of web development experience, ready to help you learn and answer any questions you may have.

What are you waiting join now to start learning JavaScript API connections, you have nothing to lose.

Who this course is for:

  • Web developers who want to practice connecting to APIs
  • Anyone who wants to use JavaScript xHR to connect to APIs
  • Anyone who wants to use JavaScript fetch to connect to APIs
  • Anyone who wants to learn more about XHR
  • JavaScript developers