npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-scrap-insta-tiwtiw

v2.5.3

Published

Node n8n professionnel pour scraper Instagram avec Rate Limiting Intégré - Protection anti-blocage automatique - Récupération de profils, user posts et hashtags avec support cookies + Instagram Private API + Support Graph API pour IGID (webhooks) + API fb

Readme

🚀 n8n-nodes-scrap-insta-tiwtiw v2.5.0

🎯 Node n8n Professionnel - Scraper Instagram avec Support Webhook IGID

🆕 Nouvelle v2.5.0 : Support complet des webhooks Instagram ! Récupérez le profil complet depuis un IGID (Instagram Graph API ID) 🎉

✨ Fonctionnalités

  • 🆕 Profil par ID (IGID Support) - Convertit IGID → Username → Profil complet (NEW !)
  • Scraping Hashtags V2 - API fbsearch avec pagination (50+ posts)
  • User Posts V2 - Récupérer posts par user_id/username
  • Profils Utilisateurs - Infos complètes (followers, bio, etc.)
  • 🔥 Enrichissement Auto - Convertit user_ID@real_username
  • Instagram Graph API - Support IGID depuis webhooks Business
  • Format Standard - Compatible instagram-scraper
  • Cookies Support - Authentification sécurisée
  • Mode Batch - Plusieurs hashtags/profils/users en une fois
  • Pagination Avancée - Support max_id et next_max_id
  • 100% Autonome - Tout intégré, pas de node externe

📦 Installation

npm install [email protected]

Puis redémarrez n8n :

n8n restart

🔥 Nouveau : Enrichissement Automatique v2.1.0

Problème Résolu

AVANT : Scraping hashtags retourne souvent user_123456 au lieu du vrai username
APRÈS : Enrichissement automatique récupère le vrai @username !

Exemple

// AVANT v2.0.6
{
  "ownerUsername": "user_75877970771"  ❌
}

// APRÈS v2.1.0
{
  "ownerUsername": "real_username",  ✅
  "owner": {
    "username": "real_username",
    "full_name": "Real User Name",
    "is_verified": true,
    "enriched": true  ✅
  }
}

Configuration

Option 1 : Mode Auto (Recommandé)

L'enrichissement est activé par défaut avec vos cookies Instagram !

  1. Workflow n8n → Node "Scrap Insta by tiwtiw"
  2. Opération : "Posts Hashtag"
  3. Options avancées → Enrichissement Username : ✅ Activé

C'est tout ! Le node enrichit automatiquement.

Option 2 : Session Data Complète (Expert)

Pour 100% de fiabilité, utilisez une session complète :

# 1. Extraire session
cd node_modules/n8n-nodes-scrap-insta-tiwtiw
node extract-session.js

# 2. Copier le contenu de instagram-session-for-n8n.json

# 3. Dans n8n :
# Options avancées → Session Data (Enrichissement) → Coller JSON

🆕 Nouveau v2.5.0 : Support Webhooks Instagram (IGID)

🎯 Profil depuis Webhook - Récupération automatique du profil depuis un IGID

Cas d'usage : Vous recevez un message Instagram via webhook et voulez identifier l'expéditeur.

Problème : Le webhook fournit un IGID (Instagram Graph API ID, 17+ chiffres) mais l'API privée Instagram nécessite le username ou le user_id natif.

✅ Solution : Le node détecte automatiquement les IGIDs et utilise l'API Graph pour récupérer le profil complet !

Configuration

Prérequis :

  • Access Token Instagram Graph API (Guide complet ici)
  • Cookies Instagram (credentials n8n)

Exemple dans n8n :

{
  "operation": "getUserById",
  "userId": "{{ $json.sender.id }}",
  "accessToken": "{{ $credentials.instagramGraph.access_token }}"
}

Workflow automatique :

Webhook Instagram
    ↓ sender.id = "17841471643493674" (IGID)
