{ "info": { "author": "ping", "author_email": "lastmodified@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Instagram Private API\n\nA Python wrapper for the Instagram private API with no 3rd party dependencies. Supports both the app and web APIs.\n\n![Python 2.7, 3.5](https://img.shields.io/badge/Python-2.7%2C%203.5-3776ab.svg?maxAge=2592000)\n[![Release](https://img.shields.io/github/release/ping/instagram_private_api.svg?colorB=ff7043)](https://github.com/ping/instagram_private_api/releases)\n[![Docs](https://img.shields.io/badge/docs-readthedocs.io-ff4980.svg?maxAge=2592000)](https://instagram-private-api.readthedocs.io/en/latest/)\n[![Build](https://img.shields.io/travis/ping/instagram_private_api.svg)](https://travis-ci.org/ping/instagram_private_api)\n\n[![Build](https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png)](https://www.buymeacoffee.com/ping)\n\n## Overview\n\nI wrote this to access Instagram's API when they clamped down on developer access. Because this is meant to achieve [parity](COMPAT.md) with the [official public API](https://www.instagram.com/developer/endpoints/), methods not available in the public API will generally have lower priority.\n\nProblems? Please check the [docs](https://instagram-private-api.readthedocs.io/en/latest/) before submitting an issue.\n\n## Features\n\n- Supports many functions that are only available through the official app, such as:\n * Multiple feeds, such as [user feed](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.user_feed), [location feed](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.feed_location), [tag feed](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.feed_tag), [popular feed](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.feed_popular)\n * Post a [photo](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.post_photo) or [video](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.post_video) to your feed or stories\n * [Like](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.post_like)/[unlike](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.delete_like) posts\n * Get [post comments](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.media_comments)\n * [Post](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.post_comment)/[delete](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_web_api.Client.delete_comment) comments\n * [Like](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.comment_like)/[unlike](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.comment_unlike) comments\n * [Follow](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.friendships_create)/[unfollow](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.friendships_destroy) users\n * User [stories](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.user_story_feed)\n * And [more](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client)!\n- The web api client supports a subset of functions that do not require login, such as:\n * Get user [info](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_web_api.Client.user_info) and [feed](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_web_api.Client.user_feed)\n * Get [post comments](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_web_api.Client.media_comments)\n * And [more](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_web_api.Client)!\n- Compatible with functions available through the public API using the ClientCompatPatch ([app](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.ClientCompatPatch)/[web](https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_web_api.ClientCompatPatch)) utility class\n- Beta Python 3 support\n\nAn [extension module](https://github.com/ping/instagram_private_api_extensions) is available to help with common tasks like pagination, posting photos or videos.\n\n## Documentation\n\nDocumentation is available at https://instagram-private-api.readthedocs.io/en/latest/\n\n## Install\n\nInstall with pip:\n\n``pip install git+https://git@github.com/ping/instagram_private_api.git@1.6.0``\n\nTo update:\n\n``pip install git+https://git@github.com/ping/instagram_private_api.git@1.6.0 --upgrade``\n\nTo update with latest repo code:\n\n``pip install git+https://git@github.com/ping/instagram_private_api.git --upgrade --force-reinstall``\n\nTested on Python 2.7 and 3.5.\n\n## Usage\n\nThe [app API client](instagram_private_api/) emulates the official app and has a larger set of functions. The [web API client](instagram_web_api/) has a smaller set but can be used without logging in.\n\nYour choice will depend on your use case.\n\nThe [``examples/``](examples/) and [``tests/``](tests/) are a good source of detailed sample code on how to use the clients, including a simple way to save the auth cookie for reuse.\n\n### Option 1: Use the [official app's API](instagram_private_api/)\n\n```python\n\nfrom instagram_private_api import Client, ClientCompatPatch\n\nuser_name = 'YOUR_LOGIN_USER_NAME'\npassword = 'YOUR_PASSWORD'\n\napi = Client(user_name, password)\nresults = api.feed_timeline()\nitems = [item for item in results.get('feed_items', [])\n if item.get('media_or_ad')]\nfor item in items:\n # Manually patch the entity to match the public api as closely as possible, optional\n # To automatically patch entities, initialise the Client with auto_patch=True\n ClientCompatPatch.media(item['media_or_ad'])\n print(item['media_or_ad']['code'])\n```\n\n### Option 2: Use the [official website's API](instagram_web_api/)\n\n```python\n\nfrom instagram_web_api import Client, ClientCompatPatch, ClientError, ClientLoginError\n\n# Without any authentication\nweb_api = Client(auto_patch=True, drop_incompat_keys=False)\nuser_feed_info = web_api.user_feed('329452045', count=10)\nfor post in user_feed_info:\n print('%s from %s' % (post['link'], post['user']['username']))\n\n# Some endpoints, e.g. user_following are available only after authentication\nauthed_web_api = Client(\n auto_patch=True, authenticate=True,\n username='YOUR_USERNAME', password='YOUR_PASSWORD')\n\nfollowing = authed_web_api.user_following('123456')\nfor user in following:\n print(user['username'])\n\n# Note: You can and should cache the cookie even for non-authenticated sessions.\n# This saves the overhead of a single http request when the Client is initialised.\n```\n\n### Avoiding Re-login\n\nYou are advised to persist/cache the auth cookie details to avoid logging in every time you make an api call. Excessive logins is a surefire way to get your account flagged for removal. It's also advisable to cache the client details such as user agent, etc together with the auth details.\n\nThe saved auth cookie can be reused for up to **90 days**.\n\n## Donate\n\nWant to keep this project going? Please donate generously [https://www.buymeacoffee.com/ping](https://www.buymeacoffee.com/ping)\n\n[![Build](https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png)](https://www.buymeacoffee.com/ping)\n\n## Support\n\nMake sure to review the [contributing documentation](CONTRIBUTING.md) before submitting an issue report or pull request.\n\n## Legal\n\nDisclaimer: This is not affliated, endorsed or certified by Instagram. This is an independent and unofficial API. Strictly **not for spam**. Use at your own risk.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ping/instagram_private_api/tree/master", "keywords": "instagram private api", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "instagram-private-api", "package_url": "https://pypi.org/project/instagram-private-api/", "platform": "", "project_url": "https://pypi.org/project/instagram-private-api/", "project_urls": { "Homepage": "https://github.com/ping/instagram_private_api/tree/master" }, "release_url": "https://pypi.org/project/instagram-private-api/1.6.0.0/", "requires_dist": null, "requires_python": "", "summary": "A client interface for the private Instagram API.", "version": "1.6.0.0" }, "last_serial": 5232205, "releases": { "1.6.0.0": [ { "comment_text": "", "digests": { "md5": "ef11cdcc4021cd71a3875dbabb1d05d2", "sha256": "5f9403fbd359764b2d070fa8ac22bc4546ec5a53c45676bcddafa66dc74d2f07" }, "downloads": -1, "filename": "instagram_private_api-1.6.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ef11cdcc4021cd71a3875dbabb1d05d2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 78885, "upload_time": "2019-05-06T11:32:26", "url": "https://files.pythonhosted.org/packages/55/4c/6a37c5f1f2777191104970452ff495d2579ffcdfa73d2cb617e865f9c554/instagram_private_api-1.6.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1a0c5df146053511be880bad96c16664", "sha256": "dfe0c2cb5aa881b98b2e428c3b02fa664a52af3f2d2354c19c4a8967cedf5d8e" }, "downloads": -1, "filename": "instagram_private_api-1.6.0.0.tar.gz", "has_sig": false, "md5_digest": "1a0c5df146053511be880bad96c16664", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66542, "upload_time": "2019-05-06T11:32:28", "url": "https://files.pythonhosted.org/packages/ca/81/282d8f016de44260296e1fd50ec6aaadb6c542d3bab982eb14783b54cf8b/instagram_private_api-1.6.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ef11cdcc4021cd71a3875dbabb1d05d2", "sha256": "5f9403fbd359764b2d070fa8ac22bc4546ec5a53c45676bcddafa66dc74d2f07" }, "downloads": -1, "filename": "instagram_private_api-1.6.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ef11cdcc4021cd71a3875dbabb1d05d2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 78885, "upload_time": "2019-05-06T11:32:26", "url": "https://files.pythonhosted.org/packages/55/4c/6a37c5f1f2777191104970452ff495d2579ffcdfa73d2cb617e865f9c554/instagram_private_api-1.6.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1a0c5df146053511be880bad96c16664", "sha256": "dfe0c2cb5aa881b98b2e428c3b02fa664a52af3f2d2354c19c4a8967cedf5d8e" }, "downloads": -1, "filename": "instagram_private_api-1.6.0.0.tar.gz", "has_sig": false, "md5_digest": "1a0c5df146053511be880bad96c16664", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66542, "upload_time": "2019-05-06T11:32:28", "url": "https://files.pythonhosted.org/packages/ca/81/282d8f016de44260296e1fd50ec6aaadb6c542d3bab982eb14783b54cf8b/instagram_private_api-1.6.0.0.tar.gz" } ] }