facebook twitter hatena line email

Instagram/api

提供: 初心者エンジニアの簡易メモ
2016年1月18日 (月) 12:06時点におけるAdmin (トーク | 投稿記録)による版 (アクセストークンを取得)

移動: 案内検索

API申請は2015/11/17以降厳しくなっているらしい

http://www.bricoleur.co.jp/blog/archives/2576

ハッシュ検索も一般ユーザの画像は表示されないようにされているっぽい http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q14153122184

developer登録

http://instagram.com/developer/clients/manage/

  1. regist new clinetsからアプリケーション作成
  2. Client ID と Client Secret を取得できる
  3. "This app is in sandbox mode and can only be authorized by sandbox users."となるがアプリIDが作成される

アクセストークンを取得

ttps://api.instagram.com/oauth/authorize/?client_id=[client_id]&redirect_uri=[redirect_uri]&response_type=token

認証するとリダイレクトURL先のパラメータにアクセストークンが表示される

きちんと入れたはずだがエラーが発生した。

{"code": 403, "error_type": "OAuthForbiddenException", "error_message": "Implicit authentication is disabled"}

manage_client/edit/securityから"Disable implicit OAuth"のチェックを外すときちんとURLのパラメータにアクセストーンが表示されるようになった。

参考:http://qiita.com/zurg/items/4c423b93b6a7f1ac737d

検索api

ttps://api.instagram.com/v1/users/search?q=あいうえお&access_token=[access_token]

権限がないので以下のように表示される(2015/11/17からっぽい)

{"meta":{"error_type":"OAuthPermissionsException","code":400,"error_message":"This request requires scope=public_content, but this access token is not authorized with this scope. The user must re-authorize your application with scope=public_content to be granted this permissions."}}

この先は申請が必要だからテストで使うのは無理っぽいかな・・。

APIリクエスト回数限度

5000/時間

公式API限度ページ:https://www.instagram.com/developer/limits/

公式マニュアルページ

https://www.instagram.com/developer/