login($credentials->getLogin(), $credentials->getPassword()); // 2657627124756968810 is id of https://www.instagram.com/p/CThycoMlPVq/ $postId = 2657627124756968810; $api->commentPost($postId, 'Awesome!'); } catch (InstagramException $e) { print_r($e->getMessage()); } catch (CacheException $e) { print_r($e->getMessage()); }