Categorygithub.com/f4bio/goinsta
modulepackage
0.0.0-20181027032150-28e23d749004
Repository: https://github.com/f4bio/goinsta.git
Documentation: pkg.go.dev

# README

GoInsta. Make Goinsta Great Again!

Unofficial Instagram API for Golang

Build Status GoDoc Go Report Card Coverage Status

Versioning

Goinsta used gopkg.in as versioning control. Stable new API is the version v2.0. You can get it using:

go get -u -v gopkg.in/ahmdrz/goinsta.v2

Features

  • HTTP2 by default. Goinsta uses HTTP2 client enhancing performance.
  • Object independency. Can handle multiple instagram accounts.
  • Like Instagram mobile application. Goinsta is very similar to Instagram official application.
  • Simple. Goinsta is made by lazy programmers!
  • Backup methods. You can use Export and Import functions.
  • Security. Your password is only required to login. After login your password is deleted.
  • No External Dependencies. Goinsta will not use any Go packages outside of the standard library.

New Version !

We are working on a new object-oriented API. Try it and tell us your suggestions. See https://github.com/ahmdrz/goinsta/blob/master/CONTRIBUTING.md

If you want to use the old version you can found it in v1 branch or using gopkg.in/ahmdrz/goinsta.v1/

Sorry for breaking dependences :(. You can use this command in your project folder to update old master branch to v1.

for i in `grep -r ahmdrz ./ | awk '{split($0, a, ":"); print a[1]}'`; do sed -i 's/github\.com\/ahmdrz\/goinsta/gopkg\.in\/ahmdrz\/goinsta\.v1/g' $i; done

Package installation

go get -u -v gopkg.in/ahmdrz/goinsta.v2

CLI installation

go get -u -v gopkg.in/ahmdrz/goinsta.v2
go install gopkg.in/ahmdrz/goinsta.v2/goinsta

Example

package main

import (
	"fmt"

	"gopkg.in/ahmdrz/goinsta.v2"
)

func main() {
  //insta, err := goinsta.Import("~/.goinsta")
  insta := goinsta.New("USERNAME", "PASSWORD")

  // also you can use New function from gopkg.in/ahmdrz/goinsta.v2/utils

  // insta.SetProxy("http://localhost:8080", true) // true for insecure connections
  if err := insta.Login(); err != nil {
    fmt.Println(err)
    return
  }
  // export your configuration
  // after exporting you can use Import function instead of New function.
  insta.Export("~/.goinsta")

  ...
}

Projects using Goinsta

Legal

This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by Instagram or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.

Donate

Ahmdrz

btc Bitcoin: 1KjcfrBPJtM4MfBSGTqpC6RcoEW1KBh15X

Mester

btc Bitcoin: 37aogDJYBFkdSJTWG7TgcpgNweGHPCy1Ks

Analytics

Schema

The objects of the following schema can point to other objects defined below.

Instagram

  • Account: Personal information and account interactions.
    • Followers
    • Following
    • Feed
      • FeedMedia
        • Item(s)
    • Stories
      • StoryFeed
        • Item(s)
    • Liked
      • FeedMedia
        • Item(s)
    • Saved
      • SavedMedia
        • Item(s)
    • Tags
      • FeedMedia
        • Item(s)
    • Blocked
      • BlockedUser(s)
  • Profiles: User interaction.
    • Blocked
      • BlockedUser(s)
    • Get user using ID
      • User
    • Get user using Username
      • User
  • Media:
    • Items
    • Comments # Comments and Comment are different.
      • User
      • Comment(s) # Slice of Comment
    • Likes
    • Likers
  • Item
    • Items # If it is a carousel.
  • Search:
    • Location
    • Username
    • Tags
    • Location Deprecated
    • Facebook
  • Activity:
    • Following
    • Recent
  • Hashtag: Hashtag allows user to search using hashtags.
    • Stories
      • StoryMedia
    • Media # By default hashtag contains Medias in the structure

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

Export exports selected *Instagram object options to an io.Writer.
GetBest returns best quality image or video.
Import imports instagram configuration This function does not set proxy automatically.
ImportReader imports instagram configuration from io.Reader This function does not set proxy automatically.
New creates Instagram structure.

# Variables

ErrNoMore is an error that comes when there is no more elements available on the list.

# Structs

Account is personal account object See examples: examples/account/*.
Activity is the activity of your instagram account You can get Recent and Following activities.
BlockedUser stores information about a used that has been blocked before.
Broadcast is live videos.
Candidate is something that I really have no idea what it is.
Caption is media caption.
Comment is a type of Media retrieved by the Comments methods.
Comments allows user to interact with media (item) comments.
ConfigFile is a structure to store the session information so that can be exported or imported.
Conversation is the representation of an instagram already established conversation through direct messages.
Error400 is error returned by HTTP 400 status code.
Error503 is instagram API error.
ErrorN is general instagram error.
Feed is the object for all feed endpoints.
FeedLocation is the struct that fits the structure returned by instagram on LocationID search.
FeedMedia represent a set of media items.
FeedTag is the struct that fits the structure returned by instagram on TagSearch.
FollowingActivity is the latest activity of the people you are following.
Friendship stores the details of the relationship between two users.
Hashtag is used for getting the media that matches a hashtag on instagram.
Images are different quality images.
Inbox is the direct message inbox.
InboxItem is any conversation message.
InboxItemLike is the heart sent during a conversation.
InboxItemMedia is inbox media item.
Instagram represent the main API handler Profiles: Represents instragram's user profile.
Item represents media items All Item has Images or Videos objects which contains the url(s).
LiveItems are Live media items.
Location stores media location information.
Mentions is a user being mentioned on media.
MineActivity is the recent activity menu.
Nametag is part of the account information.
PicURLInfo repre.
Profiles allows user function interactions.
SavedMedia stores the information about media being saved before in my account.
School is void structure (yet).
Search is the object for all searches like Facebook, Location or Tag search.
SearchResult handles the data for the results given by each type of Search.
StoryMedia is the struct that handles the information from the methods to get info about Stories.
SuggestedUsers stores the information about user suggestions.
Tag is the information of an user being tagged on any media.
Timeline is the object to represent the main feed on instagram, the first page that shows the latest feeds of my following contacts.
Tray is a set of story media received from timeline calls.
User is the representation of instagram's user profile.
Users is a struct that stores many user's returned by many different methods.
Video are different quality videos.

# Interfaces

Media interface defines methods for both StoryMedia and FeedMedia.