ig-webs-api
v2.1.0
Published
Instagram Web API pentru autentificare, trimitere mesaje DM și automatizare prin Node.js
Maintainers
Readme
📦 ig-web-api: Instagram Direct Message Automation Toolkit
Send, manage, and monitor Instagram Direct Messages programmatically.
Secure session handling, group selection, restriction detection, and more — all packed into one flexible Node.js library.
🚀 Features
- 🔐 Instagram Web Login with persistent session
- 💬 Send Direct Messages (text, image, document, reaction)
- 🧵 Discover and select existing DM threads
- 📡 Auto-initialize new conversations if needed
- 🛡️ Scan and detect account messaging restrictions
- 💾 Save sessions to avoid logging in every time
- 🎯 Interactive CLI ready for custom bot automation
🛠️ Installation
bash
npm install ig-web-api
Or clone manually:
bash
git clone https://github.com/gyovannyvpn123/ig-web-api
cd ig-web-api
npm install
📁 File Structure
| File | Description | |-----------------------|-------------------------------------------------------| | login.js | Logs in using username & password (web emulation) | | sessionStore.js | Saves and restores session with cookies & headers | | startDMWithUser.js | Starts a DM with any username if thread doesn't exist| | dm.js | Send messages to threads (text, image, reaction etc.)| | getDMGroups.js | Lists existing DM threads from your account | | selectDMGroups.js | Allows users to pick conversation(s) by number | | checkRestrictions.js| Verifies if account is restricted from messaging |
📦 Usage Example
`js import { loginWeb, sendTextDM, startDMWithUser, getDMGroups, selectDMGroups } from 'ig-web-api';
// 1. Log in with your Instagram credentials const session = await loginWeb('yourusername', 'yourpassword');
// 2. Get all conversations const groups = await getDMGroups(session); console.log(groups);
// 3. Send a message to a thread await sendTextDM(session, groups[0].id, 'Hello from the bot!'); `
💡 CLI Example
You can use node test.js to:
- Log in or reuse saved credentials
- Select which group(s) to message
- Send text to all selected conversations
- Auto-initialize threads if missing
🛡️ Account Restriction Checker
Scan your account status to detect Instagram blocks:
`js import { checkAccountRestrictions } from 'ig-web-api';
const result = await checkAccountRestrictions(session); console.log('Restricted:', result.restricted); console.log('Reason:', result.reason); `
📃 License
MIT © 2025 by Gyovanny & Contributors
📣 Created with love by Gyovanny to empower devs and automate Instagram messaging at scale.
Want to help expand it with TypeScript, CLI menus, or media support? PRs are welcome!
