A Ruby wrapper for the Instagram Basic Display API
gem install instagram_basic_display_api
Read the documentation.
# Initialize the client with your access token
client = InstagramBasicDisplayAPI.client(access_token: access_token)
# Fetch the user account
user = client.user
puts "#{user.username}"
# Get your recent media items
for media_item in client.user_recent_media
puts "#{media_item.thumbnail_url}"
end
# Find extended information about a specific media item
media_item = client.media_item(media_id)
puts "#{media_item.media_url}"
# Fetch the children of a carousel media item
for media_item in client.media_children(media_id)
puts "#{media_item.media_type}"
end