実行結果' ; // エラー判定 if( !$obj || !isset($obj->data->id) || !isset($obj->data->username) ) { $html .= '

データを取得できませんでした…。設定を再確認して下さい。

' ; } else { // 各データの整理 $id = $obj->data->id ; // ユーザーID $username = $obj->data->username ; // ユーザー名 $bio = ( isset( $obj->data->bio ) ) ? $obj->data->bio : '' ; // 紹介文 $website = ( isset( $obj->data->website ) ) ? $obj->data->website : '' ; // ウェブサイト $profile_picture = ( isset( $obj->data->profile_picture ) ) ? $obj->data->profile_picture : '' ; // アイコン画像 $full_name = ( isset( $obj->data->full_name ) ) ? $obj->data->full_name : '' ; // フルネーム $media = $obj->data->counts->media ; // 投稿数 $follows = $obj->data->counts->follows ; // フォロー数 $followed_by = $obj->data->counts->followed_by ; // フォロワー数 // ブラウザに出力 $html .= '
' ; $html .= '
ユーザーID
' ; $html .= '
' . $id . '
' ; $html .= '
ユーザー名
' ; $html .= '
' . $username . '
' ; // フルネーム if( $full_name ) { $html .= '
フルネーム
' ; $html .= '
' . $full_name . '
' ; } // 紹介文 if( $bio ) { $html .= '
紹介文
' ; $html .= '
' . $bio . '
' ; } // ウェブサイト if( $website ) { $html .= '
ウェブサイト
' ; $html .= '
' . $website . '
' ; } // アイコン画像 if( $profile_picture ) { $html .= '
アイコン画像
' ; $html .= '
' ; } $html .= '
投稿数
' ; $html .= '
' . $media . '
' ; $html .= '
フォロー数
' ; $html .= '
' . $follows . '
' ; $html .= '
フォロワー数
' ; $html .= '
' . $followed_by . '
' ; $html .= '
' ; } // 取得したデータ $html .= '

取得したデータ

' ; $html .= '

下記のデータを取得できました。

' ; $html .= '

JSON

' ; $html .= '

' ; $html .= '

レスポンスヘッダー

' ; $html .= '

' ; // アプリケーション連携の解除 $html .= '

アプリケーション連携の解除

' ; $html .= '

このアプリケーションとの連携は、下記設定ページで解除することができます。

' ; $html .= '

https://instagram.com/accounts/manage_access/

' ; ?> Instagramでユーザーデータを取得するサンプルデモ

配布元: Syncer