Instagram: Get photos by user and tag

不想你离开。 提交于 2019-12-03 02:18:37

Your best bet is to do a lookup on a user and then sift through the results and get each picture with a certain tag

MikroDel

There is an opportunity how to do it:

https://api.instagram.com/v1/tags/SEARCH_TAG/media/recent?client_id=CLIENT_ID&callback=MY_CALLBACK

SEARCH_TAG - input

CLIENT_ID - its your ID after registration

MY_CALLBACK - your callback function.

You will receive your response in Form of JSONP.

After it you can search your response with the parameters your want.

You could make a list of images with a certain tag and then a list of images with a certain username. You could then compare the two lists. I'd recommend python with Beautiful Soup.

Wrote the code for you in php:

$api = file_get_contents("https://api.instagram.com/v1/tags/YOURTAG/media/recent?access_token=YOURACCESSTOKEN");
$json = json_decode($api,true);
foreach($json['data'] as $data){
  if($data['user']['username']=="YOURSPECIFICUSERNAME"){
     //action
  }
}

Enjoy : )

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!