Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InstaData

Elixir Library for Accessing Instagram Public Data without API Key

Installation

If available in Hex, the package can be installed by adding insta_data to your list of dependencies in mix.exs:

def deps do
  [
    {:insta_data, "~> 0.1.0"}
  ]
end

Usage

alias InstaData.Instagram

Get user Instagram profile with username

sync:

Instagram.User.get("instagram")

async:

Instagram.User.get("instagram", 
fn ({_username, %Instagram.User{}=user}) -> 
  IO.puts("Found user #{inspect(user)}")
  {_, :error} -> 
  IO.puts("Error occurred")

end)

Get Single Instagram post With Post ID

For a post with url like this https://www.instagram.com/p/BJYkFQPgwGD sync:

Instagram.Post.get("BJYkFQPgwGD")

async:

Instagram.Post.get("BJYkFQPgwGD", 
fn ({_post_id, %Instagram.Post{}=post}) ->
  IO.puts("Found post: #{inspect(post)}")
  ({_post_id, :error}) ->
  IO.puts("Error occurred")
end)

Get Instagram User's Posts

async:

Instagram.Post.get_user_posts("instagram",[per_page: 10, limit: 100], 
fn ({_username, %{posts: posts, total: total}}) ->
    IO.puts("Found posts: #{inspect(posts)}")
    :continue # return :continue to continue or :stop to stop next batch
   ({_username, :done}) -> 
    IO.puts("Done")
    ({_username, :user_not_fount})->
      IO.put("User not found")

end)

Search for posts with Hashtag

Instagram.Search.hashtag("chalewote", [], 
fn posts ->

end)
Instagram.Search.search_users("badu", 
fn users -> 

end)

About

Elixir library for Instagram Public API (without API Key or Token)

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages