{"id":13509490,"url":"https://github.com/zensavona/elixtagram","last_synced_at":"2025-10-21T17:48:27.882Z","repository":{"id":57494680,"uuid":"43373845","full_name":"Zensavona/elixtagram","owner":"Zensavona","description":":camera: Instagram API client for the Elixir language (elixir-lang)","archived":false,"fork":false,"pushed_at":"2020-01-14T08:31:46.000Z","size":379,"stargazers_count":86,"open_issues_count":0,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-21T13:46:31.384Z","etag":null,"topics":["api","elixir","instagram","instagram-client","oauth"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/elixtagram","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zensavona.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2015-09-29T14:46:36.000Z","updated_at":"2025-01-11T13:23:16.000Z","dependencies_parsed_at":"2022-08-28T19:40:49.732Z","dependency_job_id":null,"html_url":"https://github.com/Zensavona/elixtagram","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zensavona%2Felixtagram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zensavona%2Felixtagram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zensavona%2Felixtagram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zensavona%2Felixtagram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zensavona","download_url":"https://codeload.github.com/Zensavona/elixtagram/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246324059,"owners_count":20759072,"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","elixir","instagram","instagram-client","oauth"],"created_at":"2024-08-01T02:01:08.523Z","updated_at":"2025-10-21T17:48:22.843Z","avatar_url":"https://github.com/Zensavona.png","language":"Elixir","funding_links":[],"categories":["Third Party APIs"],"sub_categories":[],"readme":"# Elixtagram\n\n### Elixtagram is a simple Instagram client for Elixir.\n\n[![Build Status](https://travis-ci.org/Zensavona/elixtagram.svg?branch=master)](https://travis-ci.org/Zensavona/elixtagram) [![Inline docs](http://inch-ci.org/github/zensavona/elixtagram.svg)](http://inch-ci.org/github/zensavona/elixtagram) [![Coverage Status](https://coveralls.io/repos/Zensavona/elixtagram/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/Zensavona/elixtagram?branch=master) [![Deps Status](https://beta.hexfaktor.org/badge/all/github/Zensavona/elixtagram.svg)](https://beta.hexfaktor.org/github/Zensavona/elixtagram) [![hex.pm version](https://img.shields.io/hexpm/v/elixtagram.svg)](https://hex.pm/packages/elixtagram) [![hex.pm downloads](https://img.shields.io/hexpm/dt/elixtagram.svg)](https://hex.pm/packages/elixtagram) [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n\n### [Read the docs](https://hexdocs.pm/elixtagram)\n\nI've created an example application with Phoenix [here](https://github.com/Zensavona/instagram-phoenix-example)\n\n## Usage\n\n### Installation\n\nAdd the following to your `mix.exs`\n\n````\n...\n\ndef application do\n  [mod: {InstagramPhoenixExample, []},\n   applications: [:elixtagram]]\nend\n\n...\n\ndefp deps do\n  [{:elixtagram, \"~\u003e 0.6.0\"}]\n\n...\n\n````\n\n### Configuration\n\nElixtagram will first look for application variables, then environment variables. This is useful if you want to set application variables locally and environment variables in production (e.g. on Heroku). That being said, I recommend using [Dotenv](https://github.com/avdi/dotenv_elixir) locally.\n\n`config/dev.exs`\n````\nconfig :elixtagram,\n  instagram_client_id: \"YOUR-CLIENT-ID\",\n  instagram_client_secret: \"YOUR-CLIENT-SECRET\",\n  instagram_redirect_uri: \"YOUR-REDIRECT-URI\"\n````\n\n`.env`\n````\nINSTAGRAM_CLIENT_ID=YOUR-CLIENT-ID\nINSTAGRAM_CLIENT_SECRET=YOUR-CLIENT-SECRET\nINSTAGRAM_REDIRECT_URI=YOUR-REDIRECT-URI\n````\n\nYou can also configure these programatically at runtime if you wish:\n````\niex(1)\u003e Elixtagram.configure(\"YOUR-CLIENT-ID\", \"YOUR-CLIENT-SECRET\", \"YOUR-REDIRECT-URI\")\n{:ok, []}\n````\n\n### Usage\n\n*Before using Elixtagram, it needs to be initialised. Run `Elixtagram.configure/0` or `Elixtagram.configure/1` before any other commands*\n\n#### Authenticate a user\n\n````\n# Generate a URL to send them to\niex(1)\u003e Elixtagram.authorize_url!\n\"https://api.instagram.com/oauth/authorize/?client_id=XXX\u0026redirect_uri=localhost%3A4000\u0026response_type=code\"\n\n# Instagram will redirect them back to your INSTAGRAM_REDIRECT_URI, so once they're there, you need to catch the url param 'code', and exchange it for an access token.\n\niex(2)\u003e code = \"XXXXXXXXXX\"\n\"XXXXXXXXXX\"\niex(3)\u003e {:ok, access_token} = Elixtagram.get_token!(code: code)\n{:ok, \"XXXXXXXXXXXXXXXXXXXX\"}\n\n# Now we can optionally set this as the global token, and make requests with it by passing :global instead of a token.\niex(4)\u003e Elixtagram.configure(:global, access_token)\n:ok\n````\n\n#### Unauthenticated endpoints\n\nThere are a lot of endpoints you can use without an access token from a user. Most methods can be called in one of three ways, for example:\n````\n# Unauthenticated\niex(1)\u003e Elixtagram.tag(\"lifeisaboutdrugs\")\n%Elixtagram.Model.Tag{media_count: 27, name: \"lifeisaboutdrugs\"}\n\n# Explicitly authenticated\niex(1)\u003e Elixtagram.tag(\"lifeisaboutdrugs\", \"XXXXXXXXXXXXXXXXX\")\n%Elixtagram.Model.Tag{media_count: 27, name: \"lifeisaboutdrugs\"}\n\n# Implicitly authenticated (only works if you have configured a global token)\niex(1)\u003e Elixtagram.tag(\"lifeisaboutdrugs\", :global)\n%Elixtagram.Model.Tag{media_count: 27, name: \"lifeisaboutdrugs\"}\n````\n\n#### Authenticated endpoints\n\nAuthenticated endpoints are mostly things which are about getting the current user's stuff\n````\niex(1)\u003e Elixtagram.user_feed(%{count: 2}, \"XXXXXXXXXXXXXXXXX\")\n[%Elixtagram.Model.Media{...}, %Elixtagram.Model.Media{...}]\n\niex(2)\u003e Elixtagram.user_feed(%{count: 2}, :global)\n[%Elixtagram.Model.Media{...}, %Elixtagram.Model.Media{...}]\n````\n\nAll of the available methods and the ways to call them are [in the docs](https://hexdocs.pm/elixtagram/Elixtagram.html)\n\n## Running the tests\n\nTL;DR: `mix test`\n\nLonger answer:\n```\n$ mix deps.get\nRunning dependency resolution\nAll dependencies up to date\n\n$ mix test\n...........................................................................................\n\nFinished in 17.6 seconds (2.9s on load, 14.7s on tests)\n91 tests, 0 failures\n\nRandomized with seed 846369\n\n$ mix coveralls\n...........................................................................................\n\nFinished in 13.1 seconds (1.9s on load, 11.2s on tests)\n91 tests, 0 failures\n\nRandomized with seed 972312\n----------------\nCOV    FILE                                        LINES RELEVANT   MISSED\n100.0% lib/elixtagram.ex                             806       49        0\n100.0% lib/elixtagram/api/base.ex                     84       24        0\n100.0% lib/elixtagram/api/comments.ex                 30        3        0\n100.0% lib/elixtagram/api/follows.ex                  37        5        0\n100.0% lib/elixtagram/api/likes.ex                    30        3        0\n100.0% lib/elixtagram/api/locations.ex                56       12        0\n100.0% lib/elixtagram/api/media.ex                    37        6        0\n100.0% lib/elixtagram/api/tags.ex                     33        5        0\n100.0% lib/elixtagram/api/users.ex                    59       14        0\n100.0% lib/elixtagram/config.ex                       42       10        0\n  0.0% lib/elixtagram/exception.ex                     3        0        0\n  0.0% lib/elixtagram/model.ex                        38        0        0\n100.0% lib/elixtagram/oauth_strategy.ex               50       13        0\n100.0% lib/elixtagram/parser.ex                       48       10        0\n[TOTAL] 100.0%\n----------------\n```\n\n## Status\n\nIt's mostly complete, but these things are missing:\n\n* Pagination of results for certain data types\n* Real time subscriptions\n* Secure requests\n\n\n## Changelog\n\n### 0.6.0\n- Merge PR which updates the new API url for `Elixtagram.user_feed/2` (PR #17, thanks @sudostack!)\n- Merge PR which adds support for the new `carousel_media` type (PR #19, thanks @mendab1e!)\n\n### 0.5.1\n- Merge PR which better handles cases where API request limiting kicks in (PR #18, thanks @mendab1e!)\n\n### 0.5.0\n- Merge PR #16 which implements a paginated version of `Elixtagram.tag_recent_media`: `Elixtagram.tag_recent_media_with_pagination` (thanks @mendab1e!)\n\n### 0.4.0\n- Merge PR #15 from @mendab1e which adds the `videos` field to `Media` (Thanks!)\n- Update the `oauth2` library to version `0.9.1` which closes Issue #14 from @radzserg (Thanks, sorry it took me so long to get to this!)\n- Update `httpoison` to `0.11.1`\n- Update `poison` to `3.1.0`\n\n### 0.3.0\n- Change the `Elixtagram.get_token!` function to return a tuple like `{:ok, token}`\n- Update dependencies\n- Merge a [pull request](https://github.com/Zensavona/elixtagram/pull/13) which fixes an issue relating to a newer version of OAuth2 (thanks [@radzserg](https://github.com/radzserg))\n\n### 0.2.9\n- Add `user_recent_media_with_pagination` (thanks again [@deadkarma](https://github.com/deadkarma)!)\n\n### 0.2.8\n- Support [Elixir 1.3.x](https://github.com/Zensavona/elixtagram/pull/9) (thanks [@deadkarma](https://github.com/deadkarma)!)\n\n### 0.2.7\n- Add the `type` attribute to Media in order to tell the difference between 'image' and 'video' types (thanks [@deadkarma](https://github.com/deadkarma)!)\n\n### 0.2.6\n- Add the new `created_time` and `users_in_photo` to `Media` (thanks [@deadkarma](https://github.com/deadkarma)!)\n- Add new required OAuth permissions request (thanks [@bobishh](https://github.com/bobishh)!)\n\n### 0.2.5\n- Add [credo](https://github.com/rrrene/credo) in `dev` environment\n- Improve code readability and resolve credo warnings (thanks [@rrrene](https://github.com/rrrene)!)\n\n### 0.2.4\n- Update the OAuth2 library to `0.5` (thanks [@steffenix!](https://github.com/steffenix)!)\n- add a couple more test cases around pagination to get back to 100% coverage\n\n### 0.2.3\n- Minor pagination bugfix - was throwing a `KeyError` when requesting a paginated `user_follows` and on the last page of results.\n\n### 0.2.2\n- Add pagination support for `user_follows`, this doesn't break the existing `user_follows/2` and `user_follows/3` API.\n\n### 0.2.1\n\n- Add `Elixtagram.authorize_url!/3`, which takes a `state` argument to pass back to the callback url. This is useful for things like CSRF protection ([read more here](https://instagram.com/developer/authentication/)). This change doesn't break or change the existing API.\n\n### 0.2.0\n\n- Change the api of `Elixtagram.user_follows/1` \u0026 `Elixtagram.user_follows/2` (now respectively `Elixtagram.user_follows/2` \u0026 `Elixtagram.user_follows/3`) to accept a `count` argument.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzensavona%2Felixtagram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzensavona%2Felixtagram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzensavona%2Felixtagram/lists"}