Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

instagram-user-feed

> 开发工具
Open source

This is a scrapper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.

946 stars0 likes2 views
WebsiteGitHub

About

This is a scrapper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.

Instagram user feed PHP

Warning 2023-12-31 - Version 7.0.0 will drop support for PHP Warning 2022-11-09 - Instagram changed his DOM AGAIN... Please update to this version 6.16.4

Warning 2022-06-01 - Instagram changed his DOM content and profile data loading. Please update to this version 6.15.0

Information

Easily fetch any Instagram feed and more without OAuth for PHP.

If you like or use this package, please share your love by starring this repository, follow @pgrimaud or become a sponsor.

Features

  • Fetch profile data of user
  • Fetch medias of user
  • Fetch stories of user
  • Fetch highlights stories of user
  • Fetch detailed post of user
  • Fetch feed of followers
  • Fetch feed of followings
  • Follow or unfollow users
  • Like or unlike posts
  • Fetch posts of hashtag
  • Fetch comments of a post
  • Fetch live-streaming info
  • Fetch Reels
  • Fetch IGTV
  • Fetch medias where a user has been tagged on
  • Fetch HD profile picture
  • Post a message to a media
  • **NEW: Login with cookies **
  • **NEW: Fetch connected user timeline **

This version can retrieve ANY Instagram feed using web scraping.

  • Installation
  • Usage
  • Medias paginate
  • Stories
  • Examples

⚠️ Version ^5.0 is no more maintained. ⚠️

Installation

composer require pgrimaud/instagram-user-feed

Changelog

v7.0.0 - 2023-12-31:

  • Drop support for PHP getMedias()will always return an empty array after calling$api->getProfile(). It is necessary to call $api->getMoreMedias($profile)` to return the first 12 media (cookieguru)
  • Same for IGTV (cookieguru)
  • Fix imap_delete second parameter (deepvision7)

v6.16 - 2022-08-02:

  • Login with cookies. Thanks to nsmle (example here) .
  • Fetch connected user timeline. Thanks to nsmle (example here) .
  • Add full support for Symfony 6
  • Add checks on missing properties to avoid errors

v6.15 - 2022-06-02:

  • ⚠️ ⚠️ Fix profile endpoint. Please update to this last version!

v6.12 - 2021-09-20:

  • Add method to post message on a media (example here) .
  • Add method to get HD profile picture (example here) .

v6.11 - 2021-09-13:

  • Add method to fetch medias where a user has been tagged on (example here) .

v6.10 - 2021-09-03:

  • Add method to fetch IGTV (example here) .
  • Add method to fetch Reels (example here) .
  • Split dirty tests in multiple files.

v6.9 - 2021-09-02:

  • Add method to fetch Instagram live-streaming info. Thanks to David-Kurniawan
  • Minor fixes.

v6.8 - 2021-07-08:

  • Add video url in media feed. Thanks to @Nispeon
  • Add helper to download media (ref to #205 : strict-origin-when-cross-origin). Thanks to @Nispeon
  • Minor changes and improvements.

v6.7 - 2021-01-31:

  • New feature: get post of hashtag.
  • New feature: get comments of post.
  • Add support for PHP 8.
  • Minor changes and improvements.

v6.6 - 2020-10-06:

  • New feature: like and unlike posts.
  • Retrieval #hashtags and @mentions from stories.
  • Minor changes and improvements.

v6.5 - 2020-09-14:

  • New feature: follow and unfollow users. Thanks to @David-Kurniawan)
  • Minor fixes.

v6.4 - 2020-08-30:

  • New feature: fetch followers and followings feeds. Thanks to @David-Kurniawan)
  • Minor improvements.

v6.3 -2020-07-03:

  • Add checkpoint challenge bypass using IMAP configuration.

v6.2 - 2020-06-01:

  • Improve medias crawling && cache constraints.

v6.1 - 2020-05-21:

  • New feature: Fetch stories and highlights stories.

v6.0 - 2020-05-20

  • Please upgrade from ^5.0 for cookies session stability.

Version ^6.8: strict-origin-when-cross-origin

Facebook added a new CORS policy, and you can't display the data directly.

You can now download media on your storage or server to serve it directly on your website. You can find an example here.

Example:

php
login('username', 'password'); // mandatory
$profile = $api->getProfile('robertdowneyjr');

echo $profile->getUserName(); // robertdowneyjr

echo $profile->getFullName(); // Robert Downey Jr. Official

Basic usage :

php
login('username', 'password');

$profile = $api->getProfile('robertdowneyjr');

print_r($profile);
…

Paginate

If you want to use paginate on medias, just call getMoreMedias method.

php
login($credentials->getLogin(), $credentials->getPassword());

$profile = $api->getProfile('twhiddleston');

print_r($profile->getMedias()); // 12 first medias

do {
    $profile = $api->getMoreMedias($profile);
    print_r($profile->getMedias()); // 12 more medias

    // avoid 429 Rate limit from Instagram
    sleep(1);
} while ($profile->hasMoreMedias());

Stories

php
login('username', 'password'); // mandatory

$profile = $api->getProfile('starwars'); // we need instagram username
sleep(1);
$feedStories = $api->getStories($profile->getId());

$stories = $feedStories->getStories();

print_r($stories);

Contributors

Thanks goes to these wonderful people (emoji key):

Pierre Grimaud

Jan Östlund

Tim Bond

Dlinny

René

ikiselev1989

Pezhvak

David Greminger

Nana YAMANE

David Kurniawan

gtapps

Chun-Sheng, Li ⚠️

schelmo

Mojtaba

Georgy Gusev

Jibran Ijaz

Julien Cousin-Alliot

n-richaud

Dmitry Afonin

Andrei Firoiu

Fiki Pratama

Carl

Peter Kampjes

Bob Brown

nagajoomlapro

cleveng

BMRG14

Sinan Portakal

deepvision7

Yusuf Özdemir

Kadir Melih Can

This project follows the all-contributors specification. Contributions of any kind welcome!

Feedback

You found a bug? You need a new feature? You can create an issue if needed or contact me on Twitter.

License

Licensed under the terms of the MIT License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPcheckpoint-challenge-bypassigtvinstagraminstagram-api

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具