Skip to content

Instantly share code, notes, and snippets.



Created Dec 4, 2019
What would you like to do?
Instagram No-API Public posts access
content = await(await fetch('')).text()
doc = new DOMParser().parseFromString(content, 'text/html')
dataEl = Array.from(doc.querySelectorAll('script:not([src])')).find(s => s.innerText.includes('window._sharedData = '))
match = dataEl.innerText.match(/\{.+}/)
data = JSON.parse(match[0])
last12posts = data.entry_data.ProfilePage[0].graphql.user.edge_owner_to_timeline_media.edges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment