How do you fetch instagram?

I see some websites that can fetch an instagram profile and get all their posts, reels and videos by simply typing the username and I don't understand how they do it because it's so fast. I've tried scraping instagram's profile by doing this:
const fs = require("fs")
const url = "https://instagram.com/instagram"

async function Scrape() {

const headers = new Headers()

const res = await fetch(url)
const data = await res.text()

fs.writeFile("result.html", data, err => {
if(err) {
console.log(err)
} else {
console.log("file written successfully")
}
})

}

Scrape()
const fs = require("fs")
const url = "https://instagram.com/instagram"

async function Scrape() {

const headers = new Headers()

const res = await fetch(url)
const data = await res.text()

fs.writeFile("result.html", data, err => {
if(err) {
console.log(err)
} else {
console.log("file written successfully")
}
})

}

Scrape()
But in result.html I only get a sorry there's nothing here page. How do they do it? For example go to https://igdownloader.app/ and type https://instagram.com/instagram
IGDownloader.app
Instagram Downloader: Videos, Photos, Story, Reels, IGTV - IGDownlo...
IGDownloader is an Instagram downloader that helps you to download videos, photos, stories, Reels and IGTV from Instagram. Support iPhone, Android.
1 Reply
Jochem
Jochem9mo ago
Meta for Developers
Instagram APIs | Facebook for Developers
Instagram APIs lets you manage and build unique services. Gain tools to help your business interact with the Instagram community.
Want results from more Discord servers?
Add your server