Live
Code
πΈ ISS Tracker
Locating stationβ¦
fetch('https://api.wheretheiss.at
/v1/satellites/25544')
.then(r => r.json())
.then(d => {
d.latitude
d.longitude
d.altitude
d.velocity
});
β» Refresh
Live
Code
π Photo of the Day
Contacting NASAβ¦
fetch('https://api.nasa.gov/planetary
/apod?api_key=DEMO_KEY')
.then(r => r.json())
.then(d => {
d.title
d.url
d.date
d.explanation
d.media_type
});
β» Refresh
Live
Code
π― Trivia Challenge
Loading questionβ¦
fetch('https://opentdb.com/api.php
?amount=1&type=multiple')
.then(r => r.json())
.then(d => {
const q = d.results[0];
q.question
q.correct_answer
q.incorrect_answers
q.category
q.difficulty
});
β» New Question
Live
Code
β‘ Random PokΓ©mon
Searching PokΓ©dexβ¦
const id = Math.floor(Math.random() * 898) + 1;
fetch(`https://pokeapi.co/api/v2/pokemon/${id}`)
.then(r => r.json())
.then(d => {
d.name
d.sprites.front_default
d.types[0].type.name
d.stats[0].base_stat
});
β» New PokΓ©mon
Live
Code
π€ SF Weather
Checking skiesβ¦
fetch('https://api.open-meteo.com/v1/forecast
?latitude=37.77&longitude=-122.42
¤t_weather=true
&temperature_unit=fahrenheit')
.then(r => r.json())
.then(d => {
const w = d.current_weather;
w.temperature
w.windspeed
w.weathercode
});
β» Refresh
Live
Code
π± Cat GIF
Summoning a catβ¦
const img = document.createElement('img');
img.src = 'https://cataas.com/cat/gif';
document.body.appendChild(img);
β» New Cat
Live
Code
π Random Dog
Fetching a good boyβ¦
fetch('https://dog.ceo/api/breeds/image/random')
.then(r => r.json())
.then(d => {
d.message
d.status
});
β» New Dog
Live
Code
π Wikipedia Random
Opening a random articleβ¦
fetch('https://en.wikipedia.org
/api/rest_v1/page/random/summary')
.then(r => r.json())
.then(d => {
d.title
d.extract
d.thumbnail
d.content_urls
});
β» New Article