{"_id":"@dukebot/instagram-collector","_rev":"4-0876a73889907557bd108eca7f440b7e","name":"@dukebot/instagram-collector","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@dukebot/instagram-collector","version":"1.0.0","author":{"name":"Dukebot"},"license":"MIT","_id":"@dukebot/instagram-collector@1.0.0","maintainers":[{"name":"dukebot","email":"danielfg1990@gmail.com"}],"homepage":"https://github.com/Dukebot/InstagramCollector#readme","bugs":{"url":"https://github.com/Dukebot/InstagramCollector/issues"},"dist":{"shasum":"6d9a0e184decc39c7203122723ccc82d9c035037","tarball":"https://registry.npmjs.org/@dukebot/instagram-collector/-/instagram-collector-1.0.0.tgz","fileCount":9,"integrity":"sha512-nTfbfZiL+5KoJv+d1b4Dz+weI4Xyo1GWbQUW7SfpFb318UmQwzevbGh+PTHNoRykYuCc1qcV49jmfmEoV/+epg==","signatures":[{"sig":"MEUCIQDZ2LoAefUaFOL4rHvaHH40D9JuB5JLpbkhri4DlYfK6AIgIRJsh5ya2J59fgwYqxo4huW+xfvJxpgVhJ1+Xa2v3wI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":108297},"main":"./dist/index.cjs","type":"commonjs","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"21803f1dbf6d13625b8df3fe1a64a6cf3ec405a8","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsup","clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"","typecheck":"tsc --noEmit","test:cache":"npm run build && node scripts/test-cache-download.js"},"_npmUser":{"name":"dukebot","email":"danielfg1990@gmail.com"},"repository":{"url":"git+https://github.com/Dukebot/InstagramCollector.git","type":"git"},"_npmVersion":"11.6.2","description":"","directories":{},"_nodeVersion":"24.13.0","dependencies":{"axios":"^1.13.5","dotenv":"^17.3.1","moment":"^2.30.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","typescript":"^5.8.2","@types/node":"^22.13.10"},"_npmOperationalInternal":{"tmp":"tmp/instagram-collector_1.0.0_1772496002779_0.056103923509140285","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dukebot/instagram-collector","version":"1.0.1","keywords":["instagram","collector","scraper","mongoose","mongodb","node","esm"],"author":{"name":"Dukebot"},"license":"MIT","_id":"@dukebot/instagram-collector@1.0.1","maintainers":[{"name":"dukebot","email":"danielfg1990@gmail.com"}],"homepage":"https://github.com/Dukebot/InstagramCollector#readme","bugs":{"url":"https://github.com/Dukebot/InstagramCollector/issues"},"dist":{"shasum":"fcec60036809991901f96a1ea8e21477bddb08d7","tarball":"https://registry.npmjs.org/@dukebot/instagram-collector/-/instagram-collector-1.0.1.tgz","fileCount":10,"integrity":"sha512-IyI0k9w9UVfGrpjOo4s9CcDguorzfcOyw67aW5DWe/fKaUz4VXzBckVHWr+P+4dsjYACCnkU+GPVFaT6rlkJ4A==","signatures":[{"sig":"MEUCIFNZY2CWh0tmx8rBsT25sPizeVfGP89ux9twzGH/eGp5AiEAzNCu5vlXMnwK0vCUhtAPjah5XMQ5oU0QWOJ6WE94iIo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16363},"main":"./src/index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./src/index.js"},"gitHead":"df73c295d5d0b5f1ab2cac848ebe7b0968451c4f","scripts":{"dev":"node --watch src/index.js","test":"node --test","start":"node src/index.js"},"_npmUser":{"name":"dukebot","email":"danielfg1990@gmail.com"},"repository":{"url":"git+https://github.com/Dukebot/InstagramCollector.git","type":"git"},"_npmVersion":"10.8.2","description":"Instagram collector module with Mongoose models and services built on top of @dukebot/instagram-scraper-api.","directories":{},"_nodeVersion":"18.20.8","dependencies":{"mongoose":"^8.19.1","@dukebot/instagram-scraper-api":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.1"},"_npmOperationalInternal":{"tmp":"tmp/instagram-collector_1.0.1_1775945000956_0.032202900860605954","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@dukebot/instagram-collector","version":"1.0.2","keywords":["instagram","collector","scraper","mongoose","mongodb","node","esm"],"author":{"name":"Dukebot"},"license":"MIT","_id":"@dukebot/instagram-collector@1.0.2","maintainers":[{"name":"dukebot","email":"danielfg1990@gmail.com"}],"homepage":"https://github.com/Dukebot/InstagramCollector#readme","bugs":{"url":"https://github.com/Dukebot/InstagramCollector/issues"},"dist":{"shasum":"36af54d1987136072e64606fca8128f48f4b8895","tarball":"https://registry.npmjs.org/@dukebot/instagram-collector/-/instagram-collector-1.0.2.tgz","fileCount":10,"integrity":"sha512-uWTGz2kvsyCefkriESvOycTfM24qlPdB/jVRZEWxUlXF7Ftj9Y29Iq6qJStLqUwOYTO0WaohfRw4AsT/ASx3Ng==","signatures":[{"sig":"MEUCICzMtvD3Cev3t+OPYlQuJYd9KvDWjVEDaix/e6xtTdzVAiEAtMV85P55qW482MwktJVRnE9RwLGLmsa15wbQK2bTQW8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16368},"main":"./src/index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./src/index.js"},"gitHead":"473524028bd129b5cc5680b8843acd2e0b9f63f1","scripts":{"dev":"node --watch src/index.js","test":"node --test","start":"node src/index.js"},"_npmUser":{"name":"dukebot","email":"danielfg1990@gmail.com"},"repository":{"url":"git+https://github.com/Dukebot/InstagramCollector.git","type":"git"},"_npmVersion":"10.8.2","description":"Instagram collector module with Mongoose models and services built on top of @dukebot/instagram-scraper-api.","directories":{},"_nodeVersion":"18.20.8","dependencies":{"mongoose":"^8.23.0","@dukebot/instagram-scraper-api":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.1"},"_npmOperationalInternal":{"tmp":"tmp/instagram-collector_1.0.2_1775947486331_0.6068073598560046","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@dukebot/instagram-collector","version":"1.0.3","description":"Instagram collector module with Mongoose models and services built on top of @dukebot/instagram-scraper-api.","homepage":"https://github.com/Dukebot/InstagramCollector#readme","bugs":{"url":"https://github.com/Dukebot/InstagramCollector/issues"},"repository":{"type":"git","url":"git+https://github.com/Dukebot/InstagramCollector.git"},"license":"MIT","author":{"name":"Dukebot"},"type":"module","engines":{"node":">=18"},"main":"./src/index.js","exports":{".":"./src/index.js"},"keywords":["instagram","collector","scraper","mongoose","mongodb","node","esm"],"scripts":{"dev":"node --watch src/index.js","start":"node src/index.js","test":"node --test"},"dependencies":{"@dukebot/instagram-scraper-api":"^0.2.0","mongoose":"^8.23.0"},"devDependencies":{"dotenv":"^17.4.1"},"_id":"@dukebot/instagram-collector@1.0.3","gitHead":"00020ea9f3e960e46aff67958d0ef8ddce7a692b","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-DOzfG2fo4IM68Z0Rq91Lfw/Wm//buK4QX27gz6ng2wHeoV3/f4vBBK4k4J9KObtoqlqyMEseuoZaJM1enxrXtA==","shasum":"2334646ba0f65d4d5ea38861cbefba79a786b4db","tarball":"https://registry.npmjs.org/@dukebot/instagram-collector/-/instagram-collector-1.0.3.tgz","fileCount":10,"unpackedSize":16752,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD464+rU/KqKFMr2FdANX/+pNVdfmqf4pYQOm6qzmosjgIhAKlooNkL0r0DfmsrUUW8qpsPP0GxT89+Lhh7ztmGSjvg"}]},"_npmUser":{"name":"dukebot","email":"danielfg1990@gmail.com"},"directories":{},"maintainers":[{"name":"dukebot","email":"danielfg1990@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/instagram-collector_1.0.3_1775948714053_0.33679147879978055"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-03T00:00:02.685Z","modified":"2026-04-11T23:05:14.318Z","1.0.0":"2026-03-03T00:00:02.941Z","1.0.1":"2026-04-11T22:03:21.079Z","1.0.2":"2026-04-11T22:44:46.504Z","1.0.3":"2026-04-11T23:05:14.196Z"},"bugs":{"url":"https://github.com/Dukebot/InstagramCollector/issues"},"author":{"name":"Dukebot"},"license":"MIT","homepage":"https://github.com/Dukebot/InstagramCollector#readme","keywords":["instagram","collector","scraper","mongoose","mongodb","node","esm"],"repository":{"type":"git","url":"git+https://github.com/Dukebot/InstagramCollector.git"},"description":"Instagram collector module with Mongoose models and services built on top of @dukebot/instagram-scraper-api.","maintainers":[{"name":"dukebot","email":"danielfg1990@gmail.com"}],"readme":"# @dukebot/instagram-collector\n\nInstagram collector module for Node.js using ES Modules, Mongoose, and `@dukebot/instagram-scraper-api`.\n\nThis package adds a persistence layer on top of the scraper so Instagram accounts and posts can be stored in MongoDB and processed later from your own backend jobs.\n\n## Features\n\n- Track Instagram accounts in MongoDB\n- Enable or disable tracked accounts\n- Store collected Instagram posts in MongoDB\n- Run a simple sequential extraction process\n- No build step, plain modern JavaScript\n\n## Installation\n\n```bash\nnpm install @dukebot/instagram-collector\n```\n\n## Exports\n\n- `InstagramAccount`\n- `InstagramPost`\n- `InstagramAccountService`\n- `InstagramPostService`\n- `InstagramExtractionService`\n- `utils`\n\n## Basic Usage\n\n```js\nimport mongoose from 'mongoose';\nimport { InstagramScraperAPI } from '@dukebot/instagram-scraper-api';\nimport {\n  InstagramAccountService,\n  InstagramExtractionService,\n} from '@dukebot/instagram-collector';\n\nawait mongoose.connect(process.env.MONGODB_URI);\n\nconst scraper = new InstagramScraperAPI({\n  apiHost: process.env.INSTAGRAM_SCRAPER_API_HOST,\n  apiKey: process.env.INSTAGRAM_SCRAPER_API_KEY,\n});\n\nconst instagramAccountService = new InstagramAccountService({ scraper });\nawait instagramAccountService.put('instagram');\n\nconst instagramExtractionService = new InstagramExtractionService({ scraper });\nconst summary = await instagramExtractionService.run();\n\nconsole.log(summary);\n```\n\n## Account Service\n\n```js\nconst service = new InstagramAccountService({ scraper });\n\nawait service.put('nasa');\nawait service.get();\nawait service.get({ isActive: true });\nawait service.getOne({ username: 'nasa' });\nawait service.getOne({ id: '123456' });\nawait service.setIsActive({ username: 'nasa', isActive: false });\n```\n\n## Post Service\n\n```js\nimport { InstagramPostService } from '@dukebot/instagram-collector';\n\nconst service = new InstagramPostService();\n\nawait service.get();\nawait service.get({ username: 'nasa' });\nawait service.getOne({ code: 'ABC123' });\n```\n\n## Extraction Service\n\nThe extraction service:\n\n1. Loads all active accounts\n2. Fetches posts for each account sequentially\n3. Creates or updates posts in MongoDB\n4. Returns a simple summary object\n\nExample result:\n\n```js\n{\n  processedAccounts: 2,\n  failedAccounts: 0,\n  processedPosts: 24,\n  createdPosts: 10,\n  updatedPosts: 14,\n  errors: []\n}\n```\n\n## Notes\n\n- The module is intentionally simple and does not include scheduling logic.\n- Run your daily sync from cron, PM2, GitHub Actions, or your backend worker.\n- The extraction process is sequential by design.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}