Skip to content

Simple PHP Private API that allows you to use both mobile and web APIs of Instagram

License

Notifications You must be signed in to change notification settings

suphiyasin/instagram-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License Hits


Logo

Suphiyasin / Instagram-API

With this PHP library, you can use all features of the instagram Mobile App
Feedback

Donation

Coin Network Wallet
USDT TRC-20 TRsWGn75MPwMgKaEuETPqB4P67e6w9L9JT

Packet Features

Feature Instagram Mobil API
Use Proxy ✔️
Login ✔️
Two Factor Login ✔️
(Email - DUO Tested)
Suspicious Login Code ✔️
(If you bypass the suspicious login but add double factor to the account, account owner verification will be required.The suspicious login code and the account ownership code are not the same.)
Add Duo ✔️
Change Password ✔️
Change Email ✔️
Duo Remove ✔️
Get My Inbox ✔️
Send Message ✔️
Get User Info ✔️
Info my account ✔️
Phone Remove ✔️
Email Remove ✔️
Change Birthday ✔️
Add Phone ✔️
(SMS Verification Needed)
See Duo Backup Codes ✔️
Upload new profile photo ✔️
Like a post ✔️
Unlike a post ✔️
Save a post ✔️
Follow ✔️
Unfollow ✔️
Get Follows ✔️
(Searchable)
Get Followers ✔️
(Searchable)
Create Note ✔️
Delete Note ✔️
Get Comments ✔️
Create Comment ✔️
Delete Comment ✔️
Logout ✔️
Delete Media ✔️
Get Hashtag ✔️
Get Recommended Users ✔️
Search ✔️
Get users feed ✔️
Get users story ✔️
Like a post ✔️
Get Likers ✔️
Get code from duo seed function 🔒
(telegram: @suphi007)
Feature Instagram Web API
Use Proxy ✔️
Login ✔️
Login with 2 factor ✔️
Get User info from username ✔️
Get Recommended Users ✔️

Contents

  1. About Project
  2. Get Started
  3. Usage
  4. Road Map
  5. Contributors
  6. License
  7. Contant Us

About Project

This project is made in PHP library of all instagram mobile app features. This library can send exactly same queries like mobile app and returns server responses.

Updates

Getting Started

Please read carefully.

Requirements

File permissions

Give permission to the following files and folders with chmod 777.

/vendor/suphiyasin/

Setup via Composer

  • you must determine your root(working) folder after that open console ( terminal )
    composer require suphigram/instagram

Installing via download Repository

  1. Firsty download repository
    git clone https://github.com/suphiyasin/Instagram.git
  2. Use the command below to download the required libraries.
    composer install

Examples

Login

You must login before each operation. In your first login operation, the system will be cached and your operation will run faster.

<?php

require __DIR__ . '/vendor/autoload.php';

use SuphiGram\Instagram\Instagram;

$api = new Instagram();

$username = 'username';
$password = 'password';

$login = json_decode($api->login->loginv2($username, $password), true);
if ($login["Status"] == "ok") {
    echo 'Login success';
} else {
    echo 'Login Fail';
}

// LOGIN CONTROL
$login_control = $api->login->MyCache("token"); // Fix the variable name to use $api instead of $instagram
if (strlen($login_control) > 0) {
    echo 'Token exists'; // Correct the typo in the echo statement
} else {
    echo 'Token does not exist'; // Correct the typo in the echo statement
}

Two factor authorization

In your first login attemp, if two factor authorization are enabled, instagram will send you a code. If you enter the code into the input area, yout login operation will be completed automatically. After your next logins, if yout IP is not changed, you can login without asking code.

<?php

    require __DIR__ . '/vendor/autoload.php';
    
   use SuphiGram\Instagram\Instagram;
    
    $api = new Instagram();
    $username = 'username';
    $password = 'password';
if(isset($_GET['factorcode'])){
$twoid = $_GET['twoid'];
	//1= Sms Verifivation || 2 = backup codes || 3 = Duo app code || 4= I guess its whatsapp 
	$step3 = json_decode($api->login->twofactorv2($username, $twofid, $_GET["factorcode"], "3"), true);
if($step3["status"] == "ok"){
echo "login success";
}else{
echo "login fail";
}
}else{
$step1 = json_decode($api->login->loginv2($username, $password), true);
if($step1["Status"] == "ok"){
echo "already logged";
}else if($step1["Status"] == "fail" and isset($step1["TwoFactorId"])){
	$twofid = $step1["TwoFactorId"];
	echo '<form action="" method="GET"><input type="hidden" value="'.$step1["TwoFactorId"].'" name="twoid"/><input type="number" name="factorcode" palceholder="Enter the 6 digit code" /> <input type="submit"/></form>';
	
}else{
//somthing went wrong
	var_dump($step1);
}
}

    

Change everything in the account

When you run the code, it does the username, password, email, removing double factor on the account, and then adding double factor.

//add duo factor
$removeduo = $api->user->disableFactorV2();
$step1 = json_decode($api->user->add2factorv2(null), true);
var_dump($step1);
if($step1["Status"] == "ok"){
	$step2 = $api->manuel->get2FACode($step1["Seed"]);
	echo $api->user->enable2Factor($step2);
}else{
	echo "Seed Genaration Failed";
}

//remove old email and add new email
$step1 = json_decode($api->user->InfoMyAccount(), true);
$step2 = $api->user->deleteMyEmail(null, $step1["Email"]);
$step3 = $api->user->addNewEmail(null, "[email protected]");
$step4 = $api->user->ConfirmOPTEmail(null, "[email protected]", "123456");

//change password
$step1 = $api->user->ChangePassword("OLD-PASSWORD", "NEW-PASSSWORD", $username);

//change username
$step1 = $api->user->changeUsername(null, "NewUsername");

License

You can download and use it as long as this project is under development. If used for other purposes The person who wrote the codes is not responsible. By downloading and using this project, you agree to this.

Contact

Suphi
Website : https://suphi.org
Email: [email protected]
Telegram: @suphi007