Davincible / goinsta

Unofficial Instagram API written in Golang (v2022)
MIT License
183 stars 56 forks source link

goinsta logo

GoDoc Go Report Card

Go Instagram Private API

Unofficial Instagram API for Golang

This repository has been forked from ahmdrz/goinsta. As the maintainer of this repositry has archived the project, and the code in the repository was based on a few 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 v250.0.0.21.109 (Aug 30, 2022). Walkthrough docs can be found in the wiki.

If you are missing anything or something is not working as expected please let me know through the issues or discussions.

Features

Package installation

go get -u github.com/Davincible/goinsta/v3@latest

Example

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
  if err := insta.Login(); 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.

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.