Last active
July 29, 2021 10:08
-
-
Save bibhuticoder/34cbf23995aff5691ba76d78f5337c77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
let instaAccessToken = "XXXXXX"; // get from DB | |
let resp = await axios.get(`https://graph.instagram.com/me/media?fields=media_type,permalink,media_url&access_token=${instaAccessToken}`); | |
resp = resp.data; | |
let instaPhotos = resp.data.filter(d => d.media_type === "IMAGE").map(d => d.media_url); | |
// Got insta photos | |
} catch (e) { | |
console.log(e.response.data.error); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment