{"id":15554156,"url":"https://github.com/agilie/instagram_api_gem","last_synced_at":"2025-04-09T18:17:37.542Z","repository":{"id":56877743,"uuid":"93792138","full_name":"agilie/instagram_api_gem","owner":"agilie","description":"A Ruby wrapper for the Instagram API","archived":false,"fork":false,"pushed_at":"2018-01-25T05:27:09.000Z","size":36,"stargazers_count":105,"open_issues_count":5,"forks_count":11,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-09T18:17:32.735Z","etag":null,"topics":["api-client","api-wrapper","gem","instagram","instagram-api","instagram-client","rails","ruby"],"latest_commit_sha":null,"homepage":"https://agilie.com","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/agilie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-08T21:09:53.000Z","updated_at":"2024-06-24T14:38:58.000Z","dependencies_parsed_at":"2022-08-20T11:40:37.962Z","dependency_job_id":null,"html_url":"https://github.com/agilie/instagram_api_gem","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/agilie%2Finstagram_api_gem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2Finstagram_api_gem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2Finstagram_api_gem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2Finstagram_api_gem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agilie","download_url":"https://codeload.github.com/agilie/instagram_api_gem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085321,"owners_count":21045139,"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-client","api-wrapper","gem","instagram","instagram-api","instagram-client","rails","ruby"],"created_at":"2024-10-02T14:50:22.885Z","updated_at":"2025-04-09T18:17:37.515Z","avatar_url":"https://github.com/agilie.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"600\" src=\"https://agilie.com/instagram_api_gem_logo.png\" alt=\"Logo\"\u003e\n  \u003cimg width=\"100\" src=\"https://agilie.com/logos.png\" alt=\"Logos\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\n\u003ca href=\"https://www.agilie.com?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=Git_Ruby\u0026utm_term=instagram_api_gem\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Made%20by%20Agilie-*****-green.svg?style=flat\" alt=\"Made by Agilie\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://github.com/agilie/instagram_api_gem\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/mashape/apistatus.svg\" alt=\"License\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://rubygems.org/gems/instagram_api_client\"\u003e\n  \u003cimg src=\"http://ruby-gem-downloads-badge.herokuapp.com/instagram_api_client?type=total\u0026color=brightgreen\" alt=\"Downloads\"\u003e\n\u003c/a\u003e\n\n\u003c/p\u003e\n\n# InstagramApi\n\n\u003cp align=\"center\"\u003e \n    \u003cimg width=\"300\" src=\"https://agilie.com/instagram_api_gem.png\" alt=\"Example\"\u003e\n\u003c/p\u003e\nA Ruby wrapper for the Instagram API. You can see the api endpoints here https://www.instagram.com/developer/endpoints/\n\n## Installation\n\nInstall gem in your ruby project\n```ruby\ngem install instagram_api_client\n```  \n\nor just add to it your `Gemfile`\n```\ngem 'instagram_api_client'\n```\nif you are on the Rails and run `bundle`\n\n## Usage\n\nBefore you start making the requests to instagram API provide the `access_token` using the configuration\nwrapping. If you are going to use **Subscriptions** you should add client_id and client_secret.\n\n```ruby\nInstagramApi.config do |config|\n  config.access_token = 'put your token here'\n  config.client_id = 'put your client ID here'\n  config.client_secret = 'put your client secret here'\nend\n```\n\nAs for now Instagram access token doesn't change or expire, so you can use this simple-to-use service\nto generate it http://services.chrisriversdesign.com/instagram-token/\nI the nearest future the OAuth authorization for access token fetching will be implemented.\n\n## Resources\n\nThe main module of the gem is `InstagramApi`. It provides a series of methods, regarding each Instagram resource. They are: \n`Users`, `Media`, `Comments`, `Likes`, `Tags` and `Locations`. So the `Users` resource methods can be accessed by `InstagramApi.user`\nmethod, `Tags` by `InstagramApi.tag` and so on.\n\nThe main methods of each resource are `show`, `index`, `create`, `destroy` and `search`. The methods and API endpoints \ncorrespondence is as follows \n\n |  Gem Action  |  API Endpoint  | \n | -------- | ----- | \n |  **User Resource** |  | \n |  InstagramApi.user.show | GET /users/self | \n |  InstagramApi.user(**user_id**).show | GET /users/**user_id** | \n |  InstagramApi.user.recent_media | GET /users/self/media/recent | \n |  InstagramApi.user(**user_id**).recent_media | GET /users/**user_id**/media/recent | \n |  InstagramApi.user.liked_media | GET /users/self/media/liked | \n |  InstagramApi.user.search(**search_query**) | GET /users/search | \n |  *Relationship Endpoints block* |  | \n |  InstagramApi.user.follows | GET /users/self/follows | \n |  InstagramApi.user.followed_by | GET /users/self/followed-by | \n |  InstagramApi.user.requested_by | GET /users/self/requested-by | \n |  InstagramApi.user.check_relationship(**user_id**) | GET /users/**user_id**/relathionship | \n |  InstagramApi.user.change_relationship(**user_id**) | POST /users/**user_id**/relathionship | \n |  **Media Resource** |  | \n |  InstagramApi.media(**media_id**).show | GET /media/**media_id** | \n |  InstagramApi.media.short_code(**short_code**) | GET /media/shortcode/**shortcode** | \n |  InstagramApi.media.search(**search_query**) | GET /media/search | \n |  *Likes Endpoints block* |  | \n |  InstagramApi.media(media_id).likes | GET /media/**media_id**/likes | \n |  InstagramApi.media(media_id).add_like | POST /media/**media_id**/likes | \n |  InstagramApi.media(media_id).delete_like | DELETE /media/**media_id**/likes | \n |  *Comment Endpoints block* |  | \n |  InstagramApi.media(media_id).comments | GET /media/**media_id**/comments | \n |  InstagramApi.media(media_id).add_comment | POST /media/**media_id**/comments | \n |  InstagramApi.media(media_id).delete_comment(**comment_id**) | DELETE /media/**media_id**/comments/**comment_id** | \n |  **Tag Resource** |  | \n |  InstagramApi.tag(**tag_name**).show | GET /tags/**tag_name** | \n |  InstagramApi.tag(**tag_name**).recent_media | GET /tags/**tag_name**/media/recent | \n |  InstagramApi.tag.search(**search_query**) | GET /tags/search | \n |  **Location Resource** |  | \n |  InstagramApi.location(**location_id**).show | GET /locations/**location_id** | \n |  InstagramApi.location(**location_id**).recent_media | GET /locations/**location_id**/media/recent | \n |  InstagramApi.location.search(**search_query**) | GET /locations/search | \n\nEach method from the list above accepts a hash as a second argument with additional params according to official \n[instagram developers documentation](https://www.instagram.com/developer/endpoints/) i.e.\n\n```ruby\nInstagramApi.user.search('mell', {count: 10})\nInstagramApi.user('my_user_id').recent_media({min_id: '22721881'})\n```\n\nSearch method can get either a query string or a hash. It depends on API requirements, i.e.\n```ruby\nInstagramApi.user.search('mell')\nInstagramApi.location.search({lat: 33.10, lng: 15.40})\n```\n\nResponse is a `Hashie::Mash` object\n\n## Subscriptions\n\nSubscriptions is a useful feature which allows to receive notifications when people who authenticated your app\npost new media on Instagram. You can find more information on https://www.instagram.com/developer/subscriptions/\n\n#### Creating a subscription\n\nCreating subscription is very simple. Just refer to the [original documentation](https://www.instagram.com/developer/subscriptions/) to\ncheck the options available\n```ruby\nInstagramApi.subscription.create({\n    object: 'user',\n    aspect: 'media',\n    callback_url: 'http://your.callback/url'\n})\n```\nThis method automatically generates `verify_token`. However, you can pass your own, if you prefer\n```ruby\nInstagramApi.subscription.create({\n    object: 'user',\n    aspect: 'media',\n    callback_url: 'http://your.callback/url',\n    verify_token: 'MyCustomVerifyToken'\n})\n```\n#### Validating subscription\n\nWhen you add a subscription, Instagram will send a GET request to your callback URL to verify the existence of the URL.\nWhen Instagram has new data, it'll POST this data to your callback URL. To validate the subscription your callback action\nshould validate verify_token from instagram request and response with a `hub.challenge` parameter value.\n\nYou can easily implement it with a single line\n\n```ruby\n# CallbackController\n\n# GET callback url action\ndef index\n    render plain: InstagramApi.subscription.validate(params)\nend\n```\nor\n```ruby\n# CallbackController\n\n# GET callback url action\ndef index\n    render plain: InstagramApi.subscription.validate(params, 'MyCustomVerifyToken')\nend\n```\nif you are using your own `verify_token`\n\n#### Managing subscriptions\n\nYou can easily get the list of your subscriptions\n```ruby\nInstagramApi.subscription.index\n```\n\nor destroy them if you prefer\n\n```ruby\nInstagramApi.subscription.destroy({object: 'all'})\nInstagramApi.subscription.destroy({id: 1})\n```\n\n\n## TODOS\n\n1. OAuth authorization for access token fetching\n2. Incode Documentation\n3. Cover functionality with tests\n\n## Troubleshooting\n\nProblems? Check the [Issues](https://github.com/agilie/instagram_api_gem/issues) block to find \nthe solution or create an new issue that we will fix asap. Feel free to contribute.\nThis project is intended to be a safe, welcoming space for collaboration.\n\n## Author\nThis gem is open-sourced by [Agilie Team](https://www.agilie.com?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=Git_Ruby\u0026utm_term=instagram_api_gem) ([info@agilie.com](mailto:info@agilie.com))\n\n## Contributor\n[Sergey Mell](https://github.com/SergeyMell)\n\n## Contact us\nIf you have any questions, suggestions or just need a help with web or mobile development, \nplease email us at \u003cweb@agilie.com\u003e. You can ask us anything from basic to complex questions.\n\nWe will continue publishing new open-source projects. Stay with us, more updates will follow!\n\n## License\n\nThe gem is available as open source under the [MIT](LICENSE.md) License (MIT) Copyright © 2017 [Agilie Team](https://www.agilie.com?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=Git_Ruby\u0026utm_term=instagram_api_gem)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilie%2Finstagram_api_gem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagilie%2Finstagram_api_gem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilie%2Finstagram_api_gem/lists"}