{"_id":"@buzzguru/instagram-private-api","_rev":"3-ef26b2e3a357b1d11349b61e160bfb28","name":"@buzzguru/instagram-private-api","dist-tags":{"latest":"1.44.0"},"versions":{"1.44.0":{"name":"@buzzguru/instagram-private-api","description":"Instagram private API wrapper for full access to instagram","version":"1.44.0","main":"dist/index.js","types":"dist/index.d.ts","license":"MIT","engines":{"node":">=8.0.0"},"bugs":{"url":"https://github.com/dilame/instagram-private-api/issues","email":"dilame.nickolson@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/dilame/instagram-private-api.git"},"homepage":"https://github.com/dilame/instagram-private-api","scripts":{"build":"rimraf dist && tsc -p tsconfig.build.json","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json -c tslint.json","typecheck":"tsc -p tsconfig.build.json --noEmit","prepare":"npm run build","test":"mocha --inline-diffs --timeout 1000000 tests/run.js","generate-interface":"ts-node ./tools/response-to-interface.ts","generate-docs":"ts-node ./tools/docs-generator.ts"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"dependencies":{"@lifeomic/attempt":"^3.0.0","@types/chance":"^1.0.2","@types/request-promise":"^4.1.43","bluebird":"^3.7.1","chance":"^1.0.18","class-transformer":"^0.3.1","debug":"^4.1.1","image-size":"^0.7.3","json-bigint":"^0.3.0","lodash":"^4.17.20","luxon":"^1.12.1","reflect-metadata":"^0.1.13","request":"^2.88.0","request-promise":"^4.2.4","rxjs":"^6.5.2","snakecase-keys":"^3.1.0","tough-cookie":"^2.5.0","ts-custom-error":"^2.2.2","ts-xor":"^1.0.6","url-regex-safe":"^1.0.2","utility-types":"^3.10.0"},"devDependencies":{"@types/bluebird":"^3.5.26","@types/lodash":"^4.14.123","@types/luxon":"^1.12.0","@types/node":"^10.14.5","@types/tough-cookie":"^2.3.5","dotenv":"^6.2.0","husky":"^1.3.1","inquirer":"^1.1.2","json-ts":"^1.6.4","prettier":"^1.19.1","pretty-quick":"^1.10.0","rimraf":"^2.6.3","ts-node":"^8.1.0","tslint":"^5.16.0","typedoc":"^0.15.0","typedoc-plugin-markdown":"^2.0.11","typescript":"^3.7.2"},"gitHead":"cfac9e4c02f325c8472d3480ed81d538238ae0c0","_id":"@buzzguru/instagram-private-api@1.44.0","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-h23F8/g2XHBBb0yo1ZiIur6gv8JtTaZ/RnsZW3kyJlN9eujWhBkPudWY7EZ+xiyH2EOPhUgj1EScGMZMOKteOA==","shasum":"a2981bdd1f75cdbe27971f1891853a445157b03a","tarball":"https://registry.npmjs.org/@buzzguru/instagram-private-api/-/instagram-private-api-1.44.0.tgz","fileCount":804,"unpackedSize":967976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpPmXCRA9TVsSAnZWagAAV8oP/iNA3v7zoTq5sVKRUwZ1\nbFWPc6H5e9u9ydiV39KLvQrXNHvtK6tlReARnwU22OI6lwdd3hzTE2ptWkaG\no3likQUKyt8uSVDwgM0MA4QKQMYIDQB6sTK0CGXJZsRfcgypZ+P9t+LcDFTI\nlC9NX+9oBegyqaLANSk3b4NjyWoErdr+NJlEjxdqdevZRv+8LONMmmqWXtpX\n4YbQ2TE3sTunKG01SaSfhFFTZYVnESXwJiJ61Ios5Z2PHZZgY4n5p25KuM9+\n2Bq0GqfCHo2ZgF5gIjUrfco6lp65ywkA+C0BfqqFdVh/uHjg4v/cGA465TP7\n74xqFnB8KDRn0L+iJ/EqTJYgclGyciAKdyRrT1J43+y8AOEBTtvtdQpCsAWA\nfVry4CADCC+6RE4xKQ0LHb5x9sihT3+7kYG8RGdTlgJ4PoBo2+VoLJHi9OeM\nNtEs1Hcx6SDVLszzsXWxdZq8ZYsVj9b6BA9pJGfSnzbgVpK4clMYP8da7WLn\n5XxrdLfBQGZHA6QWWRmWwjtsOoQmKFMUNLKgAXFFoggCTH/8Ep8k315ql2p4\nRi6sA4qN41XZPi7ceWke4lXkQLPjtQuapTiCY2xSaPv6BCg9uD3bqNkKfxj3\nnvR9a5oLZfpkokr//g2I7PejKOEgNt+PYig530HpPPBY3mowCrrRxRAoAGgI\nw8Zw\r\n=WWqN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9acerj7D4ibdRlcuTWDR73taz3RtOjuU2TvUbItyKGQIhAK7eLBokEG9pFS3vVJNTt5/2CI14X2TQfy07suU4exkg"}]},"_npmUser":{"name":"isuvorov","email":"hi@isuvorov.com"},"directories":{},"maintainers":[{"name":"isuvorov","email":"hi@isuvorov.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/instagram-private-api_1.44.0_1604647318468_0.9083384139361106"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2020-11-06T07:21:58.288Z","1.44.0":"2020-11-06T07:21:58.684Z","modified":"2023-10-03T16:09:16.871Z"},"maintainers":[{"email":"support@npmjs.com","name":"npm-support"}],"description":"Instagram private API wrapper for full access to instagram","homepage":"https://github.com/dilame/instagram-private-api","repository":{"type":"git","url":"git+https://github.com/dilame/instagram-private-api.git"},"bugs":{"url":"https://github.com/dilame/instagram-private-api/issues","email":"dilame.nickolson@gmail.com"},"license":"MIT","readme":"# NodeJS Instagram private API client\n\n![logo](https://cloud.githubusercontent.com/assets/1809268/15931032/2792427e-2e56-11e6-831e-ffab238cc4a2.png)\n\n[![Telegram Chat](https://img.shields.io/badge/telegram-join%20chat-informational.svg)](https://t.me/igpapi)\n[![npm](https://img.shields.io/npm/dm/instagram-private-api.svg?maxAge=600)](https://www.npmjs.com/package/instagram-private-api)\n[![npm](https://img.shields.io/npm/l/instagram-private-api.svg?maxAge=600)](https://github.com/huttarichard/instagram-private-api/blob/master/LICENSE)\n[![Join the chat at https://gitter.im/instagram-private-api/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/instagram-private-api/Lobby)\n\n---\n\n# Next major version\n\nMe and [Nerix](https://github.com/Nerixyz) are ready to announce the next 2.x.x version of this library.\nIt has extended feature list.\nIt's a big release.\nWe have significantly expanded the functionality and capabilities.\nThe library turned into a monorepository and now it's a set of libraries, connected in an ecosystem.\nIt consists of\n\n- Android API\n- Web API\n- FBNS, Realtime\n\nWe've done some work on design decisions.\nWe simplified the state management process.\nNow you can easily make a snapshot of account state, save it in a persistent storage and then restore a 1-to-1 copy with just 1 function call.\nWith new realtime features you can listen for new direct messages, notifications and any other events.\n\nThe new version is hosted in private repository. Access is paid.\nMembers get **basic** support for installation, configuration, and usage.\nWe also will try to react on your feature requests.\n\nYou can contact me in [telegram](https://t.me/bowzee) or [email](mailto:dilame.bowzee@gmail.com) for details.\n\n# AD: SaaS Instagram API\n\nExcited to announce SaaS Instagram API\nhttp://open.igpapi.com/\n\nIt uses OpenAPI specification, so you can generate SDK for any programming language in several minutes.\n\nYou can use it right in the browser without need to have a server.\n\nYou can even use it in React Native. Yes, without bridges.\n\nIt's free for a while, until it's stable. The function set is poor now, because, to be honest i'm not sure if there's a demand for it.\nSo if you would like to use it, have feature-requests or bug reports - please [contact me](https://t.me/bowzee) - i'll implement things you need very fast.\n\n# Table of Contents\n\n- [Install](#install)\n- [Support us](#support-us)\n- [Examples](#examples)\n- [Basic Concepts](#basic-concepts)\n  - [Feeds](#feeds)\n  - [Repositories](#repositories)\n  - [Services](#services)\n- [Contribution](#contribution)\n- [Useful Links](#useful-links)\n  - [Special Thanks](#special-thanks)\n  - [Thanks to Contributors](#thanks-to-contributors)\n  - [End User License Agreement (EULA)](#end-user-license-agreement-eula)\n\n# Install\n\nFrom npm\n\n```\nnpm install instagram-private-api\n```\n\nFrom github\n\n```\nnpm install github:dilame/instagram-private-api\n```\n\n# Support us\n\nIf you find this library useful for you, you can support it by donating any amount\n\nBTC: 1Dqnz9QuswAvD3t7Jsw7LhwprR6HAWprW6\n\n# Examples\n\nYou can find usage examples [here](examples)\n\n_Note for JavaScript users:_\nAs of Node v.13.5.0, there isn't support for ESModules and the 'import'-syntax.\nSo you have to read the imports in the examples like this:\n\n`import { A } from 'b'` ➡ `const { A } = require('b')`\n\n```typescript\nimport { IgApiClient } from './index';\nimport { sample } from 'lodash';\nconst ig = new IgApiClient();\n// You must generate device id's before login.\n// Id's generated based on seed\n// So if you pass the same value as first argument - the same id's are generated every time\nig.state.generateDevice(process.env.IG_USERNAME);\n// Optionally you can setup proxy url\nig.state.proxyUrl = process.env.IG_PROXY;\n(async () => {\n  // Execute all requests prior to authorization in the real Android application\n  // Not required but recommended\n  await ig.simulate.preLoginFlow();\n  const loggedInUser = await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);\n  // The same as preLoginFlow()\n  // Optionally wrap it to process.nextTick so we dont need to wait ending of this bunch of requests\n  process.nextTick(async () => await ig.simulate.postLoginFlow());\n  // Create UserFeed instance to get loggedInUser's posts\n  const userFeed = ig.feed.user(loggedInUser.pk);\n  const myPostsFirstPage = await userFeed.items();\n  // All the feeds are auto-paginated, so you just need to call .items() sequentially to get next page\n  const myPostsSecondPage = await userFeed.items();\n  await ig.media.like({\n    // Like our first post from first page or first post from second page randomly\n    mediaId: sample([myPostsFirstPage[0].id, myPostsSecondPage[0].id]),\n    moduleInfo: {\n      module_name: 'profile',\n      user_id: loggedInUser.pk,\n      username: loggedInUser.username,\n    },\n    d: sample([0, 1]),\n  });\n})();\n```\n\n## Signup via phone example\n\n```typescript\nimport { IgApiClient } from './index';\nimport { sample } from 'lodash';\nconst ig = new IgApiClient();\n// You must generate device id's before login.\n// Id's generated based on seed\n// So if you pass the same value as first argument - the same id's are generated every time\nig.state.generateDevice(process.env.IG_USERNAME);\n// Optionally you can setup proxy url\nig.state.proxyUrl = process.env.IG_PROXY;\n(async () => {\n  // Execute all requests prior to authorization in the real Android application\n  // Not required but recommended\n  await ig.simulate.preLoginFlow();\n\n  const phone_number: string = '79178272727';\n  await ig.account.sendSignupSmsCode(phone_number);\n  const verification_code: string = '123456';\n  await ig.account.validateSignupSmsCode(phone_number, verification_code);\n  const loggedInUser = await ig.account.createValidated({\n    phone_number,\n    verification_code,\n    username: 'something',\n    first_name: 'Someone',\n    password: 'password',\n    year: '1995',\n    month: '05',\n    day: '05',\n  });\n\n  // The same as preLoginFlow()\n  // Optionally wrap it to process.nextTick so we dont need to wait ending of this bunch of requests\n  process.nextTick(async () => await ig.simulate.postLoginFlow());\n\n  // Create UserFeed instance to get loggedInUser's posts\n  const userFeed = ig.feed.user(loggedInUser.pk);\n  const myPostsFirstPage = await userFeed.items();\n  // All the feeds are auto-paginated, so you just need to call .items() sequentially to get next page\n  const myPostsSecondPage = await userFeed.items();\n  await ig.media.like({\n    // Like our first post from first page or first post from second page randomly\n    mediaId: sample([myPostsFirstPage[0].id, myPostsSecondPage[0].id]),\n    moduleInfo: {\n      module_name: 'profile',\n      user_id: loggedInUser.pk,\n      username: loggedInUser.username,\n    },\n    d: sample([0, 1]),\n  });\n})();\n```\n\n# Basic concepts\n\n## Feeds\n\nFeed allows you to get data. Every feed is accessible via `ig.feed.feedName`. See [nice example](https://github.com/dilame/instagram-private-api/blob/master/examples/account-followers.feed.example.ts) and learn how to work with library feeds.\n\nAvailable feeds key list:\n\n`accountFollowers`, `accountFollowing`, `news`, `discover`, `pendingFriendships`, `blockedUsers`, `directInbox`, `directPending`, `directThread`, `user`, `tag`, `location`, `mediaComments`, `reelsMedia`, `reelsTray`, `timeline`, `musicTrending`, `musicSearch`, `musicGenre`, `musicMood`, `usertags`, `saved`\n\nMost of the feeds requires initialization parameter, like user pk. Check [autogenerated docs](https://github.com/dilame/instagram-private-api/tree/master/docs), every feed doc link starts with `feeds/` and contains constructor with argument if needed.\n\n## Repositories\n\nRepositories implements low-level atomic operations. Any repository method must make at most one api-request. There is repository listing below, so you can get information about methods of each repository from our autogenerated docs.\n\nKeys is a little hints, with it you will be able to get access to repository via `ig.key`.\n\n| Key              | Repository class documentation                                                                                                                                          |\n| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `account`        | [AccountRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_account_repository_.accountrepository.md)                    |\n| `attribution`    | [AttributionRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_attribution_repository_.attributionrepository.md)        |\n| `challenge`      | [ChallengeRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_challenge_repository_.challengerepository.md)              |\n| `consent`        | [ConsentRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_consent_repository_.consentrepository.md)                    |\n| `creatives`      | [CreativesRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_creatives_repository_.creativesrepository.md)              |\n| `direct`         | [DirectRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_direct_repository_.directrepository.md)                       |\n| `directThread`   | [DirectThreadRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_direct_thread_repository_.directthreadrepository.md)    |\n| `discover`       | [DiscoverRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_discover_repository_.discoverrepository.md)                 |\n| `fbsearch`       | [FbsearchRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_fbsearch_repository_.fbsearchrepository.md)                 |\n| `friendship`     | [FriendshipRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_friendship_repository_.friendshiprepository.md)           |\n| `launcher`       | [LauncherRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_launcher_repository_.launcherrepository.md)                 |\n| `linkedAccount`  | [LinkedAccountRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_linked_account_repository_.linkedaccountrepository.md) |\n| `live`           | [LiveRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_live_repository_.liverepository.md)                             |\n| `location`       | [LocationRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_location_repository_.locationrepository.md)                 |\n| `locationSearch` | [LocationSearch](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_location_search_repository_.locationsearch.md)                  |\n| `loom`           | [LoomRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_loom_repository_.loomrepository.md)                             |\n| `media`          | [MediaRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_media_repository_.mediarepository.md)                          |\n| `music`          | [MusicRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_music_repository_.musicrepository.md)                          |\n| `news`           | [NewsRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_news_repository_.newsrepository.md)                             |\n| `qe`             | [QeRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_qe_repository_.qerepository.md)                                   |\n| `qp`             | [QpRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_qp_repository_.qprepository.md)                                   |\n| `tag`            | [TagRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_tag_repository_.tagrepository.md)                                |\n| `upload`         | [UploadRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_upload_repository_.uploadrepository.md)                       |\n| `user`           | [UserRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_user_repository_.userrepository.md)                             |\n| `zr`             | [ZrRepository](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_repositories_zr_repository_.zrrepository.md)                                   |\n\n## Services\n\nServices will help you to maintain some actions without calling a couple repositority methods or perform complex things like pre and postlogin flow simulations or photo/video publishing.\n\n| Key        | Service class documentation                                                                                                                |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| `publish`  | [PublishService](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_services_publish_service_.publishservice.md)    |\n| `search`   | [SearchService](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_services_search_service_.searchservice.md)       |\n| `simulate` | [SimulateService](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_services_simulate_service_.simulateservice.md) |\n| `story`    | [StoryService](https://github.com/dilame/instagram-private-api/blob/master/docs/classes/_services_story_service_.storyservice.md)          |\n\n# Debugging\n\nIn order to get debug infos provided by the library, you can enable debugging.\nThe prefix for this library is `ig`.\nTo get all debug logs (_recommended_) set the namespace to `ig:*`.\n\n#### Node\n\nIn node you only have to set the environment variable `DEBUG` to the desired namespace.\n[Further information](https://github.com/visionmedia/debug#environment-variables)\n\n#### Browser\n\nIn the browser you have to set `localStorage.debug` to the desired namespace.\n[Further information](https://github.com/visionmedia/debug#browser-support)\n\n# Contribution\n\nIf you need features that is not implemented - feel free to implement and create PRs!\n\nPlus we need some documentation, so if you are good in it - you are welcome.\n\nSetting up your environment is described [here](CONTRIBUTING.md).\n\n# Useful links\n\n[instagram-id-to-url-segment](https://www.npmjs.com/package/instagram-id-to-url-segment) - convert the image url fragment to the media ID\n\n## Special thanks\n\n- [Richard Hutta](https://github.com/huttarichard), original author of this library. Thanks to him for starting it.\n\n## Thanks to contributors\n\n- [Nerixyz](https://github.com/Nerixyz), for writing a huge amount of code for this library.\n","readmeFilename":"README.md"}