Tiwtiw: Profil par ID
    ↓ Détection auto: IGID
    ↓ Graph API: IGID → username
    ↓ API privée: username → profil complet
Résultat: Profil complet avec followers, bio, etc.

Output :

{
  "success": true,
  "method": "graph_api_then_private",
  "igid": "17841471643493674",
  "user": {
    "id": "71629396116",
    "username": "tydev__",
    "full_name": "TY Dev",
    "followers_count": 651,
    "following_count": 145,
    "posts_count": 21,
    "biography": "Création de sites web...",
    "is_verified": false,
    "is_business_account": true,
    "business_category": "Website",
    "external_url": "http://ty-dev.fr/"
  }
}

📖 Guide complet : Voir GUIDE-UTILISATION-N8N.md


📊 Opérations Disponibles

1️⃣ Profil par ID 🆔 (NOUVEAU v2.5.0)

Récupère le profil complet d'un utilisateur depuis son ID (natif ou IGID).

Input :

{
  "operation": "getUserById",
  "userId": "17841471643493674",
  "accessToken": "VOTRE_ACCESS_TOKEN"
}

Output : Profil complet avec followers, bio, posts, etc.


2️⃣ Posts Hashtag 🔥

Récupère les posts d'un ou plusieurs hashtags.

Input :

{
  "operation": "getHashtagPosts",
  "hashtag": "paris",
  "count": 50
}

Output :

{
  "name": "paris",
  "posts_count": 50,
  "enriched_count": 47,  ✅ 94% enrichis !
  "posts": [
    {
      "shortCode": "ABC123",
      "ownerUsername": "real_user",  ✅ Vrai username
      "likesCount": 1234,
      "commentsCount": 56,
      "owner": {
        "username": "real_user",
        "full_name": "Real User",
        "is_verified": true,
        "enriched": true  ✅
      }
    }
  ]
}

3️⃣ Profil Utilisateur

NOUVEAU dans v2.3.0 : Récupère les posts d'un utilisateur avec pagination avancée !

✨ Fonctionnalités :

  • Pagination avec max_id (12 posts par page)
  • Statistiques automatiques (likes, comments, moyennes)
  • Accepte user_id (recommandé) ou username
  • Mode Single ou Multiple users

💡 Astuce : Utilisez le user_id directement pour éviter les erreurs checkpoint_required

Input (Single User avec user_id) :

{
  "operation": "getUserPosts2",
  "userInputMode2": "single",
  "username2": "71629396116",
  "userPostsCount2": 21
}

Input (Single User avec username) :

{
  "operation": "getUserPosts2",
  "userInputMode2": "single",
  "username2": "tydev__",
  "userPostsCount2": 21
}

Input (Multiple Users) :

{
  "operation": "getUserPosts2",
  "userInputMode2": "multiple",
  "usernames2": "71629396116\n25025320\ntydev__",
  "userPostsCount2": 12
}

Output :

{
  "success": true,
  "source": "rest_feed_api",
  "pagination": {
    "total_pages": 2,
    "has_more": false
  },
  "user": {
    "username": "tydev__",
    "user_id": "71629396116",
    "full_name": "Ty Dev"
  },
  "statistics": {
    "total_posts": 21,
    "total_likes": 181,
    "total_comments": 15,
    "average_likes_per_post": 8.62,
    "average_comments_per_post": 0.71
  },
  "posts": [
    {
      "shortcode": "DDIVvmDyCQq",
      "caption": "Full-stack dev 💻...",
      "likesCount": 12,
      "commentsCount": 2,
      "timestamp": 1737305127,
      "type": "Photo",
      "displayUrl": "https://...",
      "videoUrl": null,
      "location": null,
      "hashtags": ["coding", "webdev"]
    }
  ]
}

⚠️ Notes Importantes :

  1. user_id vs username : Privilégiez le user_id (ex: 71629396116) pour éviter l'erreur checkpoint_required
  2. Pagination : 12 posts par page (limite API Instagram)
  3. Rate limiting : Max 200-300 requêtes/heure recommandé
  4. Mode Multiple : Séparez les user_ids/usernames par des retours à la ligne

