Instagram, How to get All photos by Tag?

So I can get how many posts have "SOMETAG":

https://api.instagram.com/v1/tags/SOMETAG

I can get images by tag:

https://api.instagram.com/v1/tags/SOMETAG/media/recent

But it returns only my user photos.

How I can get All photos from all users with some tag (not one request)?

Answers


Your client is in Sandbox Mode and can only search for tags of photos posted by invited users. You have to login into https://www.instagram.com/developer, edit your client and click on the "GO LIVE" button.

If the "GO LIVE" button is disabled, you have get your app reviewed by Instagram first: Click on the Permissions tab and submit for review. (Company Name, Contact Email and Privacy Policy URL are required to start a submission.) Once approved, u will be able to click Go Live.


I think you are in Sandbox mode, so it will return only media from your sandbox authorized user, here is information about this:

As another example, let's consider an endpoint that returns a list of media: /tags/{tag-name}/media/recent. The response returned by this endpoint will contain only media with the given tag, as expected. But instead of returning media from any public Instagram user, it will return only media that belongs to your sandbox users, restricted to the last 20 for each user.

Here is the link to more details about Sandbox mode: https://www.instagram.com/developer/sandbox/


Sandbox Mode will affect the number of pull requests/hour, but it shouldn't be causing you to be unable to pull the data from within the tag set.

In my Instagram Hashtag App - (not sandboxed) I was able to achieve this by using the Recent Tags GET request that you mentioned in your question. The key is pagination in the returned 'responseDict'.

When your request returns with the results of your first pull, it will include the key and another dictionary that contains the next URL (you want this) to continue pulling data at the correct time/tagID.

This should do the trick:

~

NSString *nextSetURL = [responseDict valueForKeyPath:@"pagination.next_url"];

~

What's important to understand is that a large number of posts WILL return, if you run this in a loop and have it waiting for the nextSetURL to return empty.

Instagram's /tags/<tag>/media/recent is set to return 20 results at default (there are ways to change the count).

It's important to consider 2 more things

  • Rate Limit
  • Requests Left

Good luck and I am looking forward to see what you're building using recent Instagram Hashtags!


Need Your Help

ASP.NET Core 404 Error When Published to IIS 7.5

c# asp.net .net iis visual-studio-2015

I'm using Visual Studio 2015 to publish my ASP.NET Core app to IIS 7.5. All I'm trying to do is view a normal default.htm page within my wwwroot. Everything works fine when I use VS's IIS Express,

How can I configure a grid view column to hold a hyperlink myself?

c# asp.net

I'm filling in a DataTable with all the necessary data. I want the "Process" column to hold a hyperlink so that it directs to a specific page when clicked (based on the Process name.