{"id":13824900,"url":"https://github.com/diezo/Ensta","last_synced_at":"2025-07-08T20:32:30.273Z","repository":{"id":173374199,"uuid":"650503528","full_name":"diezo/Ensta","owner":"diezo","description":"🔥 Fast \u0026 Reliable Python Package For Instagram API - 2024","archived":false,"fork":false,"pushed_at":"2025-03-11T20:10:00.000Z","size":1230,"stargazers_count":408,"open_issues_count":19,"forks_count":44,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-11T21:22:36.978Z","etag":null,"topics":["api-wrapper","ensta","instabot","instagram","instagram-account","instagram-api","instagram-api-python","instagram-automation","instagram-bot","instagram-client","instagram-crawler","instagram-downloader","instagram-photos","instagram-private-api","instagram-scraper","instagram-sdk","instagram-stories","instapy","instsgram-feed","reels"],"latest_commit_sha":null,"homepage":"https://bit.ly/ensta-discord","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diezo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.buymeacoffee.com/sonii"]}},"created_at":"2023-06-07T07:56:42.000Z","updated_at":"2025-03-11T20:10:04.000Z","dependencies_parsed_at":"2024-03-14T12:26:35.926Z","dependency_job_id":"dc1a06f7-0a78-4f67-b69b-9eca766130f3","html_url":"https://github.com/diezo/Ensta","commit_stats":null,"previous_names":["diezo/ensta"],"tags_count":63,"template":false,"template_full_name":null,"purl":"pkg:github/diezo/Ensta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diezo%2FEnsta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diezo%2FEnsta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diezo%2FEnsta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diezo%2FEnsta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diezo","download_url":"https://codeload.github.com/diezo/Ensta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diezo%2FEnsta/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264343759,"owners_count":23593787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","ensta","instabot","instagram","instagram-account","instagram-api","instagram-api-python","instagram-automation","instagram-bot","instagram-client","instagram-crawler","instagram-downloader","instagram-photos","instagram-private-api","instagram-scraper","instagram-sdk","instagram-stories","instapy","instsgram-feed","reels"],"created_at":"2024-08-04T09:01:11.389Z","updated_at":"2025-07-08T20:32:30.267Z","avatar_url":"https://github.com/diezo.png","language":"Python","funding_links":["https://www.buymeacoffee.com/sonii","https://buymeacoffee.com/sonii"],"categories":["Python"],"sub_categories":[],"readme":"# Ensta - Simple Instagram API\n[![PyPI](https://img.shields.io/pypi/v/ensta)](https://pypi.org/project/ensta)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ensta)]()\n[![Downloads](https://static.pepy.tech/badge/ensta)](https://pepy.tech/project/ensta)\n\n![Logo](https://raw.githubusercontent.com/diezo/Ensta/master/assets/image.jpg)\n\nEnsta is a simple, reliable and up-to-date python package for Instagram API.\n\nBoth **authenticated** and **anonymous** requests are supported.\n\n[\u003cimg style=\"margin-top: 10px\" src=\"https://raw.githubusercontent.com/diezo/Ensta/master/assets/coffee.svg\" width=\"180\"/\u003e](https://buymeacoffee.com/sonii)\n\n\u003c!-- ### Python \u0026 Instagram Automation Services\nI'm available for freelance work in Python development with a focus on Instagram automation. If you have a project that requires expertise in automating tasks on Instagram, feel free to contact me at **sonniiii@outlook.com** or message me on discord [**@gitdiezo**](https://discordapp.com/users/1183040947035062382). --\u003e\n\n## Revive the Project! 🌟\nContribute to ensta and help revive the project for future updates and maintainance.\n\n[\u003cimg src=\"https://raw.githubusercontent.com/diezo/Ensta/master/assets/coffee.svg\" width=\"170\"/\u003e](https://buymeacoffee.com/sonii)\n\n## Installation\nRead the [**pre-requisites**](https://github.com/diezo/Ensta/wiki/Pre%E2%80%90requisites) here.\n\n    pip install ensta\n\n## Example\nFetching profile info by username:\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nprofile = mobile.profile(\"leomessi\")\n\nprint(profile.full_name)\nprint(profile.biography)\nprint(profile.profile_pic_url)\n```\n\n## Features\nThese features use the **Mobile API**.\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUsing Proxies\u003c/summary\u003e\u003cbr\u003e\n\nWhen to use a proxy:\n- You're being rate limited.\n- Ensta is not working because your Home IP is flagged.\n- You're deploying Ensta to the cloud. (Instagram blocks requests from IPs of cloud providers, so a proxy must be used)\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(\n    username,\n    password,\n    proxy={\n        \"http\": \"socks5://username:password@host:port\",\n        \"https\": \"socks5://username:password@host:port\"\n    }\n)\n```\n\nEnsta uses the same proxy settings as the **requests** module.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUsername-Password Login\u003c/summary\u003e\u003cbr\u003e\n\nUsername is recommended to sign in. However, email can also be used.\n\n```python\nfrom ensta import Mobile\n\n# Recommended\nmobile = Mobile(username, password)\n\n# This also works\nmobile = Mobile(email, password)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eChange Profile Picture\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.change_profile_picture(\"image.jpg\")\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eFetch Profile Information\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nprofile = mobile.profile(\"leomessi\")\n\nprint(profile.full_name)\nprint(profile.biography)\nprint(profile.follower_count)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eFollow/Unfollow Account\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.follow(\"leomessi\")\nmobile.unfollow(\"leomessi\")\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eChange Biography\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.change_biography(\"New bio here.\")\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSwitch to Private/Public Account\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.switch_to_private_account()\nmobile.switch_to_public_account()\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUsername to UserID / UserID to Username\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.username_to_userid(\"leomessi\")\nmobile.userid_to_username(\"12345678\")\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eLike/Unlike Post\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.like(media_id)\nmobile.unlike(media_id)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eFetch Followers/Followings\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nfollowers = mobile.followers(\"leomessi\")\nfollowings = mobile.followings(\"leomessi\")\n\nfor user in followers.list:\n    print(user.full_name)\n\nfor user in followings.list:\n    print(user.full_name)\n\n# Fetching next chunk\nfollowers = mobile.followers(\n    \"leomessi\",\n    next_cursor=followers.next_cursor\n)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAdd Comment to Post\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.comment(\"Hello\", media_id)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUpload Photo\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.upload_photo(\n    upload_id=upload_id,\n    caption=\"Hello\"\n)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUpload Sidecar (Multiple Photos)\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\nfrom ensta.structures import SidecarChild\n\nmobile = Mobile(username, password)\n\nmobile.upload_sidecar(\n    children=[\n        SidecarChild(uploda_id),\n        SidecarChild(uploda_id),\n        SidecarChild(uploda_id)\n    ],\n    caption=\"Hello\"\n)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eFetch Private Information (Yours)\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\naccount = mobile.private_info()\n\nprint(account.email)\nprint(account.account_type)\nprint(account.phone_number)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUpdate Display Name\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.update_display_name(\"Lionel Messi\")\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eBlock/Unblock User\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nmobile.block(123456789)  # Use UserID\nmobile.unblock(123456789)  # Use UserID\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUpload Story (Photo)\u003c/summary\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\n\nupload_id = mobile.get_upload_id(\"image.jpg\")\n\nmobile.upload_story(upload_id)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUpload Story (Photo) + Link Sticker\u003c/summary\u003e\n\n```python\nfrom ensta import Mobile\nfrom ensta.structures import StoryLink\n\nmobile = Mobile(username, password)\n\nupload_id = mobile.get_upload_id(\"image.jpg\")\n\nmobile.upload_story(upload_id, entities=[\n    StoryLink(title=\"Google\", url=\"https://google.com\")\n])\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSend Message (Text)\u003c/summary\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)  # Or use email\ndirect = mobile.direct()\n\ndirect.send_text(\"Hello\", thread_id)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSend Message (Picture)\u003c/summary\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)  # Or use email\ndirect = mobile.direct()\n\nmedia_id = direct.fb_upload_image(\"image.jpg\")\n\ndirect.send_photo(media_id, thread_id)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAdd Biography Link\u003c/summary\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)  # Or use email\n\nlink_id = mobile.add_bio_link(\n    url=\"https://github.com/diezo\",\n    title=\"Diezo's GitHub\"\n)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAdd Multiple Biography Links\u003c/summary\u003e\n\n```python\nfrom ensta import Mobile\nfrom ensta.structures import BioLink\n\nmobile = Mobile(username, password)  # Or use email\n\nlink_ids = mobile.add_bio_links([\n    BioLink(url=\"https://example.com\", title=\"Link 1\"),\n    BioLink(url=\"https://example.com\", title=\"Link 2\"),\n    BioLink(url=\"https://example.com\", title=\"Link 3\")\n])\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eRemove Biography Link\u003c/summary\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)  # Or use email\n\nmobile.remove_bio_link(link_id)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eRemove Multiple Biography Links\u003c/summary\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)  # Or use email\n\nmobile.remove_bio_links([\n    link_id_1,\n    link_id_2,\n    link_id_3\n])\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eClear All Biography Links\u003c/summary\u003e\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)  # Or use email\n\nmobile.clear_bio_links()\n```\n\n\u003c/details\u003e\n\n### Deprecated Features (Web API)\nFeatures still using the **Web API**:\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUpload Reel\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Web\n\nhost = Web(username, password)\n\nvideo_id = host.upload_video_for_reel(\"Video.mp4\", thumbnail=\"Thumbnail.jpg\")\n\nhost.pub_reel(\n    video_id,\n    caption=\"Enjoying the winter! ⛄\"\n)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eFetch Web Profile Data\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Web\n\nhost = Web(username, password)\nprofile = host.profile(\"leomessi\")\n\nprint(profile.full_name)\nprint(profile.biography)\nprint(profile.follower_count)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eFetch Someone's Feed\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Web\n\nhost = Web(username, password)\nposts = host.posts(\"leomessi\", 100)  # Want full list? Set count to '0'\n\nfor post in posts:\n    print(post.caption_text)\n    print(post.like_count)    \n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eFetch Post's Likers\u003c/summary\u003e\u003cbr\u003e\n\n```python\nfrom ensta import Web\n\nhost = Web(username, password)\n\npost_id = host.get_post_id(\"https://www.instagram.com/p/Czr2yLmroCQ/\")\nlikers = host.likers(post_id)\n\nfor user in likers.users:\n    print(user.username)\n    print(user.profile_picture_url)\n```\n\n\u003c/details\u003e\n\nThey'll be migrated to the **Mobile API** soon.\n\n## Supported Classes\n\n\u003e [!IMPORTANT]\n\u003e The **Web Class** is deprecated and it's features are being migrated to the **Mobile Class**. It'll be removed from Ensta upon completion.\n\n\u003cdetails\u003e\n\n\u003cbr\u003e\n\n\u003csummary\u003e\u003cb\u003eMobile Class\u003c/b\u003e (Authenticated)\u003c/summary\u003e\n\nRequires login, and has the most features.\n\n```python\nfrom ensta import Mobile\n\nmobile = Mobile(username, password)\nprofile = mobile.profile(\"leomessi\")\n\nprint(profile.full_name)\nprint(profile.biography)\nprint(profile.profile_pic_url)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003cbr\u003e\n\n\u003csummary\u003e\u003cb\u003eGuest Class\u003c/b\u003e (Non-Authenticated)\u003c/summary\u003e\n\nDoesn't require login, but has limited features.\n\n```python\nfrom ensta import Guest\n\nguest = Guest()\nprofile = guest.profile(\"leomessi\")\n\nprint(profile.biography)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003cbr\u003e\n\n\u003csummary\u003e\u003cb\u003eWeb Class\u003c/b\u003e (Authenticated) \u003ci\u003e(Deprecated)\u003c/i\u003e\u003c/summary\u003e\n\n```python\nfrom ensta import Web\n\nhost = Web(username, password)\nprofile = host.profile(\"leomessi\")\n\nprint(profile.biography)\n```\n\n\u003c/details\u003e\n\n## Discord Community\nAsk questions, discuss upcoming features and meet other developers.\n\n[\u003cimg src=\"https://i.ibb.co/qdX7F1b/IMG-20240105-115646-modified-modified.png\" width=\"150\"/\u003e](https://discord.com/invite/pU4knSwmQe)\n\n## Buy Me A Coffee\nSupport me in the development of this project.\n\n[\u003cimg src=\"https://raw.githubusercontent.com/diezo/Ensta/master/assets/coffee.svg\" width=\"170\"/\u003e](https://buymeacoffee.com/sonii)\n\n## Contributors\n[![Contributors](https://contrib.rocks/image?anon=1\u0026repo=diezo/ensta\u0026)](https://github.com/diezo/ensta/graphs/contributors)\n\n## Disclaimer\nThis is a third party library and not associated with Instagram. We're strictly against spam. You are liable for all the actions you take.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiezo%2FEnsta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiezo%2FEnsta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiezo%2FEnsta/lists"}