Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vorkytaka/instagram-go-scraper
Instagram Scraper for Go
https://github.com/vorkytaka/instagram-go-scraper
golang instagram instagram-scraper
Last synced: about 2 months ago
JSON representation
Instagram Scraper for Go
- Host: GitHub
- URL: https://github.com/vorkytaka/instagram-go-scraper
- Owner: Vorkytaka
- License: apache-2.0
- Created: 2017-04-02T19:21:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-01T20:56:16.000Z (over 7 years ago)
- Last Synced: 2024-06-21T02:04:37.665Z (6 months ago)
- Topics: golang, instagram, instagram-scraper
- Language: Go
- Size: 86.9 KB
- Stars: 41
- Watchers: 8
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Instagram Go Scraper
[![GoDoc](https://godoc.org/github.com/Vorkytaka/instagram-go-scraper/instagram?status.svg)](https://godoc.org/github.com/Vorkytaka/instagram-go-scraper/instagram)
[![Build Status](https://travis-ci.org/Vorkytaka/instagram-go-scraper.svg?branch=master)](https://travis-ci.org/Vorkytaka/instagram-go-scraper)Instagram Scraper for Golang.
A package that helps you with requesting to Instagram without a key.
### Installation:
Install:
```
$ go get -u github.com/Vorkytaka/instagram-go-scraper/instagram
```
Import:
```go
import "github.com/Vorkytaka/instagram-go-scraper/instagram"
```### List of functions:
After import you can use following functions:
```go
// Get account info
account, err := instagram.GetAccountByUsername("username")// Get media info
media, err := instagram.GetMediaByCode("code")
media, err := instagram.GetMediaByURL("https://instagram.com/p/code")// Get slice of account media
media, err := instagram.GetAccountMedia("username", limit)
// or slice of all account media
media, err := instagram.GetAllAccountMedia("username")// Get slice of location last media
media, err := instagram.GetLocationMedia("location_id", limit)
// Get array[9] of location top media
media, err := instagram.GetLocationTopMedia("location_id")// Get location info
location, err := instagram.GetLocationByID("location_id")// Get slice of tag last media
media, err := instagram.GetTagMedia("tag", limit)
// Get array[9] of tag top media
media, err := instagram.GetLocationTopMedia("tag")// Search for users (return slice of Accounts)
users, err := instagram.SearchForUsers("username")
```You'll get `err != nil` if request return 404 or if there a parsing error.
### About media updates:
Media can have one of 3 types:
* `TypeImage`
* `TypeVideo`
* `TypeCarousel`From v0.2.03 media has MediaList field for collection of media.
If media is carousel, then there will be a list of all media.
If media is image or video, then there will be only one media, but also,
for backward compatibility, media url will be in `media.MediaURL` field.### Update data:
You can update media by call `Update` method:
```go
media, err := instagram.GetMediaByCode("code")
err := media.Update()
if err != nil {
// media didn't update
}
```
Same with account:
```go
account, err := instagram.GetAccountByUsername("username")
err := account.Update()
if err != nil {}
```