serhiylev / instago

Download/access photos, videos, stories, story highlights, postlives, following and followers of Instagram

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Instagram Photo, Video, Story, Highlight, Postlive, Following, and Follower in Go

https://api.travis-ci.org/siongui/instago.svg?branch=master https://goreportcard.com/badge/github.com/siongui/instago

https://img.shields.io/twitter/url/https/github.com/siongui/instago.svg?style=social

Get Instagram media (photos and videos), stories, story highlights, postlives, following and followers in Go.

This package only access Instagram private and public API:

Obtain Cookies

Use Chrome extension in this repo to get the cookies. Load the extension using Chrome extension developer mode. Log in to Instagram using Chrome. Click on the loaded extension button and save the content as auth.json. We will use it later to access Instagram API.

Terminology

Given the URL of the post as follows:

https://www.instagram.com/p/BfJzG64BZVY/

The code of the post is BfJzG64BZVY.

Usage

This package instago only access the Instagram public and private API and get metadata from the API.

Install the package by go get:

$ go get -u github.com/siongui/instago

You can use the following methods without cookies

For the other methods which need cookies to access Instagram API, you must call NewInstagramApiManager first:

import (
      "github.com/siongui/instago"
)

mgr := instago.NewInstagramApiManager("auth.json")

Then you can use mgr to get metadata from Instagram API. For example, you can get all post codes of the user instagram as follows:

codes, err := mgr.GetAllPostCode("instagram")
if err != nil {
      panic(err)
}

for _, code := range codes {
      println("URL: https://www.instagram.com/p/%s/\n", code)
}

For complete examples, see test files (files ends with _test.go). The following are some examples you may be interested in:

Tricks

Private API

UNLICENSE

Released in public domain. See UNLICENSE.

References

[1]GitHub - siongui/goiguserid: Get id of Instagram user in Go
[2]GitHub - siongui/goigstorylink: Get Links (URL) of Instagram Stories in Go
[3]GitHub - siongui/goigfollow: Get Instagram following and followers in Go
[4]GitHub - siongui/goigstorydl: Download Instagram Stories in Go
[5]GitHub - siongui/goigmedia: Get links of Instagram user media (photos and videos) in Go.
[6]JSON Formatter & Validator

About

Download/access photos, videos, stories, story highlights, postlives, following and followers of Instagram

License:The Unlicense


Languages

Language:Go 95.9%Language:Makefile 3.9%Language:JavaScript 0.2%Language:HTML 0.0%