Это проблема аутентификации, аккаунт необходимо подтвердить, но вы не можете указать код подтверждения в SMS или электронной почте,
запросить код подтверждения в SMS или по электронной почте
<?php
set_time_limit(0);
date_default_timezone_set('UTC');
require __DIR__.'/../vendor/autoload.php';
use InstagramAPI\Exception\ChallengeRequiredException;
use InstagramAPI\Instagram;
use InstagramAPI\Response\LoginResponse;
//Enter these options
$username = 'username'; // your username
$password = 'password'; //your password
$verification_method = 1; //0 = SMS, 1 = Email
//Leave these
$user_id = '';
$challenge_id = '';
class ExtendedInstagram extends Instagram {
public function changeUser( $username, $password ) {
$this->_setUser( $username, $password );
}
}
$instagram = new ExtendedInstagram();
$loginResponse = $instagram->login( $username, $password );
$user_id = $instagram->account_id;
if ( $loginResponse !== null && $loginResponse->isTwoFactorRequired() ) {
echo '2FA not supported in this example';
exit;
}
if ( $loginResponse instanceof LoginResponse || $loginResponse === null ) {
echo "Not a challenge required exception...\n";
}
echo 'Logged in!';
?>
Частная библиотека API Instagram