Golang Instagram API , Unofficial Instagram API for Golang
Unofficial Instagram API written in Golang
@mgp25 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.
Very simple and no-dependency Instagram API
This library work like android version of instagram
go get -u -v github.com/ahmdrz/goinsta
There is lot of methods , like uploadPhoto , follow , unfollow , comment , like and etc...
This repository is a copy of Instagram-API-Python , And original source is Instagram-API
The example is very simple !
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)
}
}
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)
}
Yes, you may create goinsta object using:
insta := goinsta.NewViaProxy("USERNAME", "PASSWORD", "http://<ip>:<port>")