{ "info": { "author": "Erik Lopez", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Instpector\n\nA simple Instagram's web API library written in Python. Supports login with two-factor authentication enabled. No selenium or webdriver required.\n\n## Installation\n\n```\npip install instpector\n```\n\n# Sample usage\n\n```python\nfrom instpector import Instpector, endpoints\n\ninstpector = Instpector()\ninstpector.login(\"my_username\", \"my_password\")\n\nprofile = endpoints.factory.create(\"profile\", instpector)\nfollowers = endpoints.factory.create(\"followers\", instpector)\n\ninsta_profile = profile.of_user(\"some_username\")\n\n# Loop through all followers\nfor follower in followers.of_user(insta_profile.id):\n print(follower.username)\n\ninstpector.logout()\n```\n\n## Using 2FA\nFor login in using two-factor authentication, generate your 2fa key once on Instagram's app and provide the code when logging in with `instpector`. The following example uses `pytop` to demonstrate the usage:\n\n```python\nfrom pyotp import TOTP\nfrom instpector import Instpector, endpoints\n\ninstpector = Instpector()\ntotp = TOTP(\"my_2fa_key\") # Input without spaces\n\n# Login into Instagram's web\ninstpector.login(\"my_username\", \"my_password\", totp.now())\n```\n\n# Examples\n\nCheck out more examples [here](https://github.com/niuware/instpector/tree/master/examples).\n\n# Endpoints\n\n- Followers \n- Following \n- Timeline \n- Profile \n- Story Reel \n- Story \n\nMore to come\n\n# API\n\n## Classes\n\n`Instpector`\n\n|Method|Details|\n|---|---|\n|login(user, password, two_factor_code=None)|Login to an Instagram account. If your account is 2FA protected provide the 2FA code as in the [provided example](https://github.com/niuware/instpector/blob/master/examples/two_factor_auth.py).|\n|logout()|Logouts from an Instagram account|\n|session()|Returns the current session used by `instpector`|\n\n`EndpointFactory`\n\n|Method|Details|\n|---|---|\n|create(endpoint_name, instpector_instance)|Creates and returns an endpoint instance based on the provided name. Available endpoint names are: `\"followers\"`, `\"following\"`, `\"profile\"`, `\"timeline\"`, `\"story_reel\"` and `\"story\"`|\n\n## Endpoints\n\n### Profile\n\nGets the profile of any public or friend user account.\n\n|Method|Details|\n|---|---|\n|of_user(username)|Returns a `TProfile` instance for the provided username.|\n\n### Followers\n\nEndpoint for accessing the follower list of any public or friend user account.\n\n|Method|Details|\n|---|---|\n|of_user(user_id)|Returns a generator of `TUser` instances with all followers. Note the method receives a user id and not a username. To get the user id use the `Profile` endpoint.|\n\n### Following\n\nEndpoint for accessing the followees list of any public or friend user account.\n\n|Method|Details|\n|---|---|\n|of_user(user_id)|Returns a generator of `TUser` instances with all followees. Note the method receives a user id and not a username. To get the user id use the `Profile` endpoint.|\n\n### Timeline\n\nEndpoint for accessing the timeline of any public or friend account.\n\n|Method|Details|\n|---|---|\n|of_user(user_id)|Returns a generator of `TTimelinePost` instances with all timeline posts. Note the method receives a user id and not a username. To get the user id use the `Profile` endpoint.|\n|download(timeline_post, only_image=False, low_quality=False)|Downloads and save the available resources (image and video) for the provided `TTimelinePost`. The file name convention is `ownerid_resourceid.extension` and saved in the execution directory. If `low_quality` is `True` the resource will be the downloaded with the lowest size available (only for image). If `only_image` is `True` a video file resource won't be downloaded.|\n\n### StoryReel\n\nEndpoint for accessing the story reel (stories) of any public or friend user account.\n\n|Method|Details|\n|---|---|\n|of_user(user_id)|Returns a generator of `TStoryReelItem` instances with all stories. Note the method receives a user id and not a username. To get the user id use the `Profile` endpoint.|\n|download(story_item, only_image=False, low_quality=False)|Downloads and save the available resources (image and video) for the provided `TStoryReelItem`. The file name convention is `ownerid_resourceid.extension` and saved in the execution directory. If `low_quality` is `True` the resource will be the downloaded with the lowest size available. If `only_image` is `True` a video file resource won't be downloaded.|\n\n### Story\n\nEndpoint for accessing the story details of a story reel item. This endpoint is only available for stories posted by the current logged in user.\n\n|Method|Details|\n|---|---|\n|viewers_for(story_id)|Returns a generator of `TStoryViewer` instances with all viewers of the provided story id.|\n\n## Types\n\n### TUser\n\n|Field|Type|Details|\n|---|---|---|\n|id|`string`|The Instagram Id of the user|\n|username|`string`|The user's name|\n|full_name|`string`|The full name of the user|\n|is_private|`bool`|A flag to show if the user account is private|\n\n### TProfile\n\n|Field|Type|Details|\n|---|---|---|\n|id|`string`|The Instagram Id of the user|\n|username|`string`|The user's name|\n|biography|`string`|The biography of the user|\n|is_private|`bool`|A flag to show if the user account is private|\n|followers_count|`integer`|The follower count of the user|\n|following_count|`integer`|The following count of the user|\n\n### TTimelinePost\n|Field|Type|Details|\n|---|---|---|\n|id|`string`|The Instagram Id of the user|\n|owner|`string`|The owner account Instagram Id|\n|timestamp|`integer`|The timestamp of the post|\n|is_video|`bool`|A flag to know if the story is a video|\n|like_count|`integer`|The like count of the post|\n|comment_count|`integer`|The comment count of the post|\n|display_resources|`list`|A list of image URLs associated with the post|\n|video_url|`string`|The video URL (if available) associated with the post|\n\n### TStoryReelItem\n|Field|Type|Details|\n|---|---|---|\n|id|`string`|The Instagram Id of the story|\n|owner|`string`|The owner account Instagram Id|\n|timestamp|`integer`|The timestamp of the story|\n|expire_at|`integer`|The expiration timestamp of the story|\n|audience|`string`|The type of audience of the story. If public the value is `MediaAudience.DEFAULT`, if private the value is `MediaAudience.BESTIES`|\n|is_video|`bool`|A flag to know if the story is a video|\n|view_count|`integer`|The view count of the story. The count is only available for stories posted by the currently logged in user. Other accounts will have a count equal to `0`.|\n|display_resources|`list`|A list of image URLs associated with the story|\n|video_resources|`list`|A list of video URLs associated with the story|\n\n### TStoryViewer\n|Field|Type|Details|\n|---|---|---|\n|id|`string`|The Instagram Id of the story viewer|\n|username|`string`|The user name of the viewer|\n\n# Development dependencies\n\n- requests\n\n# Tests\n\n1. Create a `pytest.ini` file with the sample contents of `pytest.sample.ini` in the `tests` directory.\n\n2. Add your account information. \n3. Run with `pytest`:\n```\n(env)$ pytest -qs tests\n```\n\n# Disclaimer\n\nThis tool is not affiliated with, authorized, maintained or endorsed by Instagram or any of its affiliates or subsidiaries. Use at your own risk.\n\n# License\n\nLicensed under MIT License.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/niuware/instpector/archive/0.2.2.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/niuware/instpector", "keywords": "instagram web-api instagram-client", "license": "", "maintainer": "", "maintainer_email": "", "name": "instpector", "package_url": "https://pypi.org/project/instpector/", "platform": "", "project_url": "https://pypi.org/project/instpector/", "project_urls": { "Download": "https://github.com/niuware/instpector/archive/0.2.2.tar.gz", "Homepage": "https://github.com/niuware/instpector" }, "release_url": "https://pypi.org/project/instpector/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "A simple Instagram's web API library", "version": "0.2.2" }, "last_serial": 5942428, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "2c9921fd2e0d6bdb3fdca71b3132e5ee", "sha256": "b66ba58c8515ce3c9af86df79ada82c91d4a6705a53396f27b74d6593fcd686d" }, "downloads": -1, "filename": "instpector-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2c9921fd2e0d6bdb3fdca71b3132e5ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6034, "upload_time": "2019-07-05T08:52:40", "url": "https://files.pythonhosted.org/packages/38/91/cfbe3c679dd6cea2bc16805cb0925a84b2a97bdd19fe6aa757f8f56db7ef/instpector-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "19d85310be0a410e6f07126ca1f16ed3", "sha256": "1c50b1945283d7d24e3c6578045ea045b590eb91d579fd12130461db7d755337" }, "downloads": -1, "filename": "instpector-0.1.2.tar.gz", "has_sig": false, "md5_digest": "19d85310be0a410e6f07126ca1f16ed3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6393, "upload_time": "2019-07-06T02:34:25", "url": "https://files.pythonhosted.org/packages/93/ec/2da255b67339717fb825335ec87b2fee11747ef19ae20f7d5f6df7fe2766/instpector-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "e655f8cede4003c1231c88c4c6fd9a2f", "sha256": "9723196afb96478dc0e2347b37fff4bab200063c2162c766ba9a5262492e51a0" }, "downloads": -1, "filename": "instpector-0.1.3.tar.gz", "has_sig": false, "md5_digest": "e655f8cede4003c1231c88c4c6fd9a2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6469, "upload_time": "2019-07-06T09:18:11", "url": "https://files.pythonhosted.org/packages/e8/aa/2612d388485e938cb87fa16eb69a6adf582c11a06002b317d7efb161c204/instpector-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "8f8aed4b75c4543e35c886d35ea93d17", "sha256": "ffcb22df2071e5d5c53a33c9c93d1a2b3de0d7ae44d53288cf9d3e4297d36b4b" }, "downloads": -1, "filename": "instpector-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8f8aed4b75c4543e35c886d35ea93d17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6698, "upload_time": "2019-07-07T03:20:41", "url": "https://files.pythonhosted.org/packages/cf/34/27f4311675a856e21300e1265a7c755e5aae690d3d25f10e204f0973a555/instpector-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "ed923aa6b957bd1bf2c14c8dd761161b", "sha256": "a17bb42a4b9f3ce2b8fc69959ac9916c99469099a1458483bfcd38d2a1f73eae" }, "downloads": -1, "filename": "instpector-0.1.5.tar.gz", "has_sig": false, "md5_digest": "ed923aa6b957bd1bf2c14c8dd761161b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6867, "upload_time": "2019-07-08T01:23:08", "url": "https://files.pythonhosted.org/packages/e9/30/c9ea8e5afd05f9bf1f5872b21735f11e6650567d1b8574a9a357679183f2/instpector-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "1dbc24afa858e5a465bbc2d691159f14", "sha256": "08aa09a830e1742b83614f5ea7a32f66a391e7801d94c14464d7031c6e17feb5" }, "downloads": -1, "filename": "instpector-0.1.6.tar.gz", "has_sig": false, "md5_digest": "1dbc24afa858e5a465bbc2d691159f14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7565, "upload_time": "2019-07-16T09:45:58", "url": "https://files.pythonhosted.org/packages/41/2c/2034be668f4cb3c150dd835f96a5c96a5d54e556e91f1a05083df0fa95b7/instpector-0.1.6.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "6350406bf33198b511204c52a746a364", "sha256": "54e1be2f80cc69f7c2c26f9ae10c5eb6c72875a34a438e0ba51a67eb62c593ef" }, "downloads": -1, "filename": "instpector-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6350406bf33198b511204c52a746a364", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8031, "upload_time": "2019-08-13T14:16:09", "url": "https://files.pythonhosted.org/packages/b8/08/1aaab089ce2cda151315b8b490a8b81a2605af855b2e502c4e9b3752e463/instpector-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "7ae697221813071dd493fbe0bfadac38", "sha256": "adf583e549b001c8f77d7ab1d58d4f1df5d1d378000127a615cba6169e8b50af" }, "downloads": -1, "filename": "instpector-0.2.1.tar.gz", "has_sig": false, "md5_digest": "7ae697221813071dd493fbe0bfadac38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9843, "upload_time": "2019-10-07T09:12:10", "url": "https://files.pythonhosted.org/packages/ff/25/6e12dcc22678bc5f959192e5b934bb6feb8975f6592b6e89711148c6b858/instpector-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "b2b9f2b57345aeaf5f86ffe585b511ab", "sha256": "3d6c452e81eac01e62d2fa0fa17a70db30427fece2c17381b0856ddc7a289e4b" }, "downloads": -1, "filename": "instpector-0.2.2.tar.gz", "has_sig": false, "md5_digest": "b2b9f2b57345aeaf5f86ffe585b511ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10018, "upload_time": "2019-10-08T01:49:38", "url": "https://files.pythonhosted.org/packages/66/16/fa2a7e09e28027e7338e0752d3da92c4ba79912fbc29f8216bf0ad763a6a/instpector-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b2b9f2b57345aeaf5f86ffe585b511ab", "sha256": "3d6c452e81eac01e62d2fa0fa17a70db30427fece2c17381b0856ddc7a289e4b" }, "downloads": -1, "filename": "instpector-0.2.2.tar.gz", "has_sig": false, "md5_digest": "b2b9f2b57345aeaf5f86ffe585b511ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10018, "upload_time": "2019-10-08T01:49:38", "url": "https://files.pythonhosted.org/packages/66/16/fa2a7e09e28027e7338e0752d3da92c4ba79912fbc29f8216bf0ad763a6a/instpector-0.2.2.tar.gz" } ] }