{"id":13466193,"url":"https://github.com/siongui/instago","last_synced_at":"2025-05-08T02:46:00.142Z","repository":{"id":46321260,"uuid":"121582435","full_name":"siongui/instago","owner":"siongui","description":"Download/access photos, videos, stories, story highlights, postlives, following and followers of Instagram","archived":false,"fork":false,"pushed_at":"2023-03-01T15:07:30.000Z","size":322,"stargazers_count":105,"open_issues_count":4,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T16:53:06.726Z","etag":null,"topics":["downloader","go","golang","gopherjs","instagram","web-scraping","webscraping"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siongui.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-15T01:57:40.000Z","updated_at":"2025-03-12T13:53:27.000Z","dependencies_parsed_at":"2024-01-13T17:59:51.093Z","dependency_job_id":"72c84a64-c8a7-4ece-977f-9118731fb6fa","html_url":"https://github.com/siongui/instago","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siongui%2Finstago","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siongui%2Finstago/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siongui%2Finstago/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siongui%2Finstago/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siongui","download_url":"https://codeload.github.com/siongui/instago/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252989941,"owners_count":21836665,"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":["downloader","go","golang","gopherjs","instagram","web-scraping","webscraping"],"created_at":"2024-07-31T15:00:40.639Z","updated_at":"2025-05-08T02:46:00.123Z","avatar_url":"https://github.com/siongui.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"==================================================================================\nInstagram Photo, Video, Story, Highlight, Postlive, Following, and Follower in Go_\n==================================================================================\n\n.. image:: https://img.shields.io/badge/Language-Go-blue.svg\n   :target: https://golang.org/\n\n.. image:: https://godoc.org/github.com/siongui/instago?status.svg\n   :target: https://godoc.org/github.com/siongui/instago\n\n.. image:: https://api.travis-ci.org/siongui/instago.svg?branch=master\n   :target: https://travis-ci.org/siongui/instago\n\n.. image:: https://goreportcard.com/badge/github.com/siongui/instago\n   :target: https://goreportcard.com/report/github.com/siongui/instago\n\n.. image:: https://img.shields.io/badge/license-Unlicense-blue.svg\n   :target: https://raw.githubusercontent.com/siongui/instago/master/UNLICENSE\n\n.. image:: https://img.shields.io/badge/Status-Beta-brightgreen.svg\n\n.. image:: https://img.shields.io/twitter/url/https/github.com/siongui/instago.svg?style=social\n   :target: https://twitter.com/intent/tweet?text=Wow:\u0026url=%5Bobject%20Object%5D\n\n\nGet Instagram_ media (photos and videos), stories, story highlights, postlives,\nfollowing and followers in Go.\n\nThis package only access Instagram private and public API:\n\n- Based on this package, Chrome extension igdlcrx_ helps you download stories\n  and posts, similiar to `Downloader for Instagram™ + Direct Message`_\n\n- Also based on this package, the package in `download \u003cdownload\u003e`_ directory\n  helps you download media (photos/videos), stories, story highlights, or\n  postlives.\n\nObtain Cookies\n++++++++++++++\n\nUse `Chrome extension in this repo \u003ccrx-cookies\u003e`_ to get the cookies. Load the\nextension using Chrome extension developer mode. Log in to Instagram using\nChrome. Click on the loaded extension button and save the content as\n*auth.json*. We will use it later to access Instagram API.\n\n\nTerminology\n+++++++++++\n\nGiven the URL of the post as follows:\n\n::\n\n  https://www.instagram.com/p/BfJzG64BZVY/\n\nThe *code* of the post is **BfJzG64BZVY**.\n\n\nUsage\n+++++\n\nThis package *instago* only access the Instagram public and private API and get\nmetadata from the API.\n\nInstall the package by ``go get``:\n\n.. code-block:: bash\n\n  $ go get -u github.com/siongui/instago\n\nYou can use the following methods without cookies\n\n- `GetUserInfoNoLogin \u003chttps://godoc.org/github.com/siongui/instago#GetUserInfoNoLogin\u003e`_\n- `GetRecentPostCodeNoLogin \u003chttps://godoc.org/github.com/siongui/instago#GetRecentPostCodeNoLogin\u003e`_\n- `GetUserId \u003chttps://godoc.org/github.com/siongui/instago#GetUserId\u003e`_\n- `GetPostInfoNoLogin \u003chttps://godoc.org/github.com/siongui/instago#GetPostInfoNoLogin\u003e`_\n- `GetUserProfilePicUrlHd \u003chttps://godoc.org/github.com/siongui/instago#GetUserProfilePicUrlHd\u003e`_\n- `GetAllPostMediaNoLogin \u003chttps://godoc.org/github.com/siongui/instago#GetAllPostMediaNoLogin\u003e`_\n\nFor the other methods which need cookies to access Instagram API, you must call\nNewInstagramApiManager_ first:\n\n.. code-block:: go\n\n  import (\n  \t\"github.com/siongui/instago\"\n  )\n\n  mgr := instago.NewInstagramApiManager(\"auth.json\")\n\nThen you can use *mgr* to get metadata from Instagram API. For example, you can\nget all post codes of the user\n`instagram \u003chttps://www.instagram.com/instagram/\u003e`__ as follows:\n\n.. code-block:: go\n\n  codes, err := mgr.GetAllPostCode(\"instagram\")\n  if err != nil {\n  \tpanic(err)\n  }\n\n  for _, code := range codes {\n  \tprintln(\"URL: https://www.instagram.com/p/%s/\\n\", code)\n  }\n\nFor complete examples, see test files (files ends with *_test.go*). The\nfollowing are some examples you may be interested in:\n\n- Get post information: See `post_test.go \u003cpost_test.go\u003e`_\n- Get URLs of all posts of a specific user: See `getall_test.go \u003cgetall_test.go\u003e`_\n- Get id by username: See `userinfo_test.go \u003cuserinfo_test.go\u003e`_\n- Discover top live: See `toplive_test.go \u003ctoplive_test.go\u003e`_\n- Top searches of Instagram web: See `topsearch_test.go \u003ctopsearch_test.go\u003e`_\n\n\nTricks\n++++++\n\n- Use the following User-Agent to get post-live field in reels tray feed.\n\n  **Instagram 10.26.0 (iPhone8,1; iOS 10_2; en_US; en-US; scale=2.00; gamut=normal; 750x1334) AppleWebKit/420+**\n\n  From `replay.py`_ in `instagram_private_api_extensions`_\n\n- Get all user's media:\n\n  * `How can I get a user's media from Instagram without authenticating as a user? - Stack Overflow \u003chttps://stackoverflow.com/a/47243409\u003e`_\n  * `instagram_web_api.client — instagram_private_api 1.4.1 documentation \u003chttps://instagram-private-api.readthedocs.io/en/latest/_modules/instagram_web_api/client.html#Client.user_feed\u003e`_\n  * `instagram graphql api id - Google search \u003chttps://www.google.com/search?q=instagram+graphql+api+id\u003e`_\n\n- `Web scraping: instagram.com | Shiori \u003chttps://kaijento.github.io/2017/05/17/web-scraping-instagram.com/\u003e`_\n\n- | `query_hash on instagram graphql - Google search \u003chttps://www.google.com/search?q=query_hash+on+instagram+graphql\u003e`_\n  | `How to scrape pages with infinite scroll: extracting data from Instagram - Diggernaut \u003chttps://www.diggernaut.com/blog/how-to-scrape-pages-infinite-scroll-extracting-data-from-instagram/\u003e`_\n  | `colly instagram example \u003chttps://github.com/gocolly/colly/blob/master/_examples/instagram/instagram.go\u003e`_\n\n- Do not remove query string in the URLs of photo/viedo/story/highlight. It may\n  cause 403 Forbidden when downloading the URL. See `issue #2`_ for more info.\n\n- Saved endpoint: see `ping/instagram_private_api \u003chttps://github.com/ping/instagram_private_api\u003e`_\n\n- postlive URL issue: Google search \"Bad URL timestamp\". See `Instagram reports \"Bad URL timestamp\" \u003chttps://www.reddit.com/r/ifttt/comments/e79x24/instagram_reports_bad_url_timestamp/\u003e`_. replacing \u0026amp; with \u0026 in the access link.\n\n\nPrivate API\n+++++++++++\n\n- `Get data from Instagram's private API — Alberto Moral \u003chttps://www.albertomoral.com/blog/get-data-from-instagrams-private-api\u003e`_\n- `What is the API Endpoints for the Feeds \"People who liked my posts\" and \"Activities from my followings\" · Issue #42 · huttarichard/instagram-private-api · GitHub \u003chttps://github.com/huttarichard/instagram-private-api/issues/42\u003e`_\n- `Search · go instagram · GitHub \u003chttps://github.com/search?q=go+instagram\u003e`_\n  then found `Update timeline API from Get to Post \u003chttps://github.com/hieven/go-instagram/commit/6800b3f7b9513fb0084024e405109d939572a961\u003e`_\n- `private API reference - github.com/ping/instagram_private_api \u003chttps://github.com/ping/instagram_private_api/blob/master/instagram_private_api/endpoints/feed.py\u003e`_\n\nUNLICENSE\n+++++++++\n\nReleased in public domain. See UNLICENSE_.\n\n\nReferences\n++++++++++\n\n.. [1] `GitHub - siongui/goiguserid: Get id of Instagram user in Go \u003chttps://github.com/siongui/goiguserid\u003e`_\n.. [2] `GitHub - siongui/goigstorylink: Get Links (URL) of Instagram Stories in Go \u003chttps://github.com/siongui/goigstorylink\u003e`_\n.. [3] `GitHub - siongui/goigfollow: Get Instagram following and followers in Go \u003chttps://github.com/siongui/goigfollow\u003e`_\n.. [4] `GitHub - siongui/goigstorydl: Download Instagram Stories in Go \u003chttps://github.com/siongui/goigstorydl\u003e`_\n.. [5] `GitHub - siongui/goigmedia: Get links of Instagram user media (photos and videos) in Go. \u003chttps://github.com/siongui/goigmedia\u003e`_\n.. [6] `JSON Formatter \u0026 Validator \u003chttps://jsonformatter.curiousconcept.com/\u003e`_\n\n.. _Go: https://golang.org/\n.. _Instagram: https://www.instagram.com/\n.. _Chrome Developer Tools: https://developer.chrome.com/devtools\n.. _SO answer: https://stackoverflow.com/a/44773079\n.. _Obtain cookies: https://github.com/hoschiCZ/instastories-backup#obtain-cookies\n.. _instastories-backup: https://github.com/hoschiCZ/instastories-backup\n.. _EditThisCookie: https://www.google.com/search?q=EditThisCookie\n.. _cookie-txt-export: https://github.com/siongui/cookie-txt-export.go\n.. _UNLICENSE: http://unlicense.org/\n.. _replay.py: https://github.com/ping/instagram_private_api_extensions/blob/master/instagram_private_api_extensions/replay.py\n.. _instagram_private_api_extensions: https://github.com/ping/instagram_private_api_extensions\n.. _NewInstagramApiManager: https://godoc.org/github.com/siongui/instago#NewInstagramApiManager\n.. _issue #2: https://github.com/siongui/instago/issues/2\n.. _igdlcrx: https://github.com/siongui/igdlcrx\n.. _Downloader for Instagram™ + Direct Message: https://chrome.google.com/webstore/detail/downloader-for-instagram/olkpikmlhoaojbbmmpejnimiglejmboe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiongui%2Finstago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiongui%2Finstago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiongui%2Finstago/lists"}