This repository has been forked from ahmdrz/goinsta. As the maintainer of this repositry has been absend the last few months, and the code in the repository was based on a 2 year old instagram app version, since which a lot has changed, I have taken the courtesy to build upon his great framework and update the code to be compatible with apk v195.0.0.31.123 (July 6, 2021). After migrating the endpoints and adding new ones, there are are few breaking changes. You can check the full walkthrough documentation in the wiki, and looking at the code to further understand how it works is encouraged.
Unofficial Instagram API for Golang
- 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.goinsta now uses chromedp as headless browser driver to solve challanges and checkpoints.
go get -u github.com/Davincible/goinsta/v3@latest
package main
import (
"fmt"
"github.com/Davincible/goinsta/v3"
)
func main() {
insta := goinsta.New("USERNAME", "PASSWORD")
// Only call Login the first time you login. Next time import your config
err := insta.Login()
if err != nil {
panic(err)
}
// Export your configuration
// after exporting you can use Import function instead of New function.
// insta, err := goinsta.Import("~/.goinsta")
// it's useful when you want use goinsta repeatedly.
// Export is deffered because every run insta should be exported at the end of the run
// as the header cookies change constantly.
defer insta.Export("~/.goinsta")
...
}
For the full documentation, check the wiki, or run go doc -all
.
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.
Goinsta used gopkg.in as versioning control. Stable new API is the version v3.0. You can get it using:
$ go get -u -v github.com/Davincible/goinsta/v3
Or
If you have GO111MODULE=on
$ go get -u github.com/Davincible/goinsta/v3