InstaSharp API - getting data from a specific tag

I use the InstaSharp API to upload images from my instagram to my website.

Now I'm trying to get all the data, including a specific hashtag, but the only thing I get is one random object (image data) added to my list ( result.Data ). And this is always the same picture (an object is somewhere in the middle of the whole list of objects from a certain hashtag, and this hashtag that I use gets 66 times when searching on Instagram, so there is more than 1).

How do I get all the data from this particular hashtag, so I can use all of these objects?

Here is my code:

 var users = new InstaSharp.Endpoints.Tags.Authenticated(Config, UserAuthInfo()); //- EDIT - reading the instagram-developer-api, I think this code will order the objects by when //they are hashtagged. This is not what I want, so the best thig would be to do it something like my last example //result.Data only gets filled with one of these 66 objects var result = users.Recent("mySpecificHashTag"); foreach (var item in result.Data) { page.InstagramPhotos.Add( new InstagramPhoto() { Url = item.Images.StandardResolution.Url }); } 

or even better

How can I get all the data from a specific hashtag from a specific user, so I can use all these objects?

Like this:

 var users = new InstaSharp.Endpoints.Users.Authenticated(Config, UserAuthInfo()); var result = users.Recent().Data.Where(o => o.Tags.Any(z => z.Equals("mySpecificHashTag"))); 

Note. If I like this last one, I get only X object numbers added by specific users, for only 20 added objects. This means that 18 other objects do not have the hashtag that I want.

+5
source share

Source: https://habr.com/ru/post/1206734/


All Articles