scraperjavascript10028
Instagram Profile Stalker & Account Inspector (Pure Node.js)
Engine scraper profil Instagram akurat tanpa cookies/login session. Mengambil followers, following, posts, full name, bio, status verified, status privat, dan avatar (Tested on @fhmz76).
Vamz Spectre30 Sep 2026210 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/instagram-profile-stalker" -o instagram-profile-stalker.js
# 2. Jalankan script
node instagram-profile-stalker.js
Dependencies npm yang Dibutuhkan:
npm install axios, cheerioPanduan Penggunaan:
// Instalasi Dependencies:
npm install axios cheerio
// Penggunaan CLI / Terminal:
node instagram-profile-stalker.js fhmz76
// Penggunaan di Bot WhatsApp (Baileys) / Express API:
const { stalkInstagram } = require(./instagram-profile-stalker);
const data = await stalkInstagram("fhmz76");
console.log(data);
/*
Output:
{
status: true,
result: {
username: "fhmz76",
full_name: "fhmz",
biography: "",
is_verified: false,
is_private: false,
followers: 2,
followers_formatted: "2",
following: 4,
following_formatted: "4",
posts: 0,
posts_formatted: "0",
profile_url: "https://instagram.com/fhmz76"
}
}
*/instagram-profile-stalker.js(210 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/**
* Instagram Profile Stalker & Inspector (Pure Node.js)
*
* Engine scraper profil Instagram tanpa sesi login / cookies.
* Mengambil nama lengkap, bio, jumlah followers, following, total postingan,
* status centang biru (verified), status akun private, dan link foto profil avatar.
*
* Base Scraping: https://www.instagram.com/
* Platform: VamxAPI (https://vamxapi.my.id)
* Author: Vamz Spectre (@fhmz76)
*/
const axios = require("axios");
const cheerio = require("cheerio");
function formatCount(n) {
if (!n || isNaN(n)) return "0";
if (n >= 1e9) return (n / 1e9).toFixed(1) + "M";
if (n >= 1e6) return (n / 1e6).toFixed(1) + "jt";
if (n >= 1e3) return (n / 1e3).toFixed(1) + "rb";
return String(n);
}
function parseMetric(s) {
if (!s) return 0;
const clean = s.replace(/,/g, "").trim();
if (clean.endsWith("M") || clean.endsWith("m")) return Math.round(parseFloat(clean) * 1e6);
if (clean.endsWith("K") || clean.endsWith("k")) return Math.round(parseFloat(clean) * 1e3);
if (clean.endsWith("B") || clean.endsWith("b")) return Math.round(parseFloat(clean) * 1e9);
return parseInt(clean, 10) || 0;
}
/**
* Stalk profil Instagram secara akurat
* @param {string} rawUsername - Username Instagram (dengan atau tanpa @)
* @returns {Promise<Object>} Data profil lengkap
*/
async function stalkInstagram(rawUsername) {
const cleanUsername = String(rawUsername).replace(/^@+/, "").trim();
if (!cleanUsername || !/^[a-zA-Z0-9._]{1,30}$/.test(cleanUsername)) {
throw new Error("Username Instagram tidak valid. Masukkan username tanpa spasi atau simbol.");
}
let followers = 0;
let followersFormatted = "0";
let following = 0;
let followingFormatted = "0";
let posts = 0;
let postsFormatted = "0";
let fullName = cleanUsername;
let bio = "";
let isVerified = false;
let isPrivate = false;
let avatarUrl = "";
let found = false;
// 1. Primary Engine: Server-rendered Embed Endpoint
try {
const embedRes = await axios.get(`https://www.instagram.com/${cleanUsername}/embed/`, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
},
timeout: 8000,
validateStatus: (s) => s < 500,
});
const html = embedRes.data || "";
if (
embedRes.status === 404 ||
html.includes("Page Not Found") ||
html.includes("Sorry, this page isn't available.")
) {
throw new Error(`Akun Instagram '@${cleanUsername}' tidak ditemukan.`);
}
if (html.includes("followers_count") || html.includes("full_name")) {
found = true;
const followersM = html.match(/followers_count[^\d]*(\d+)/);
const postsM = html.match(/posts_count[^\d]*(\d+)/);
const verifiedM = html.match(/(?:is_verified|verified)[^\w]*(true|false)/);
const privateM = html.match(/is_private[^\w]*(true|false)/);
const fullNameM = html.match(/full_name\\*":\\*"([^"]+?)\\*",/);
const picM = html.match(/profile_pic_url\\*":\\*"(https:[^"]+?)\\*",/);
if (followersM) {
followers = parseInt(followersM[1], 10);
followersFormatted = formatCount(followers);
}
if (postsM) {
posts = parseInt(postsM[1], 10);
postsFormatted = formatCount(posts);
}
if (verifiedM) isVerified = verifiedM[1] === "true";
if (privateM) isPrivate = privateM[1] === "true";
if (fullNameM && fullNameM[1]) {
try {
fullName = JSON.parse(`"${fullNameM[1].replace(/\\\\/g, "\\")}"`);
} catch {
fullName = fullNameM[1];
}
}
if (picM && picM[1]) {
avatarUrl = picM[1]
.replace(/\\\//g, "/")
.replace(/\\\\/g, "")
.replace(/\\u0026/g, "&")
.replace(/\\u00253D/g, "=")
.replace(/\\u0025/g, "%");
}
}
} catch (err) {
if (err.message && err.message.includes("tidak ditemukan")) throw err;
}
// 2. Secondary Enrichment Engine: Googlebot Crawler Metadata (Followers, Following, Bio)
try {
const crawlerRes = await axios.get(`https://www.instagram.com/${cleanUsername}/`, {
headers: {
"User-Agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
},
timeout: 6000,
validateStatus: (s) => s < 500,
});
if (crawlerRes.status === 200 && typeof crawlerRes.data === "string") {
const $ = cheerio.load(crawlerRes.data);
const descMeta =
$('meta[name="description"]').attr("content") ||
$('meta[property="og:description"]').attr("content") ||
"";
const ogTitle = $('meta[property="og:title"]').attr("content") || "";
const ogImage = $('meta[property="og:image"]').attr("content") || "";
if (descMeta && (descMeta.includes("Followers") || descMeta.includes("Following"))) {
found = true;
const descMatch = descMeta.match(
/([0-9.,KMBkmb]+)\s+Followers,\s+([0-9.,KMBkmb]+)\s+Following,\s+([0-9.,KMBkmb]+)\s+Posts/i
);
if (descMatch) {
followers = parseMetric(descMatch[1]);
followersFormatted = descMatch[1];
following = parseMetric(descMatch[2]);
followingFormatted = descMatch[2];
posts = parseMetric(descMatch[3]);
postsFormatted = descMatch[3];
}
const titleMatch = (ogTitle || $("title").text()).match(/^(.*?)(?:\s*\(@|\s*•)/);
if (titleMatch && titleMatch[1].trim()) {
fullName = titleMatch[1].trim();
}
const bioMatch = descMeta.match(/on Instagram:\s*"([\s\S]*?)"\s*$/);
if (bioMatch && bioMatch[1]) {
bio = bioMatch[1].trim();
}
if (ogImage && !avatarUrl) {
avatarUrl = ogImage;
}
const titleText = $("title").text();
if (titleText.includes("InstagramVerified") || titleText.includes("VerifiedOptions")) {
isVerified = true;
}
}
}
} catch {}
if (!found) {
throw new Error(`Akun Instagram '@${cleanUsername}' tidak ditemukan atau privat.`);
}
return {
status: true,
result: {
username: cleanUsername,
full_name: fullName,
biography: bio,
is_verified: isVerified,
is_private: isPrivate,
followers,
followers_formatted: followersFormatted,
following,
following_formatted: followingFormatted,
posts,
posts_formatted: postsFormatted,
avatar_url: avatarUrl,
profile_url: `https://instagram.com/${cleanUsername}`,
},
};
}
if (typeof module !== "undefined" && module.exports) {
module.exports = { stalkInstagram };
}
// Pengujian Langsung CLI:
if (require.main === module) {
const target = process.argv[2] || "fhmz76";
console.log(`🔍 Sedang melakukan stalk profil Instagram: @${target}...`);
stalkInstagram(target)
.then((res) => console.log(JSON.stringify(res, null, 2)))
.catch((err) => console.error("❌ Gagal:", err.message));
}