{"id":20519920,"url":"https://github.com/jabranr/instagram-php-sdk","last_synced_at":"2025-04-14T02:11:52.158Z","repository":{"id":23851513,"uuid":"27229332","full_name":"jabranr/instagram-php-sdk","owner":"jabranr","description":"PHP client for Instagram API","archived":false,"fork":false,"pushed_at":"2016-09-23T17:28:34.000Z","size":17,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T02:11:47.154Z","etag":null,"topics":["instagram-api","instagram-php-sdk","php","php-client"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jabranr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-27T14:43:28.000Z","updated_at":"2024-01-04T15:46:01.000Z","dependencies_parsed_at":"2022-08-21T13:50:37.800Z","dependency_job_id":null,"html_url":"https://github.com/jabranr/instagram-php-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jabranr%2Finstagram-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jabranr%2Finstagram-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jabranr%2Finstagram-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jabranr%2Finstagram-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jabranr","download_url":"https://codeload.github.com/jabranr/instagram-php-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809051,"owners_count":21164896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["instagram-api","instagram-php-sdk","php","php-client"],"created_at":"2024-11-15T22:17:02.000Z","updated_at":"2025-04-14T02:11:52.128Z","avatar_url":"https://github.com/jabranr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instagram PHP SDK [![Build Status](https://travis-ci.org/jabranr/instagram-php-sdk.svg)](https://travis-ci.org/jabranr/instagram-php-sdk) [![Analytics](https://ga-beacon.appspot.com/UA-50688851-1/instagram-php-sdk)](https://github.com/igrigorik/ga-beacon)\n\nPHP client for Instagram API\n\n\u003e **Disclaimer:** Although this project shares same name with famous social network but is NOT an official version of PHP [SDKs for Instagram](http://github.com/Instagram). The package is provided as it is with no guarantee or promises so please use at your own risk. [Instagram](http://instagram.com) is product of Instagram/Facebook.\n\n\n## Install \u0026 Usage\n\n+ Download the [latest release](https://github.com/jabranr/instagram-php-sdk/releases/) or install using [Composer](http://getcomposer.org)\n+ Register client at [http://instagram.com/developer/clients/register/](http://instagram.com/developer/clients/register/) and get `client_id`, `client_secret` and `redirect_uri`.\n+ Here is a basic use example:\n\n```php\nrequire('path/to/autoload.php');\n\nuse Instagram\\InstagramClient;\n\n$config = array(\n\t'client_id' =\u003e 'CLIENT_ID',\n\t'client_secret' =\u003e 'CLIENT_SECRET',\n\t'redirect_uri' =\u003e 'http://example.com'\n);\n\ntry {\n\t$ig = new InstagramClient( $config );\n} catch (Exception $e) {\n\techo $e-\u003egetMessage();\n}\n\nif ( isset($ig) \u0026\u0026 $ig ) {\n\n\n\t/**\n\t * Get a new access token with OAuth\n\t */\n\n\tif ( isset($_GET['code']) ) {\n\t\t$ig-\u003eget_access_token( $fresh = true, $_GET['code'] );\n\n\t\tprint_r( $ig-\u003eget_data() );\n\n\t\t/**\n\t\t * Make API requests. See various methods underneath.\n\t\t */\n\t}\n\n\t/**\n\t * Or display a login with Instagram link for redirect user for OAuth\n\t */\n\telse {\n\t\techo '\u003ca href=\"' . $ig-\u003eget_oauth_url() . '\"\u003eLogin with Insgatram\u003c/a\u003e';\n\t}\n\n\n\t/**\n\t * Or set an existing access token\n\t */\n\n\t$ig-\u003eset_access_token( 'A_valid_access_token_obtained_previously' );\n\n\tprint_r( $ig-\u003eget_data() );\n\n\t/**\n\t * Make API requests. See various methods underneath.\n\t */\n\n}\n```\n\n\n## Documentation\n\nUse following methods to make requests to Instagram API.\n\n\n#### Get Popular Media\n\n```php\ntry\t{\n\n\t$media = $ig-\u003epopularMedia( (int) $count = 25 );\n\t$media = json_decode( $media );\n\tprint_r( $media );\n\n} catch(Exception $e) {\n\techo $e-\u003egetMessage();\n}\n```\n\n\n#### Search Media\n\n```php\n\n/**\n * Atleast lat and lng are required to make requests to this endpoint\n */\n\ntry {\n\t$media = $ig-\u003esearchMedia(\n\t\t\t\t\t(float) $lat,\n\t\t\t\t\t(float) $lng,\n\t\t\t\t\t(UNIX_TIMESTAMP) $min_timestamp,\n\t\t\t\t\t(UNIX_TIMESTAMP) $max_timestamp,\n\t\t\t\t\t(int) $distance,\n\t\t\t\t\t(int) $count = 25 );\n\n\t$media = json_decode( $media );\n\tprint_r( $media );\n} catch(Exception $e) {\n\techo $e-\u003egetMessage();\n}\n\n```\n\n\n#### Get Media using an ID\n\n```php\ntry {\n\t$media = $ig-\u003egetMedia( (int) $media_id );\n\t$media = json_decode( $media );\n\tprint_r( $media );\n} catch(Exception $e) {\n\techo $e-\u003egetMessage();\n}\n```\n\n# License\n\nMIT License - \u0026copy; [Jabran Rafique](http://jabran.me) 2014\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjabranr%2Finstagram-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjabranr%2Finstagram-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjabranr%2Finstagram-php-sdk/lists"}