No description
Find a file
2024-02-02 15:33:39 -03:00
.github/workflows back github actions bot name 2023-09-07 20:17:52 +00:00
reqs Fixed feed JSON parsing crash 2023-09-10 18:34:51 +00:00
src Fixed test 2023-09-26 18:23:59 +00:00
tests Fixed test 2023-09-26 18:23:59 +00:00
.gitignore Version 0.2.0 2023-09-03 17:41:17 +00:00
changelog.md Fixed feed JSON parsing crash 2023-09-10 18:34:51 +00:00
config.nims init; added user endpoint 2023-09-01 16:00:08 +00:00
instagram.nimble Fixed test 2023-09-26 18:23:59 +00:00
license init; added user endpoint 2023-09-01 16:00:08 +00:00
readme.md Fixed readme warning 2024-02-02 15:33:39 -03:00

Instagram

Instagram internal web api implementation

About - Features - 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

License

This library is licensed over MIT license!