Instagram api - get all photos by hashtag

后端 未结 4 801
半阙折子戏
半阙折子戏 2021-02-14 15:40

I am new to this Instagram API, and I read their doc about endpoints, this is the endpoint that I am using:

/v1/tags/{tag-name}/media/recent?access_token=ACCESS-         


        
4条回答
  •  半阙折子戏
    2021-02-14 15:50

    By hashtag you mean tags.
    It works for me. Despite I'm using python client, it should work well when you're developing your own client. Look:

    from instagram.client import InstagramAPI
    
    api =InstagramAPI(client_secret=settings.CLIENT_SECRET,
                       access_token=settings.ACCESS_TOKEN)
    
    result = api.tag_recent_media(tag_name='castle')
    media = result[0]
    
    for m in media:
        print (m.images)
        print (m.user)
        print (m.tags)
    

提交回复
热议问题