Instagram api - get all photos by hashtag - api

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-TOKEN
It is fetching the images, but, only on my accounts photos. I want is, I will give an tag-name, and it wll display all, not just the photos on my account, but all the photos in Instagram too.

I know has been a long time, but just for the record.
Since you need the public_scope permission for this (the permission that gives you access to all public data on instagram, and not only your account) you need your app to be reviewed and approved by Instagram. However, if you're using the API for a one-site personal project, Instagram will not approve it.
Here's from Instagram's docs:
1: Which use case best describes your Instagram integration?
R: I want to display hashtag content and public content on my website.
A: This use case is not supported. We do not approve the
public_content permission for one-off projects such as displaying
hashtag based content on your website. As alternative solution, you
can show your own Instagram content, or find a company that offers
this type of service (content discover, moderation, and display).
You can find more information in the Permission Review documentation.

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.

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)

You can try it and it is working for me.
/v1/tags/{tag-name}/media/recent?client_id={YOUR_CLIENT_ID}
My client id is created before "permission review", it is working now and I am trying to submit permission review to Instagram now, hope it will pass.

Related

Sign Up and get Follow List With Instagram Still Allowed?

In my project I want to implement a sign up with Instagram and a get user's follow list feature. However, on the Instagram developer website under login permission it says under public content and follower list that "applications no longer accepted". Does this mean that I can no longer implement these features?
For security reasons, a lot of Instagram API access was removed in 2016. You can read more about it here: http://uk.businessinsider.com/instagram-made-a-change-that-stopped-lots-of-third-party-apps-from-working-2016-6/?IR=T. This was to increase customer privacy.

How can I get all my instagram account feed?

I'm trying to get all my instagram account feeds/images. But I found that the api has restriction for 20 feeds only. I can only get my latest 20 posts. But I want all my posts/feeds. I guess there is some way to do that cause I found some examples that is displaying all the feeds.
Any suggestions can be helpful. Thank you in adcance.
If you just signed up for API, you will be in Sandbox mode which has limitations
The behavior of the API when you are in sandbox mode is the same as
when your app is live, but comes with the following restrictions:
Data is restricted to sandbox users and the 20 most recent media from each sandbox user
Reduced API rate limits
more info here: https://www.instagram.com/developer/sandbox/
Use have to submit request to instagram. Example for your case you can submit basic permission to read a user’s profile info and media. Step by step:
1. Create new client at https://www.instagram.com/developer/
2. Make video screencast of your app to tell how you use the permission
3. Go to manage tab -> permission tab and submit to instagram approval

Twitter API - get Account Details from consumerKey and consumerToken

I inherited an application that has tons of users already authorized to get twitter data on their behalf.
The problem is the guy who created is not around anymore and I am left with consumerKey and consumerToken only.
That in itself is sufficient to interact with twitter API, but I now need to know the account details ( in particular the screen_name that created the app) .
I could not find any API to get such details. Any ideas on how to get it.?
There isn't a direct way to find the app owner's screen name, but here are a few things you can do to investigate:
Use the ConsumerKey and ConsumerSecret, that you have, to start the OAuth process.
On the Twitter Authorization screen, you can see the name of the app and who created it.
You might be able to do a Twitter search for the person who created the app and get their screen name.
Continue to authorize the app - this will put it in your app list.
Visit your personal Twitter Settings tab, click on Apps, and find the App that you authorized.
Click on the owner's name, which will lead you to a Web site.
The Web site might be the company Web site, in which case, there is no further help.
The Web site might belong to the owner and it might have a link to the owner's Twitter account where you can get their screen name.
Just know that there's nothing keeping you from using the ConsumerKey/ConsumerSecret that the other guy set up. You can create your own app - preferably with an account that belongs to the company with credentials that the company can access if you're no longer around. Then use the ConsumerKey/ConsumerSecret from the new app on subsequent deployments.

Getting the share link for checkins from Foursquare API

Currently I'm grabbing a user's latest checkin and displaying it on a page. This is done using an access token, e.g.
var url = "https://api.foursquare.com/v2/users/self/checkins?oauth_token=" + access_token + "&v=20120214";
What I'm trying to do is have a link go to the check in URL on Foursquare, however that link asks for users to log in. The link is created like so:
foursquare.com/{username}/checkin/{checkinID}
This goes to a "log in to foursquare" page, but if I view the link for Twitter, it has an extra parameter, "s=", which shows the check in regardless of being logged into Foursquare or not.
So my question is how can I generate a share link for the check in? I can't find anything in the docs about having a signature, nor is it something I find in the checkin object.
Check-ins are only visible to a user's friends, unless they choose to publish it to another system like Twitter or Facebook. Because of this, a potential viewer needs to log-in so we can verify that they are a friend of the user.

Using Input Box to Post onto Twitter

Is it possible to post onto Twitter using the sharing URL, for example:
http://twitter.com/home?status=My Status Update
But, instead of creating a link for a user to click, I want to have an input box that will post the content of the input box as the status. So, whatever the user types into the input box would replace My Status Update.
I'm thinking there should be a way to use the form to post onto this URL hxxp://twitter.com/home?status=XXXX where XXXX is the input value. Is this possible?
UPDATE: I realize I described this wrong - it doesn't have to ACTUALLY POST the status, it can take them to Twitter, ask them to logged in (if not, skip), and then put the status update inside the Tweet Box and require the user to press Tweet to send it
Thanks!
No, Twitter require the status to be sent from it's interface.
You can provide the user an option to send status from your site only with twitter application and only after the user authorized your application to sends twits in his account.
Sadly, the solution to this may be more complicated then you think.
Twitter recently switched to full OAuth authentication to interact with their api and to post status updates etc.
In short, to do what you suggest above will require your visitors to log in.
To simplify this, on my websites I use the Official Twitter Tweet Button because I feel that my visitors will trust it the most and will enter in their username/pass without worry.
The Official Twitter Tweet Button page has a builder where you can select various options to change the look and content of the tweet itself.
Be sure to checkout the full documentation for the advanced usage examples and the full reference of properties that can be used with the javascript tweet button
p.s.
On my site I registered for an app so I could include the following js file:
<script src="http://platform.twitter.com/anywhere.js?id=MY-APP-ID&v=1"></script>
And my links look something like this:
Tweet