Instagram's private API for PHP
This is a PHP library which emulates Instagram's Private API. This library is packed full with almost all the features from the Instagram Android App. This includes media uploads, direct messaging, stories and more.
Read the wiki and previous issues before opening a new one! Maybe your issue has already been answered.
Frequently Asked Questions: F.A.Q.
Do you like this project? Support it by donating
- Paypal: Donate
- Bitcoin: 1DCEpC9wYXeUGXS58qSsqKzyy7HLTTXNYe
- Paypal: Donate
- Bitcoin: 18XF1EmrkpYi4fqkR2XcHkcJxuTMYG4bcv
- Paypal: Donate
- Bitcoin: 32J2AqJBDY1VLq6wfZcLrTYS8fCcHHVDKD
Install/enable the required php extensions and dependencies. You can learn how to do so here.
Install this library
We use composer to distribute our code effectively and easily. If you do not already have composer installed, you can download and install it here here.
Once you have composer installed, you can do the following:
composer require aki/instagram-php
require __DIR__.'/../vendor/autoload.php'; $ig = new \InstagramAPI\Instagram();
If you want to test new and possibly unstable code that is in the master branch, and which hasn't yet been released, then you can do the following (at your own risk):
composer require aki/instagram-php dev-master
Warning about moving data to a different server
Composer checks your system's capabilities and selects libraries based on your current machine (where you are running the
composer command). So if you run Composer on machine
A to install this library, it will check machine
A's capabilities and will install libraries appropriate for that machine (such as installing the PHP 7+ versions of various libraries). If you then move your whole installation to machine
B instead, it will not work unless machine
B has the exact same capabilities (same or higher PHP version and PHP extensions)! Therefore, you should always run the Composer-command on your intended target machine instead of your local machine.
All examples can be found here.
Code of Conduct
This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report any unacceptable behavior.
How do I contribute
If you would like to contribute to this project, please feel free to submit a pull request.
Before you do, take a look at the contributing guide.
Why did I make this API?
After legal measures, Facebook, WhatsApp and Instagram blocked my accounts. In order to use Instagram on my phone I needed a new phone, as they banned my UDID, so that is basically why I made this API.
What is Instagram?
According to the company:
"Instagram is a fun and quirky way to share your life with friends through a series of pictures. Snap a photo with your mobile phone, then choose a filter to transform the image into a memory to keep around forever. We're building Instagram to allow you to experience moments in your friends' lives through pictures as they happen. We imagine a world more connected through photos."
In order help ensure fairness and sharing, this library is dual-licensed. Be aware that all usage, unless otherwise specified, is under the RPL-1.5 license!
- Reciprocal Public License 1.5 (RPL-1.5): https://opensource.org/licenses/RPL-1.5
You should read the entire license; especially the
PREAMBLE at the
beginning. In short, the word
reciprocal means "giving something back in
return for what you are getting". It is not a freeware license. This
license requires that you open-source all of your own source code for any
project which uses this library! Creating and maintaining this library is
endless hard work for us. That's why there is one simple requirement for you:
Give something back to the world. Whether that's code or financial support
for this project is entirely up to you, but nothing else grants you any
right to use this library.
Furthermore, the library is also available to certain entities under a modified version of the RPL-1.5, which has been modified to allow you to use the library without open-sourcing your own project. The modified license (see LICENSE_PREMIUM) is granted to certain entities, at our discretion, and for a limited period of time (unless otherwise agreed), pursuant to our terms. Currently, we are granting this license to all "premium subscribers" for the duration of their subscriptions. You can become a premium subscriber by either contributing substantial amounts of high-quality code, or by subscribing for a fee. This licensing ensures fairness and stimulates the continued growth of this library through both code contributions and the financial support it needs.
You are not required to accept this License since you have not signed it, however nothing else grants you permission to use, copy, distribute, modify, or create derivatives of either the Software (this library) or any Extensions created by a Contributor. These actions are prohibited by law if you do not accept this License. Therefore, by performing any of these actions You indicate Your acceptance of this License and Your agreement to be bound by all its terms and conditions. IF YOU DO NOT AGREE WITH ALL THE TERMS AND CONDITIONS OF THIS LICENSE DO NOT USE, MODIFY, CREATE DERIVATIVES, OR DISTRIBUTE THE SOFTWARE. IF IT IS IMPOSSIBLE FOR YOU TO COMPLY WITH ALL THE TERMS AND CONDITIONS OF THIS LICENSE THEN YOU CAN NOT USE, MODIFY, CREATE DERIVATIVES, OR DISTRIBUTE THE SOFTWARE.
Terms and conditions
- You will NOT use this API for marketing purposes (spam, botting, harassment, massive bulk messaging...).
- We do NOT give support to anyone who wants to use this API to send spam or commit other crimes.
- We reserve the right to block any user of this repository that does not meet these conditions.
This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by Instagram or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.