Instagram internal web api implementation
Summary
| Latest Version | 0.8.3 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:26 |
Tags
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 |
|---|---|---|---|---|---|---|---|---|---|---|
| ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
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
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 pageig.post("postId")(/api/v1/media/{postId}/comments): All data used to render the postig.followers("userId")(/api/v1/friendships/{userId}/followers): User followersig.following("userId")(/api/v1/friendships/{userId}/following): User followingig.feed("userId")(/api/v1/feed/user/{userId}): Feed data, posts
POST
ig.follow("userId")(/api/v1/friendships/create/{userId}): Follows the userig.unfollow("userId")(/api/v1/friendships/destroy/{userId}): Unfollows the userig.like("userId")(/api/v1/web/likes/{postId}/like): Likes the postig.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
-
[ ]
followandunfollowneeds 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!