An unofficial Instagram RESTful API. easy to fetch any feed and interact with Instagram (like, follow, etc.) with JWT implementation.
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.
If you like and find this app useful, please give your support by starring in this repository, or make a donation via Saweria or :
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 🙏.
Please take a look at the Igramapi Roadmap to see what features will be implemented next or what fixes are coming.
git clone https://github.com/nsmle/igramapi.git
- 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
filephp artisan key:generate
- Generate
JWT_SECRET
key in.env
filephp artisan jwt:generate-key
- Start local server
php artisan serve
- Open link
http://localhost:8000/api
to get all endpoints list on your browser
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.
- ENDPOINT
/api
- METHOD
GET
- EXAMPLE
curl -X GET "<BASEURL>/api"
- 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"}'
- 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|/", }
- Required
- 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"}'
- ENDPOINT
/api/profile
- METHOD
GET
- EXAMPLE
curl -X GET "<BASEURL>/api/profile" -H "Authorization: Bearer {token}" -H "Content-Type: application/json"
- 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"
- ENDPOINT
- get reels
/api/reels/{userId|username}
- get next reels
/api/reels/{userId|username}?cursor={maxId}
- get reels
- METHOD
GET
- EXAMPLE
curl -X GET "<BASEURL>/api/reels/{userId|username}" -H "Authorization: Bearer {token}" -H "Content-Type: application/json"
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!
Licensed under the terms of the MIT License. Following the instagram-user-feed License. Use it wisely and don't abuse it!