goinsta
Golang Instagram API , Unofficial Instagram API for Golang
Unofficial Instagram API written in Golang
This library work like android version of instagram
Installation
go get -u -v github.com/ahmdrz/goinsta
Methods
- Login
- Logout
- UserFollowings
- UserFollowers
- UserFeed
- MediaLikers
- Follow
- UnFollow
- Block
- UnBlock
- Like
- UnLike
- GetProfileData
- SetPublicAccount
- SetPrivateAccount
- RemoveProfilePicture
- Comment
- DeleteComment
- EditMedia
- DeleteMedia
- MediaInfo
- Expose
- UploadPhoto
- UploadVideo
- RemoveSelfTag
- GetUsernameInfo
- GetRecentActivity
- GetFollowingRecentActivity
- TagFeed
- SearchUsername
- GetRecentRecipients
- ChangePassword
- SelfUserFollowers
- SelfUserFollowing
- SelfTotalUserFollowers
- SelfTotalUserFollowing
This repository is a copy of Instagram-API-Python , And original source is Instagram-API
How to use ?
The example is very simple !
GetUserFeed
package main
import (
"fmt"
"github.com/ahmdrz/goinsta"
)
func main() {
insta := goinsta.New("USERNAME", "PASSWORD")
if err := insta.Login(); err != nil {
panic(err)
}
defer insta.Logout()
resp, err := insta.UserFeed()
if err != nil {
panic(err)
}
if resp.Status != "ok" {
panic("Error occured , " + resp.Status)
}
for _, item := range resp.Items {
if len(item.Caption.Text) > 30 {
item.Caption.Text = item.Caption.Text[:30]
}
fmt.Println(item.ID, item.Caption.Text)
}
}
UploadPhoto
package main
import (
"fmt"
"github.com/ahmdrz/goinsta"
)
func main() {
insta := goinsta.New("USERNAME", "PASSWORD")
if err := insta.Login(); err != nil {
panic(err)
}
defer insta.Logout()
resp, _ := insta.UploadPhoto("PATH_TO_IMAGE", "CAPTION", insta.NewUploadID(), 87,goinsta.Filter_Lark) // default quality is 87
fmt.Println(resp.Status)
}
For more , see example folder