Skip to content
/ igramapi Public
forked from nsmle/igramavel

An unofficial Instagram RESTful API. easy to fetch any feed and interact with Instagram (like, follow, etc.) with JWT implementation.

License

Notifications You must be signed in to change notification settings

1on7/igramapi

 
 

Repository files navigation

Igramapi

Igramapi

JWT Compatible Instagram Laravel React TailwindCSS

An unofficial Instagram RESTful API. easy to fetch any feed and interact with Instagram (like, follow, etc.) with JWT implementation.

Information

If you login with your instagram credentials on /api/auth/login and get Checkpoint required, please provide IMAP credentials to process authentication error like problem #1 over and over again. Consider using an alternative login with the Instagram sessionid cookie which you can get in this tutorial or this one.

Support ❤️

If you like and find this app useful, please give your support by starring in this repository, or make a donation via Saweria or :

Github-sponsors PayPal

Special Thanks 🙏

A big thank you to Pierre Grimaud for creating a very useful instagram-user-feed library.

Help contribute to solving problems in instagram-user-feed or sponsors to Pierre Grimaud to keep this beloved library alive and well 🙏.

What's next ?

Please take a look at the Igramapi Roadmap to see what features will be implemented next or what fixes are coming.

Installation

git clone https://github.com/nsmle/igramapi.git

Usage

  • Open your terminal and go to your working directory.
  • Clone this repository
    git clone https://github.com/nsmle/igramapi.git
  • Go to folder
    cd igramapi
  • Install dependencies
    composer install
  • Create environment variable
    cp .env.example .env
  • Generate app key inside .env file
    php artisan key:generate
  • Generate JWT_SECRET key in .env file
    php artisan jwt:generate-key
  • Start local server
    php artisan serve
  • Open link http://localhost:8000/api to get all endpoints list on your browser

Endpoints

Method Endpoint Auth
GET /api No
POST /api/auth/login No
POST /api/auth/login/alternative No
GET /api/profile Yes
GET /api/profile/{userId} Yes
GET /api/reels/{userId} Yes

Note Replace <BASEURL> in example with your app base url.

You can also replace it with https://igramapi.herokuapp.com/ as an illustration when in production.

Get all list of api endpoints.

  • ENDPOINT
    /api
    
  • METHOD
    GET
    
  • EXAMPLE
    curl -X GET "<BASEURL>/api"

Login with instagram credentials.

  • ENDPOINT
    /api/auth/login
    
  • METHOD
    POST
    
  • BODY
    {
        "username" : "YOUR_INSTAGRAM_USERNAME",
        "password" : "YOUR_INSTAGRAM_PASSWORD"
    }
  • EXAMPLE
    curl -X POST "<BASEURL>/api/auth/login" -H "Content-Type: application/json" -d '{"username": "YOUR_INSTAGRAM_USERNAME", "password": "YOUR_INSTAGRAM_PASSWORD"}'

Login with instagram cookie sessionid.

  • ENDPOINT
    /api/auth/login/alternative
    
  • METHOD
    POST
    
  • BODY
    • Required
      {
          "value"   : "YOUR_INSTAGRAM_SESSIONID_VALUE",
          "expires" : "YOUR_INSTAGRAM_SESSIONID_EXPIRES"
      }
    • Optional
      {
          "name"    : "sessionid",
          "domain"  : "YOUR_INSTAGRAM_SESSIONID_DOMAIN|.instagram.com",
          "path"    : "YOUR_INSTAGRAM_SESSIONID_PATH|/",
      }
  • EXAMPLE
    curl -X POST "<BASEURL>/api/auth/login/alternative" -H "Content-Type: application/json" -d '{"name": "sessionid", "value": "YOUR_INSTAGRAM_SESSIONID_VALUE", "domain": ".instagram.com", "path": "/", "expires": "YOUR_INSTAGRAM_SESSIONID_EXPIRES"}'

Get logged in user profile.

  • ENDPOINT
    /api/profile
    
  • METHOD
    GET
    
  • EXAMPLE
    curl -X GET "<BASEURL>/api/profile" -H "Authorization: Bearer {token}" -H "Content-Type: application/json"

Get profile by user id or username.

  • ENDPOINT
    /api/profile/{userId|username}
    
  • METHOD
    GET
    
  • EXAMPLE
    curl -X GET "<BASEURL>/api/profile/{userId|username}" -H "Authorization: Bearer {token}" -H "Content-Type: application/json"

Get reels of user.

  • ENDPOINT
    • get reels
      /api/reels/{userId|username}
      
    • get next reels
      /api/reels/{userId|username}?cursor={maxId}
      
  • METHOD
    GET
    
  • EXAMPLE
    curl -X GET "<BASEURL>/api/reels/{userId|username}" -H "Authorization: Bearer {token}" -H "Content-Type: application/json"

Feedback

I currently made this project for personal purposes. I decided to share it here to help anyone with the same needs. If you have any feedback to improve it, You found a bug, You need a new feature/endpoint. You can create an issue if needed and feel free to make a suggestion, or open a PR!

License

Licensed under the terms of the MIT License. Following the instagram-user-feed License. Use it wisely and don't abuse it!

About

An unofficial Instagram RESTful API. easy to fetch any feed and interact with Instagram (like, follow, etc.) with JWT implementation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 85.5%
  • Blade 13.3%
  • Other 1.2%