go-instagram

Pure-Go best-effort read client for public Instagram content.

CGO_ENABLED=0 zero third-party deps standard library only best-effort ยท fragile BSD-3-Clause
Documentation GitHub

A pure-Go, dependency-free, best-effort read client for public Instagram content served through Instagram's web JSON endpoints. The Go API is kept deliberately small and stable so your code can survive the churn underneath โ€” the underlying transport may break at any time regardless.

โš ๏ธ Best-effort โ€” expect breakage

Instagram does not offer these endpoints as a stable, documented public API. They are the internal endpoints its own website calls, and they change, rate-limit, and lock without notice.

Unauthenticated requests are frequently rejected โ€” you will often need a valid logged-in `sessionid` cookie for reads to succeed. Any request can start returning 401 / 403 / 429 at any time when Instagram decides to block you.

Usage

Pure Go, standard library only. go get github.com/go-instagram/instagram

// A sessionid cookie is usually required for reads to succeed.
c := instagram.New(instagram.WithSessionID("your-sessionid-cookie"))

prof, err := c.UserProfile(context.Background(), "instagram")
if err != nil {
	panic(err) // 401/403/429 here means Instagram is blocking the request.
}
fmt.Printf("%s (%s) โ€” %d followers\n", prof.FullName, prof.Username, prof.Followers)
for _, p := range prof.Posts {
	fmt.Printf("- %s  %d likes  %s\n", p.Permalink, p.Likes, p.Caption)
}

Repositories

Everything that actually exists in the org today.

instagram client

Pure-Go best-effort read client for public Instagram content.

CI Go Reference

brand brand

Logos, icons and social images for go-instagram.