Getting Started with JavaScript for Web Development

Getting Real Data with fetch

The Fetch API allows us to get data from an external source easily. We will be returned a Promise which we can use .then() on.

Using fetch

fetch(url) // Call the fetch function passing the url of the API as a parameter
    .then(function() {
        // Your code for handling the data you get from the API
    .catch(function() {
        // This is where you run code if the server returns any errors



const apiUrl  = '';
const appId   = '58858c7bcf07b61e64257391'; 

If these no longer work and they have hit their limit, you will have to create your own OpenGraph account and get credentials.

Like this article? Follow @chrisoncode on Twitter