Skip to content

Instantly share code, notes, and snippets.

@elijahjcobb
Last active Jul 22, 2022
Embed
What would you like to do?
Fetch a single gist from GitHub's REST API
const id = "<the-gist-id>";
fetch(`https://api.github.com/gists/${id}`)
.then(res => res.json())
.then(gist => {
const {createdAt, description} = gist;
console.log(`The ${description} gist was created at ${createdAt}!`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment