PHPackages                             ch0c01dxyz/instatoken - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ch0c01dxyz/instatoken

AbandonedArchivedLibrary

ch0c01dxyz/instatoken
=====================

Just simple Instagram API using Token provided by Application

326PHP

Since Mar 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ch0c01dxyz/instatoken)[ Packagist](https://packagist.org/packages/ch0c01dxyz/instatoken)[ RSS](/packages/ch0c01dxyz-instatoken/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

InstaToken
==========

[](#instatoken)

Just simple Unofficial Instagram API using Token provided by Application

[![PHP from Travis config](https://camo.githubusercontent.com/c12a18a6dded90a4ab2d1dbeec2a78f8ff2bda8126b1d6cce72283fc30e12304/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d762f6368306330316478797a2f696e737461746f6b656e2e737667)](https://github.com/ch0c01dxyz/instatoken)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0a681f4f3fa484a1c8885c06044f1fd7bb342b3b5557da2c2b03d925abd44946/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6368306330316478797a2f696e737461746f6b656e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ch0c01dxyz/instatoken/?branch=master)[![Build status](https://camo.githubusercontent.com/75a3e3f834ed432e16aae939e69a9f52912edffa21fa9ebb5c353684e37a58e8/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f6e64623332716a3561626c66787062393f7376673d74727565)](https://ci.appveyor.com/project/ch0c01dxyz/instatoken)[![Build Status](https://camo.githubusercontent.com/e17c0116ef227400d006bdfb5d01d2992d10bea2051438adccf1415b497d528a/68747470733a2f2f7472617669732d63692e6f72672f6368306330316478797a2f696e737461746f6b656e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ch0c01dxyz/instatoken)[![Repository License](https://camo.githubusercontent.com/af9f68c3c16a433681182e849d739f83ddbb94c96095f6e1d999baaad63509fd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d2d332d2d436c617573652d627269676874677265656e2e737667)](https://github.com/ch0c01dxyz/instatoken)

Features
--------

[](#features)

- Get list Comment
- Send Comment
- Delete Comment
- Get list Like
- Send Like to Media
- Delete Like from Media
- Get Location info
- Get Media based on location
- Search Location from given params
- Get Media info
- Search Media from given location
- Get list Follower
- Get list Following
- Get follow Request ( BETA )
- Get Relationship info
- Change Relationship
- Get Tag information
- Search TagName
- Get User info ( Base Info / Media )
- Search User

Quick Start
-----------

[](#quick-start)

```
$instaToken = new Ch0c01dxyz\InstaToken\Endpoints\User ();

$instaToken->setToken( "USER_APP_TOKEN" );

print_r ( $instaToken->getSelf );
```

Result above code:

```
Array
(
    [data] => Array
        (
            [id] => 4702717189
            [username] => ch0c01d.xyz
            [profile_picture] => https://scontent.cdninstagram.com/vp/b3d98293afb0f953ddeed49f43ef6a3a/5B2BC280/t51.2885-19/s150x150/25007128_351216438678074_8197259836799320064_n.jpg
            [full_name] => ㅤ
            [bio] =>
            [website] => http://malanghost.com/
            [is_business] =>
            [counts] => Array
                (
                    [media] => 28
                    [follows] => 167
                    [followed_by] => 18115
                )
        )
    [meta] => Array
        (
            [code] => 200
        )
)

```

Login Usage
===========

[](#login-usage)

- Get URL Login redirect to Instagram

```
$appLogin = new Ch0c01dxyz\InstaToken\Endpoints\Login ( "applicationId", "applicationSecret", "applicationCallback" );

print_r ( $appLogin->getLogin (); );
```

- Get Instagram Authorization ( Access Token )

```
$appLogin = new Ch0c01dxyz\InstaToken\Endpoints\Login ( "applicationId", "applicationSecret", "applicationCallback" );

// $code = from user authorization from getLogin() above.
print_r ( $appLogin->doAuth ( $code ); );
```

Comment Usage
=============

[](#comment-usage)

- Get list comment on Media

```
$myComment = new Ch0c01dxyz\InstaToken\Endpoints\Comment ();

$myComment->setToken ( "USER_APP_TOKEN" );

$mediaId = new Ch0c01dxyz\InstaToken\Objects\MediaId ( "USER_MEDIA_ID" );

print_r ( $myComment->listComment ( $mediaId ) );
```

- Send comment on Media

```
$myComment = new Ch0c01dxyz\InstaToken\Endpoints\Comment ();

$myComment->setToken ( "USER_APP_TOKEN" );

$mediaId = new Ch0c01dxyz\InstaToken\Objects\MediaId ( "USER_MEDIA_ID" );

print_r ( $myComment->sendComment ( $mediaId, "this is sample comment to the user media." ) );
```

- Delete comment on Media

```
$myComment = new Ch0c01dxyz\InstaToken\Endpoints\Comment ();

$myComment->setToken ( "USER_APP_TOKEN" );

$mediaId = new Ch0c01dxyz\InstaToken\Objects\MediaId ( "USER_MEDIA_ID" );
$commentId = new Ch0c01dxyz\InstaToken\Objects\CommentId ( "USER_COMMENT_ID" );

print_r ( $myComment->listComment ( $mediaId, $commentId ) );
```

Like Usage
==========

[](#like-usage)

- Get list Like on Media

```
$myLike = new Ch0c01dxyz\InstaToken\Endpoints\Like ();

$myLike->setToken ( "USER_APP_TOKEN" );

$mediaId = new Ch0c01dxyz\InstaToken\Objects\MediaId ( "USER_MEDIA_ID" );

print_r ( $myLike->listLike ( $mediaId ) );
```

- Send Like to Media

```
$myLike = new Ch0c01dxyz\InstaToken\Endpoints\Like ();

$myLike->setToken ( "USER_APP_TOKEN" );

$mediaId = new Ch0c01dxyz\InstaToken\Objects\MediaId ( "USER_MEDIA_ID" );

print_r ( $myLike->sendLike ( $mediaId ) );
```

- Delete Like from Media

```
$myLike = new Ch0c01dxyz\InstaToken\Endpoints\Like ();

$myLike->setToken ( "USER_APP_TOKEN" );

$mediaId = new Ch0c01dxyz\InstaToken\Objects\MediaId ( "USER_MEDIA_ID" );

print_r ( $myLike->deleteLike ( $mediaId ) );
```

Location Usage
==============

[](#location-usage)

- Get information about Location

```
$myLocation = new Ch0c01dxyz\InstaToken\Endpoints\Location ();

$myLocation->setToken ( "USER_APP_TOKEN" );

$locationId = new Ch0c01dxyz\InstaToken\Objects\LocationId ( "USER_LOCATION_ID" );

print_r ( $myLocation->infoLocation ( $locationId ) );
```

- Get list Media from given Location

```
$myLocation = new Ch0c01dxyz\InstaToken\Endpoints\Location ();

$myLocation->setToken ( "USER_APP_TOKEN" );

$locationId = new Ch0c01dxyz\InstaToken\Objects\LocationId ( "USER_LOCATION_ID" );

print_r ( $myLocation->listMediaLocation ( $locationId ) );
```

- Search Location based on Latitude / Longitude

```
$myLocation = new Ch0c01dxyz\InstaToken\Endpoints\Location ();

$myLocation->setToken ( "USER_APP_TOKEN" );

$myMap = new Ch0c01dxyz\InstaToken\Objects\Map ( "latitude", "longitude", "distance" );

print_r ( $myLocation->searchLocation ( $myMap ) );
```

Media Usage
===========

[](#media-usage)

- Get Information about Media

```
$myMedia = new Ch0c01dxyz\InstaToken\Endpoints\Media ();

$myMedia->setToken ( "USER_APP_TOKEN" );

$mediaId = new Ch0c01dxyz\InstaToken\Objects\MediaId ( "USER_MEDIA_ID" );

print_r ( $myMedia->readMedia ( $mediaId ) );
```

- Get Information about shortcode Media

```
$myMedia = new Ch0c01dxyz\InstaToken\Endpoints\Media ();

$myMedia->setToken ( "USER_APP_TOKEN" );

$shortCode = new Ch0c01dxyz\InstaToken\Objects\ShortCode ( "USER_SHORTCODE_MEDIA_ID" );

print_r ( $myMedia->readMedia ( $shortCode ) );
```

- Search Media from given Location ( latitude, longitude, distance )

```
$myMedia = new Ch0c01dxyz\InstaToken\Endpoints\Media ();

$myMedia->setToken ( "USER_APP_TOKEN" );

$myMap = new Ch0c01dxyz\InstaToken\Objects\Map ( "latitude", "longitude", "distance" );

print_r ( $myMedia->searchMedia ( $myMap ) );
```

Relation Usage
==============

[](#relation-usage)

- Get user Following

```
$myRelation = new Ch0c01dxyz\InstaToken\Endpoints\Relation ();

$myRelation->setToken ( "USER_APP_TOKEN" );

print_r ( $myRelation->getFollow () );
```

- Get user Follower

```
$myRelation = new Ch0c01dxyz\InstaToken\Endpoints\Relation ();

$myRelation->setToken ( "USER_APP_TOKEN" );

print_r ( $myRelation->getFollowedBy () );
```

- Get user Request Follow

```
$myRelation = new Ch0c01dxyz\InstaToken\Endpoints\Relation ();

$myRelation->setToken ( "USER_APP_TOKEN" );

print_r ( $myRelation->getRequestedBy () );
```

- Get user Relationship

```
$myRelation = new Ch0c01dxyz\InstaToken\Endpoints\Relation ();

$myRelation->setToken ( "USER_APP_TOKEN" );

$userId = new Ch0c01dxyz\InstaToken\Objects\UserId ( "ID_OF_USER" );

print_r ( $myRelation->getRelation ( $userId ) );
```

- Change user Relationship

```
$myRelation = new Ch0c01dxyz\InstaToken\Endpoints\Relation ();

$myRelation->setToken ( "USER_APP_TOKEN" );

$userId = new Ch0c01dxyz\InstaToken\Objects\UserId ( "ID_OF_USER" );

// List Action
// - Follow
// - Unfollow
// - Approve
// - Ignore
$action = new Ch0c01dxyz\InstaToken\Objects\Action ( "follow" );

print_r ( $myRelation->changeRelation ( $userId, $action ) );
```

Tag Usage
=========

[](#tag-usage)

- Get recent Tagged Media

```
$myTag = new Ch0c01dxyz\InstaToken\Endpoints\Tag ();

$myTag->setToken ( "USER_APP_TOKEN" );

$tagName = new Ch0c01dxyz\InstaToken\Objects\TagName ( "NAME_OF_TAG" );

print_r ( $myTag->listTag ( $tagName ) );
```

- Get information about Tag

```
$myTag = new Ch0c01dxyz\InstaToken\Endpoints\Tag ();

$myTag->setToken ( "USER_APP_TOKEN" );

$tagName = new Ch0c01dxyz\InstaToken\Objects\TagName ( "NAME_OF_TAG" );

print_r ( $myTag->infoTag ( $tagName ) );
```

- Searching Tag by Tagname

```
$myTag = new Ch0c01dxyz\InstaToken\Endpoints\Tag ();

$myTag->setToken ( "USER_APP_TOKEN" );

$tagName = new Ch0c01dxyz\InstaToken\Objects\TagName ( "NAME_OF_TAG" );

print_r ( $myTag->searchTag ( $tagName ) );
```

User Usage
==========

[](#user-usage)

- Get basic User information

```
$myUser = new Ch0c01dxyz\InstaToken\Endpoints\User ();

$myUser->setToken ( "USER_APP_TOKEN" );

print_r ( $myTag->getSelf () );
```

- Get User information from given userId

```
$myUser = new Ch0c01dxyz\InstaToken\Endpoints\User ();

$myUser->setToken ( "USER_APP_TOKEN" );

$userId = new Ch0c01dxyz\InstaToken\Objects\UserId ( "ID_OF_USER" );

print_r ( $myTag->getInfo ( $userId ) );
```

- Get current User Media

```
$myUser = new Ch0c01dxyz\InstaToken\Endpoints\User ();

$myUser->setToken ( "USER_APP_TOKEN" );

print_r ( $myTag->getMedia () );
```

- Get media liked by User

```
$myUser = new Ch0c01dxyz\InstaToken\Endpoints\User ();

$myUser->setToken ( "USER_APP_TOKEN" );

print_r ( $myTag->getLiked () );
```

- Search User by Name

```
$myUser = new Ch0c01dxyz\InstaToken\Endpoints\User ();

$myUser->setToken ( "USER_APP_TOKEN" );

$myName = new Ch0c01dxyz\InstaToken\Objects\Name ( "NAME_OF_USER" );

print_r ( $myTag->searchUser ( $myName ) );
```

- Getting recent Media from given userId

```
$myUser = new Ch0c01dxyz\InstaToken\Endpoints\User ();

$myUser->setToken ( "USER_APP_TOKEN" );

$userId = new Ch0c01dxyz\InstaToken\Objects\UserId ( "ID_OF_USER" );

print_r ( $myTag->readUserMedia ( $userId ) );
```

Contributors
============

[](#contributors)

- [Egar Rizki](https://github.com/ch0c01dxyz)

License
=======

[](#license)

BSD 3-Clause License

Copyright (c) 2017, Egar Rizki All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/118d803f1014505acb50350b4cbbdf0858f9e57c0c001ac5300a66b1bbcaa0b0?d=identicon)[ch0c01dxyz](/maintainers/ch0c01dxyz)

---

Top Contributors

[![ch0c01dxyz](https://avatars.githubusercontent.com/u/36781294?v=4)](https://github.com/ch0c01dxyz "ch0c01dxyz (17 commits)")[![plvhx](https://avatars.githubusercontent.com/u/12740518?v=4)](https://github.com/plvhx "plvhx (6 commits)")

---

Tags

deprecateddeprecated-librarydeprecated-repo

### Embed Badge

![Health badge](/badges/ch0c01dxyz-instatoken/health.svg)

```
[![Health](https://phpackages.com/badges/ch0c01dxyz-instatoken/health.svg)](https://phpackages.com/packages/ch0c01dxyz-instatoken)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
