scrimba
Frontend Career Path
Working with APIs
Intro to APIs
Aside - apis.scrimba.com?
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Aside - apis.scrimba.com?
Expand for more info
index.js
run
preview
console
/**
Challenge:

1. Fetch a random activity from the Bored API
url: https://apis.scrimba.com/bored/api/activity

2. Display the text of the activity in the browser
*/

fetch("https://apis.scrimba.com/bored/api/activity")
.then(response => response.json())
.then(data => {
console.log(data)
document.getElementById("activity-name").textContent = data.activity
})
Console
{activity:
"Start a garden"
, type:
"recreational"
, participants:
1
, price:
0.3
, link:
""
, key:
"1934228"
, accessibility:
0.35
}
,
/index.html
-1:51