LoginSignup
11
13

More than 5 years have passed since last update.

Instagram APIから写真を全件取得する

Posted at

自分の写真を取得するために使用するURLは下記の通り。

https://api.instagram.com/v1/users/self/media/recent/?access_token=アクセストークン

self部分をユーザIDにすることでも可能

このままだと、写真の取得件数は初期設定である20件しか取得できない。
パラメータとして、countをオプションでつけることも可能。

https://api.instagram.com/v1/users/self/media/recent/?access_token=アクセストークン&count=100

count=100と指定したが、実際に取得されるのは約30件前後の写真しか取得できない…

50件とか100件とか中途半端な件数を表示する方法がよくわからないが、
count=-1とすると、自分がアップロードしている全件分の写真を取得できる。

11
13
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
13