const axios = require("axios")
class SQIRKInstagramScraper {
constructor() {
this.baseURL = "https://sqirk.com/sqirk/api.php"
this.client = axios.create({
headers: {
"user-agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Mobile Safari/537.36",
"accept": "*/*",
"accept-language": "id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7",
"referer": "https://sqirk.com/sqirk/"
}
})
}
async getProfile(username) {
if (!username) throw new Error("Username tidak boleh kosong")
try {
console.log(`🔍 Mencari profil Instagram: @${username}`)
const response = await this.client.get(this.baseURL, {
params: {
username: username
}
})
const data = response.data
if (!data.success || !data.exist) {
return {
success: false,
message: `Profil @${username} tidak ditemukan atau tidak ada`,
exist: data.exist || false
}
}
const profile = data.profile_data
const debug = data.debug
return {
success: true,
profile: {
username: profile.username,
fullName: profile.full_name,
biography: profile.biography,
profilePicBase64: profile.profile_pic_url,
profilePicUrl: debug.image_url || null,
postsCount: profile.posts_count,
followedCount: profile.followed_count,
followCount: profile.follow_count,
isVerified: profile.is_verified,
isPrivate: profile.is_private
},
debug: {
imageUrl: debug.image_url,
imageError: debug.image_error,
imageSize: debug.image_size,
contentType: debug.detected_content_type
}
}
} catch (error) {
if (error.response) {
return {
success: false,
message: `HTTP Error: ${error.response.status}`,
status: error.response.status
}
}
throw new Error(`Scraping error: ${error.message}`)
}
}
saveProfilePic(base64Data, outputPath = "profile-pic.jpg") {
try {
const fs = require("fs")
// Clean base64 string
const base64Clean = base64Data.replace(/^data:image\/\w+;base64,/, "")
const buffer = Buffer.from(base64Clean, "base64")
fs.writeFileSync(outputPath, buffer)
console.log(`💾 Foto profil tersimpan: ${outputPath}`)
return outputPath
} catch (error) {
throw new Error(`Gagal menyimpan foto: ${error.message}`)
}
}
/**
* Get multiple profiles at once
* @param {string[]} usernames
* @returns {Promise<Object[]>}
*/
async getMultipleProfiles(usernames) {
if (!Array.isArray(usernames) || usernames.length === 0) {
throw new Error("Array username tidak boleh kosong")
}
console.log(`👥 Mencari ${usernames.length} profil...`)
const results = []
for (const username of usernames) {
const result = await this.getProfile(username)
results.push({
username: username,
...result
})
// Delay 1 detik antara request (rate limiting)
if (usernames.indexOf(username) < usernames.length - 1) {
await new Promise(resolve => setTimeout(resolve, 1000))
}
}
return results
}
}
// ==================== MAIN ====================
;(async () => {
const sqirk = new SQIRKInstagramScraper()
try {
console.log("=".repeat(60))
console.log("📸 SQIRK INSTAGRAM PROFILE SCRAPER")
console.log("=".repeat(60))
// Contoh 1: Get single profile
const username = "azamvallx"
console.log(`\n🔍 Mencari profil: @${username}`)
const result = await sqirk.getProfile(username)
if (result.success) {
const p = result.profile
console.log("\n✅ PROFIL DITEMUKAN!")
console.log("-".repeat(60))
console.log(`👤 Username : @${p.username}`)
console.log(`📛 Full Name : ${p.fullName}`)
console.log(`📝 Bio : ${p.biography}`)
console.log(`📊 Posts : ${p.postsCount}`)
console.log(`👥 Following : ${p.followedCount}`)
console.log(`👥 Followers : ${p.followCount}`)
console.log(`✅ Verified : ${p.isVerified ? "✅ Yes" : "❌ No"}`)
console.log(`🔒 Private : ${p.isPrivate ? "🔒 Yes" : "🔓 No"}`)
console.log(`🖼️ Photo URL : ${p.profilePicUrl}`)
if (p.profilePicBase64) {
const savedPath = sqirk.saveProfilePic(
p.profilePicBase64,
`./${p.username}-profile.jpg`
)
console.log(`💾 Photo saved : ${savedPath}`)
}
console.log("\n🔧 DEBUG INFO:")
console.log("-".repeat(60))
console.log(`📏 Image Size : ${result.debug.imageSize} bytes`)
console.log(`📋 Content Type: ${result.debug.contentType}`)
console.log(`⚠️ Image Error : ${result.debug.imageError || "None"}`)
} else {
console.log("\n❌ PROFIL TIDAK DITEMUKAN!")
console.log(`Message: ${result.message}`)
}
console.log("\n" + "=".repeat(60))
console.log("📦 FULL JSON RESPONSE:")
console.log("=".repeat(60))
console.log(JSON.stringify(result, null, 2))
// Contoh 2: Get multiple profiles
console.log("\n\n" + "=".repeat(60))
console.log("👥 MULTIPLE PROFILES SEARCH")
console.log("=".repeat(60))
const usernames = ["azamvallx", "instagram", "naruto"]
const multipleResults = await sqirk.getMultipleProfiles(usernames)
console.log("\n📊 HASIL PENCARIAN MULTIPLE:")
console.log("-".repeat(60))
multipleResults.forEach((res, index) => {
if (res.success) {
console.log(`\n${index + 1}. @${res.profile.username}`)
console.log(` 📛 ${res.profile.fullName}`)
console.log(` 👥 Followers: ${res.profile.followCount}`)
console.log(` 👥 Following: ${res.profile.followedCount}`)
console.log(` 📝 ${res.profile.biography}`)
} else {
console.log(`\n${index + 1}. @${res.username} - ❌ ${res.message}`)
}
})
const successCount = multipleResults.filter(r => r.success).length
const failCount = multipleResults.filter(r => !r.success).length
console.log(`\n📊 Summary: ${successCount} berhasil, ${failCount} gagal`)
} catch (error) {
console.error("\n❌ ERROR:", error.message)
if (error.response) {
console.error("Status:", error.response.status)
}
}
})()
🔍 Mencari profil: @azamvallx
🔍 Mencari profil Instagram: @azamvallx
✅ PROFIL DITEMUKAN!
------------------------------------------------------------
👤 Username : @azamvallx
📛 Full Name : —xalixia `De Moón
📝 Bio : why me?
📊 Posts : 0
👥 Following : 730
👥 Followers : 121
✅ Verified : ❌ No
🔒 Private : 🔓 No
🖼️ Photo URL : https://instagram.fflr4-1.fna.fbcdn.net/v/t51.82787-19/650285616_17944415028132041_4218716165756692238_n.jpg?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=instagram.fflr4-1.fna.fbcdn.net&_nc_cat=105&_nc_oc=Q6cZ2gGOW2Mndv6yN2WHLcm7Bu76Pd4lsUXmJWwHHmLtt5JwtM-YI0MR5OFDteEfg6ZuynE&_nc_ohc=nDx-xTQoCgYQ7kNvwGArnKT&_nc_gid=VWYGqP2y0NqLF-DqEz3x2w&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_Af5e7aHjz-UpfqdEeYu6SRZcH5UlOm789rxK015CCg5dBw&oe=6A086294&_nc_sid=8b3546
💾 Foto profil tersimpan: ./azamvallx-profile.jpg
💾 Photo saved : ./azamvallx-profile.jpg
🔧 DEBUG INFO:
------------------------------------------------------------
📏 Image Size : 1122 bytes
📋 Content Type: image/jpeg
⚠️ Image Error : None
============================================================
📦 FULL JSON RESPONSE:
============================================================
{
"success": true,
"profile": {
"username": "azamvallx",
"fullName": "—xalixia `De Moón",
"biography": "why me?",
"profilePicBase64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAUGBgsICwsLCwsNCwsLDQ4ODQ0ODg8NDg4ODQ8QEBARERAQEBAPExITDxARExQUExETFhYWExYVFRYZFhkWFhIBBQUFCgcKCAkJCAsICggLCgoJCQoKDAkKCQoJDA0LCgsLCgsNDAsLCAsLDAwMDQ0MDA0KCwoNDA0NDBMUExMTnP/AABEIAJYAlgMBIgACEQEDEQH/xABUAAEAAQUBAQAAAAAAAAAAAAAAAQIEBQYHCAMQAAEDAwEGAwcBBQkAAAAAAAABAgMEERIFBhMhIjEyFEFCFSNRUmFicXIHM0OCkRY0RFOBkqKj0v/aAAwDAQACAAMAAD8A9lkEkAAEgAgEgAgAAAEkAAAkAgEgAgEgAgkgAEgAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkGqadtdpuoVlRQU9VHLU03exPP5sHdr8F4PxvivUqRqrdURVx4rZOifUXNqBJBSAAAAAAAAAAAAAAAAAAAAAAUSSNja573I1rUVznOVERqJxVVVeCIidVKzQNudmZ9oaSGiiqFpon1LHVTkvd0DWvuxG9HKr8ODuXzW9rLXG1HORHOxRerutk/BCnKtd2ur9sKl+kbPe7pG8KzUeLW4fa70sX/fJ6bM5iKv9ldA2io5NFrd1qcOb6eq3v97fH39vK23ow6J3ZNNu2oh03ZvQ5dMpfcOnicyJjf3sjnd0sju79T3fpT4FtoelO1HRdH8NIx0lA9M2X49/M37XI0zUfYx7fcRbzDt7+Xu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qO1ddupJEjh050TWsc7eyeHc1jGfNd6tbwK301ui35b/AM2TW4fqS/EjI6vTanTVUs8MM8cstK5GzxsejnROcl0R6Jxaqp8TInmbQKLUtna3TqyroHRNq86XUp2zsqN/PVyumimfGxuTN3NyX8mOsemT5TxIxUs7JF87ovTgvT+v4VCWrcgAHwKgAAAAAAAAAAAASQAD5yvSNrnLezUVVtxWycehpVBqddPT1GceNRGrJ422jdnC/n3PI9/O3F8V+Du19jd3NRyKioioqWVF4oqKW8FHDT33UUceVr4May9ul8UQraqWX48LFK3unS3n8TTq2urmw0sjd5Hv5pHPTdc8UKse6Jj/AHM+LuzLk7uW5n4656Vb4X57t0cLoV3T8Vcu83l3o3D0t4OVDOAZFRodVqGpsgp5Y4lkf4Woknj3XvFkbu93h96XV279aI5Oti8dWVXjoI3Oe2B0ELltHyuldvc0y3L/AIM/iRYm4AZ/aQSQAUEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAgAAAAAAAAAAAAAAAAAAAAAkgkAgAAEgAAgAAAAAAAAAAAAAAAAAAAAAkAAAAA//9k=",
"profilePicUrl": "https://instagram.fflr4-1.fna.fbcdn.net/v/t51.82787-19/650285616_17944415028132041_4218716165756692238_n.jpg?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=instagram.fflr4-1.fna.fbcdn.net&_nc_cat=105&_nc_oc=Q6cZ2gGOW2Mndv6yN2WHLcm7Bu76Pd4lsUXmJWwHHmLtt5JwtM-YI0MR5OFDteEfg6ZuynE&_nc_ohc=nDx-xTQoCgYQ7kNvwGArnKT&_nc_gid=VWYGqP2y0NqLF-DqEz3x2w&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_Af5e7aHjz-UpfqdEeYu6SRZcH5UlOm789rxK015CCg5dBw&oe=6A086294&_nc_sid=8b3546",
"postsCount": 0,
"followedCount": 730,
"followCount": 121,
"isVerified": false,
"isPrivate": false
},
"debug": {
"imageUrl": "https://instagram.fflr4-1.fna.fbcdn.net/v/t51.82787-19/650285616_17944415028132041_4218716165756692238_n.jpg?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=instagram.fflr4-1.fna.fbcdn.net&_nc_cat=105&_nc_oc=Q6cZ2gGOW2Mndv6yN2WHLcm7Bu76Pd4lsUXmJWwHHmLtt5JwtM-YI0MR5OFDteEfg6ZuynE&_nc_ohc=nDx-xTQoCgYQ7kNvwGArnKT&_nc_gid=VWYGqP2y0NqLF-DqEz3x2w&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_Af5e7aHjz-UpfqdEeYu6SRZcH5UlOm789rxK015CCg5dBw&oe=6A086294&_nc_sid=8b3546",
"imageError": "",
"imageSize": 1122,
"contentType": "image/jpeg"
}
}