Récupère les infos d'un ou plusieurs profils.

Input :

{
  "operation": "getUserProfile",
  "username": "instagram"
}

Output :

{
  "success": true,
  "user": {
    "username": "instagram",
    "full_name": "Instagram",
    "followers_count": 696037513,
    "is_verified": true,
    "biography": "Discover what's new on Instagram 🔎✨"
  }
}

3️⃣ Convertir Cookies

Convertit cookies JSON → format session string.


🛠️ Configuration Credentials

1. Créer Credential Instagram Tiwtiw

Dans n8n :

  • Settings → Credentials → Add New
  • Type : Instagram Tiwtiw

2. Remplir les champs

Session Cookies :

sessionid=xxx; csrftoken=yyy; ds_user_id=zzz; mid=aaa; ig_did=bbb; datr=ccc; rur=ddd; ig_nrcb=eee

User Agent (optionnel) :

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36

3. Comment obtenir les cookies ?

Méthode 1 : DevTools Chrome (Recommandée)

  1. Ouvrir Instagram dans Chrome
  2. F12 → Network → Rafraîchir page
  3. Cliquer sur une requête
  4. Headers → Cookie → Copier

Méthode 2 : Extension EditThisCookie

  1. Installer extension EditThisCookie
  2. Aller sur Instagram.com
  3. Cliquer extension → Export → Copier JSON

📈 Performance & Limites

Vitesse

  • Sans enrichissement : ~2-3s pour 50 posts
  • Avec enrichissement : ~1-2 min pour 50 posts (1s/post)

Rate Limiting Instagram

⚠️ Limites recommandées :

  • Max 200-300 requêtes/heure
  • Delay 1s entre posts (automatique)
  • Max 50 posts par hashtag

🔧 Options Avancées

{
  "advancedOptions": {
    "enableEnrichment": true,        // 🔥 Enrichissement auto
    "sessionData": "{...}",          // Session complète (optionnel)
    "timeout": 30000,                // Timeout en ms
    "includeStats": true,            // Statistiques
    "dataFormat": "standard"         // Format sortie
  }
}

Formats disponibles

  • standard : Format instagram-scraper (recommandé)
  • full : Toutes données + analytics
  • simple : Données essentielles uniquement

📝 Exemples Workflows

Exemple 1 : Monitoring User Posts (NOUVEAU v2.3.0)

Trigger Schedule (1x/jour)
  ↓
Scrap Insta User Posts V2 (user_id: 71629396116, count: 21)
  ↓ [Statistiques auto : likes, comments, moyennes]
Filter (likesCount > 10)
  ↓
Google Sheets (Log engagement)
  ↓
Slack (Alerte posts populaires)

Exemple 2 : Analyse Multi-Comptes

Scrap Insta User Posts V2 (Multiple: "71629396116\n25025320\ntydev__", count: 12)
  ↓ [12 posts par user avec stats]
Aggregate (Comparer engagement moyen)
  ↓
Chart (Visualisation performances)

Exemple 3 : Monitoring Hashtag

Trigger Schedule (1x/jour)
  ↓
