Skip to content

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

Notifications You must be signed in to change notification settings

badubizzle/insta_data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages