{"id":21539842,"url":"https://github.com/richardvenneman/instagrammer","last_synced_at":"2025-07-20T16:04:38.906Z","repository":{"id":48926948,"uuid":"192800039","full_name":"richardvenneman/instagrammer","owner":"richardvenneman","description":"📷 Instagrammer lets you fetch Instagram user info and posts","archived":false,"fork":false,"pushed_at":"2021-07-05T10:20:04.000Z","size":51,"stargazers_count":6,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-14T00:06:39.590Z","etag":null,"topics":["instagram","instagram-api","instagram-client","instagram-scraper","ruby","scraper"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/richardvenneman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-19T20:28:30.000Z","updated_at":"2025-03-06T04:54:50.000Z","dependencies_parsed_at":"2022-09-24T00:12:08.474Z","dependency_job_id":null,"html_url":"https://github.com/richardvenneman/instagrammer","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/richardvenneman/instagrammer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardvenneman%2Finstagrammer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardvenneman%2Finstagrammer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardvenneman%2Finstagrammer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardvenneman%2Finstagrammer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richardvenneman","download_url":"https://codeload.github.com/richardvenneman/instagrammer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardvenneman%2Finstagrammer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266152291,"owners_count":23884481,"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":["instagram","instagram-api","instagram-client","instagram-scraper","ruby","scraper"],"created_at":"2024-11-24T04:16:32.787Z","updated_at":"2025-07-20T16:04:38.882Z","avatar_url":"https://github.com/richardvenneman.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instagrammer\n\nInstagrammer lets you fetch Instagram user info and posts. This is done by crawling the Instagram web interface, powered by [Capybara](https://github.com/teamcapybara/capybara/) and a headless Chrome Selenium driver. Automated integration tests are run daily to keep up with possible changes. Read more about the [motivation to build this gem](#motivation).\n\n[![Build Status](https://travis-ci.org/richardvenneman/instagrammer.svg?branch=master)](https://travis-ci.org/richardvenneman/instagrammer)\n[![Gem Version](https://badge.fury.io/rb/instagrammer.svg)](https://badge.fury.io/rb/instagrammer)\n[![Maintainability](https://api.codeclimate.com/v1/badges/d7627a894c354a73dee8/maintainability)](https://codeclimate.com/github/richardvenneman/instagrammer/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/d7627a894c354a73dee8/test_coverage)](https://codeclimate.com/github/richardvenneman/instagrammer/test_coverage)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'instagrammer'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install instagrammer\n\nIf you're running on Heroku, make sure to use the [heroku-buildpack-google-chrome](https://github.com/heroku/heroku-buildpack-google-chrome) buildpack.\n\n## Usage\n\n### User\n\nCreate a new user with `Instagrammer::User.new(\"username\")` or simply `Instagrammer.new(\"username\")`.\n\nAccessing certain properties on an account that is private will result in a `PrivateAccount` exception. In some cases Instagram doesn't expose any meta data through. In these cases a `UserInvalid` exception will be raised when accessing certain properties.\n\nTherefor you can check if the account is scrapable with the `#public?` instance method.\n\n#### Metadata\n\nThe meta counts data is available for both public as well as private accounts:\n\n```ruby\nuser = Instagrammer.new(\"richardvenneman\")\nuser.follower_count # =\u003e \"204\"\nuser.following_count # =\u003e \"141\"\nuser.post_count # =\u003e \"91\"\n```\n\n#### Bio\n\nBio info is currently available for public accounts only:\n\n```ruby\nuser = Instagrammer.new(\"richardvenneman\")\nuser.name # =\u003e \"Richard Venneman\"\nuser.username # =\u003e \"@richardvenneman\"\nuser.avatar # =\u003e \"https://www.instagram.com/static/images/ico/favicon-200.png/ab6eff...\"\nuser.bio # =\u003e \"👨🏻‍💻 Partner at GoNomadic B.V.\\nTraveling and building 🏙 @cityspotters\"\nuser.url # =\u003e \"https://www.cityspotters.com/\"\n```\n\n#### Posts\n\nGet the posts for a specific user by using the `#get_posts(_limit_)` user method.\n\n```ruby\nuser = Instagrammer.new(\"richardvenneman\")\nuser.get_posts(3) # =\u003e [#\u003cInstagrammer::Post:70223732051200..\u003e, #\u003cInstagrammer::Post:70223732051200..\u003e, #\u003cInstagrammer::Post:70223732051200..\u003e]\n```\n\nSee below for the available post methods\n\n### Post\n\nCreate a new post with `Instagrammer::Post.new(\"shortcode\")`.\n\n```ruby\npost = Instagrammer::Post.new(\"Bg3VjfwDRDw\")\npost.photo? # =\u003e true\npost.caption # =\u003e \"🌋 Mount Agung as seen from 🌋 Mount Batur just after sunrise 🌅\"\npost.upload_date # =\u003e #\u003cDateTime: 2018-03-28T11:07:26+00:00 ((2458206j,40046s,0n),+0s,2299161j)\npost.comment_count # =\u003e 3\npost.like_count # =\u003e 52\npost.image_url # =\u003e \"https://instagram.foem1-1.fna.fbcdn.net/vp/04bffab7e91872110690173cbac1ba28/5D9FDCD0/t51.2885-15/e35/29416707_933709783459981_1377808440356765696_n.jpg?_nc_ht=instagram.foem1-1.fna.fbcdn.net\"\npost.image_urls # =\u003e [{:url=\u003e\"https://instagram.foem1-1.fna.fbcdn.net/vp/b962b338f5024309e3242ec3e4158681/5DA27835/t51.2885-15/sh0.08/e35/s640x640/29416707_933709783459981_1377808440356765696_n.jpg?_nc_ht=instagram.foem1-1.fna.fbcdn.net\", :width=\u003e640}, {:url=\u003e\",https://instagram.foem1-1.fna.fbcdn.net/vp/fb1477d8dc17c9d1a6b36c8107b4a5b2/5DC4FA35/t51.2885-15/sh0.08/e35/s750x750/29416707_933709783459981_1377808440356765696_n.jpg?_nc_ht=instagram.foem1-1.fna.fbcdn.net\", :width=\u003e750}, {:url=\u003e\",https://instagram.foem1-1.fna.fbcdn.net/vp/04bffab7e91872110690173cbac1ba28/5D9FDCD0/t51.2885-15/e35/29416707_933709783459981_1377808440356765696_n.jpg?_nc_ht=instagram.foem1-1.fna.fbcdn.net\", :width=\u003e1080}]\n```\n\nAdditionally video posts are somewhat supported as well. Image URLs and like counts are not available for videos.\n\n```ruby\npost = Instagrammer::Post.new(\"Byx0Nd3A3qr\")\npost.video? # =\u003e true\npost.watch_count # =\u003e 8035142\n```\n\n## Motivation\n\nThe problem with scrapers is that they always brake. Instagram/Facebook seems to put in a lot of effort to battle scrapers. This gem tries to approach that challenge a bit different than other Ruby Instagram scrapers. With decent test coverage the integration should be tested continuously and good code quality should allow for quick and easy updates may any changes in the Instagram web interface happen.\n\nThe main focus is currently retrieving user posts with some metadata while maintaining a stable implementation. Therefor I try to avoid naive page selectors and rely on meta data where possible.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/richardvenneman/instagrammer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardvenneman%2Finstagrammer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichardvenneman%2Finstagrammer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardvenneman%2Finstagrammer/lists"}