Scrap Insta (hashtag: #votreMarque, count: 20)
  ↓ [Enrichissement auto]
Filter (verified = true)
  ↓
Email (Liste influenceurs)

Exemple 4 : Lead Generation

Scrap Insta (hashtag: #immobilier, count: 50)
  ↓ [Enrichissement auto]
Filter (followers > 10000)
  ↓
Extract Bio (email)
  ↓
Google Sheets (Export)

Exemple 5 : Analyse Concurrence

Scrap Insta (Multiple hashtags: #concurrent1, #concurrent2)
  ↓ [Enrichissement auto]
Aggregate (Stats engagement)
  ↓
Slack (Rapport quotidien)

🐛 Troubleshooting

❌ Erreur : "checkpoint_required" (User Posts V2)

Symptôme : Lors de l'utilisation de User Posts V2 avec un username

{
  "message": "checkpoint_required",
  "checkpoint_url": "...",
  "lock": true,
  "status": "fail"
}

Cause : Instagram demande une vérification de sécurité lors de l'accès au profil

✅ Solution : Utilisez directement le user_id au lieu du username

Exemple :

// ❌ PEUT déclencher checkpoint
username2: "tydev__"

// ✅ RECOMMANDÉ - Pas de checkpoint
username2: "71629396116"

Comment obtenir le user_id ?

  1. Utilisez l'opération "Profil Utilisateur" avec le username
  2. Le résultat contiendra le user_id
  3. Sauvegardez ce user_id pour les prochaines requêtes User Posts V2

Enrichissement ne fonctionne pas

Causes :

  • Cookies expirés (normal après 90 jours)
  • Rate limiting Instagram

Solutions :

  1. Ré-extraire session fraîche : node extract-session.js
  2. Réduire count (ex: 20 au lieu de 50)
  3. Désactiver enrichissement temporairement

Erreur "Session data error"

Solution :

# Re-générer session
node extract-session.js

# Copier le contenu de instagram-session-for-n8n.json
# Coller dans Options avancées → Session Data

Timeout

Solution : Augmenter timeout

{
  "timeout": 60000  // 60 secondes
}

📚 Documentation

  • ENRICHISSEMENT.md : Guide enrichissement complet
  • EXAMPLES.md : Exemples workflows
  • INSTALLATION.md : Installation détaillée
  • RAPPORT-TEST.md : Tests v2.1.0

🆕 Changelog

v2.3.0 (29 janvier 2025)

🔥 NOUVEAU

  • User Posts V2 (GraphQL) - Récupérer posts par user_id/username
  • ✅ API REST Feed /api/v1/feed/user/{user_id}/ avec pagination max_id
  • ✅ Support user_id direct (évite checkpoint_required)
  • ✅ Détection automatique user_id vs username
  • ✅ Statistiques automatiques (likes, comments, moyennes)
  • ✅ Mode Single & Multiple users
  • ✅ Pagination avancée (12 posts/page)

🔧 AMÉLIORATIONS

  • ⚡ Parser Feed API complet (caption, hashtags, location)
  • 🛡️ Gestion checkpoint_required avec user_id fallback
  • 📊 Calcul statistiques (total_likes, average_likes_per_post, etc.)
  • 🎯 Support media types (Photo, Video, Carousel)

📦 Package npm

  • Taille : 65.9 kB (401.3 kB unpacked)
  • Fichiers : 58 total
  • Published : https://registry.npmjs.org/

v2.1.0 (27 octobre 2025)

🔥 NOUVEAU

  • ✅ Enrichissement automatique usernames
  • ✅ Intégration instagram-private-api
  • ✅ Support session data complète
  • ✅ Statistiques enriched_count
  • ✅ Mode autonome complet

🔧 AMÉLIORATIONS

  • ⚡ Delay automatique anti-rate-limit
  • 📊 Analytics enrichissement
  • 🛡️ Gestion erreurs robuste
  • 🎯 Fallback automatique

🐛 CORRECTIONS

  • ❌ Plus de user_ID manquant
  • ❌ Plus besoin de node externe
  • ❌ Données toujours complètes

v2.0.6 (26 octobre 2025)

  • ✅ Format standard Instagram Scraper
  • ✅ Support cookies session
  • ✅ Mode batch

💡 Support


📄 License

MIT © Amine Tiwtiw


🎉 Résumé

v2.1.0 = Node Autonome Complet

✅ Scraping hashtags
✅ Enrichissement usernames automatique
✅ Aucune configuration complexe
✅ Prêt à l'emploi

Plus besoin de node externe - Tout intégré ! 🚀