instagram

Instagram internal web api implementation

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.8.3
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Authors

  • Thiago Navarro

Installation

nimble install instagram
choosenim install instagram
git clone https://github.com/thisago/instagram

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
instagram - - - - - - -

Dependencies

Package Version Optional
nim >= 1.6.4 No
util - No
jsony - No

Source

Repository https://github.com/thisago/instagram
Homepage https://github.com/thisago/instagram
Registry Source nimble_official

README

# Instagram #### Instagram internal web api implementation **[About](#about) - [Features](#features)** - [License](#license) > **Warning** > The maintenance of this project is currently suspended. And since it's a internal API implementation, things break easier.

About

This library is a implementation of internal Instagram web API.

With this library, you can get data and even interact with Instagram!

Features

  • ig.sharedData: Logged account data

The following internal endpoints are implemented:

GET

  • ig.user("username") (/api/v1/users/web_profile_info): Gets all info used to render the user page
  • ig.post("postId") (/api/v1/media/{postId}/comments): All data used to render the post
  • ig.followers("userId") (/api/v1/friendships/{userId}/followers): User followers
  • ig.following("userId") (/api/v1/friendships/{userId}/following): User following
  • ig.feed("userId") (/api/v1/feed/user/{userId}): Feed data, posts

POST

  • ig.follow("userId") (/api/v1/friendships/create/{userId}): Follows the user
  • ig.unfollow("userId") (/api/v1/friendships/destroy/{userId}): Unfollows the user
  • ig.like("userId") (/api/v1/web/likes/{postId}/like): Likes the post
  • ig.unlike("userId") (/api/v1/web/likes/{postId}/unlike): Remove the like of post

* Ig is a Instagram object

Usage

Warning This implementation may violate the Instagram's terms of use, to prevent bans, call the API with random delays to looks like a human.

The full documentation is hosted at Github Pages

Let's start with the usage guide

Getting data

To use the lib, you'll need a Instagram object instance, it stores your authentication cookies, the CSRF cookie and extra IDs

To create one:

import std/asyncdispatch

let ig = waitFor newInstagram() # No cookies, there's rate limit and limited just to GET functions
# or
let loggedIg = waitFor newInstagram "YOUR COOKIES" # With login

To get cookies, consider using iecook because it gets the HttpOnly cookies, the needed ones. automatically.

[...]

TODO

  • [ ] follow and unfollow needs to return the response object

  • [ ] POST

  • [ ] Create posts
  • [ ] Create status posts
  • [ ] Comment in a post
  • [ ] GET
  • [ ] Get post comments
  • [ ] Get your following state of a user

Resources

  • https://instagram.api-docs.io

Related

  • https://github.com/pavlovdog/Instagram-private-API/blob/master/api.py
  • https://github.com/dilame/instagram-private-api
  • https://github.com/ping/instagram_private_api

License

This library is licensed over MIT license!