Skip to content

Instantly share code, notes, and snippets.

@AcheZeta
Last active July 17, 2022 09:35
Show Gist options
  • Save AcheZeta/1159eff6df3e2b14f2dbee551f2fcf40 to your computer and use it in GitHub Desktop.
Save AcheZeta/1159eff6df3e2b14f2dbee551f2fcf40 to your computer and use it in GitHub Desktop.
Fetch Pokemon API
//Function to Fetch the API
const getPokemon = () => {
//You can use name, number, type, or ability in the url.
//Example: pokemon/ditto/, pokemon/1/, type/3/ or ability/4/.
fetch(`https://pokeapi.co/api/v2/pokemon/25/`)
.then(response => response.json())
.then(data => {
console.log(data)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment