Is this is possible to fetch data through API that how much followers a snapchat user have? - api

Hello Stack overflow community,
I am trying to create an app where a user can put the link or username of his/her snapchat profile. And I want my app to automatically get the user's amount of followers he/she have and save it into a sheet. The reason for doing this is because then I want to assign advertising projects to him/her according to the followers he/she have. I want to fetch that data automatically through the API when a user enter his profile link or username.
And is it possible to check the amount of views a user get on any post by using link of that post through the API

Related

Can the instagram api pull likes and comments from an account that I do not manage

I want to pull likes and comments from any account that I specify. Can this be done with the Instagram API or do you have to have the accounts permissions to pull this info.
Essentially I want to be able to analyze this data without having log in credentials for the account.
Thanks!
Following the June 2016 changes to the API, you will need to invite the other users to be "Sandbox Users" of your API client. And even then, the access will be limited to their last 20 posts. Here's a quick explanation of the new Instagram API rules.
TL;DR
Sandbox users are other Instagram users that you “invite” to your
client. The main reason to do this is so that your app will then be
able to “see” their last twenty posts in addition to your own. In
other words, when they accept the invitation, they show up on the tiny
desert island where your app lives.
So you don't need their actual login credentials, but they do need to accept your invitation in order for it to work. The only other alternative is getting your app through the submission process to "go live" but there are very few use cases which they will accept anymore.

Instagram api - get all photos by hashtag

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.

Basics of Facebook login

I'm having a hard time understanding how Facebook communicates with my server when a user logs in (after approving my facebook app). I've been looking through guides and other Stackoverflow questions for hours on end but can't seem to get the hang of it. The documentation on http://developers.facebook.com/ isn't to much help much either.
What I want to do is to have a Facebook login button on my page which opens a Facebook login window (using Facebook's Javascript SDK). When the user then logs in to Facebook and approves my app I want to get the user's data (name, email, age) and store it in my database. How do I get this data, SECURELY (server-side confirmation/authorization)?
Basically, in this order;
a user clicks log-in button on my site
a pop-up is shown where the user can log in & approve the app on Facebook
check if user has already logged in before by getting user's user_id
if it's the users first time logging in, the user's Facebook data (specifically: full name, picture, email adress, age) is gathered by me and stored in my database
After the user logs/approves the app in the Facebook pop-up, where is the user's data then sent?
After the user approves the app, the user's data is not sent anywhere. You need to make an API call to retrieve the data.
Facebook is an OAuth provider. You use Facebook Login so the user can give you permission to access her Facebook data (such as email, friend list, messages, news feed etc). You can also get permissions to take action on behalf of the user (such as uploading a photo, posting to news feed etc.) While starting the OAuth flow, you specify which permissions you will request from the user. These are called scopes.
The authorization flow that happens in the pop-up window is there for the user to give you permission to access the data that you request. This permission is represented as an access token which you have to use everytime you want to retreive user data, or attempt to do something on behalf of the user.
Once you have the access token, you can use the Facebook Graph API to get whatever data you want from Facebook. If you try to access some data that you did not get permission for, then the API method will return an access denied error.
I wanted to give some more links about scopes and access tokens from the Facebook Developers site but my reputation score is too low :)

Is there any way I can retrieve twitter user's email Id (Objective-c)?

https://dev.twitter.com/docs/faq#6718
If twitter doesn't provide any API, then how does foursquare retrieve them?
Foursquare has provision to list out the user's foursquare-friends who have registered with twitter.
It also provides API which shows friends of users who commonly appear in 'foursquare friend's list' as well as 'twitter followers list' of the user.
In both the above cases comparison can be made only through email.
Please help.
There's no way for you to get an e-mail from Twitter. Except, of course, by asking the person to give it.
What FourSquare does need no access to the e-mail. Matching is based on the Twitter name, not on the e-mail.
In the comments you say
My friend has registered in both Twitter and Foursquare. The only field common in her profile is the email id. No other fields match. She comes in the 2nd list which i have mentioned above.
but then you admit
After she has registered with FourSquare, went to her profile, clicked on friends -> Add Friends -> opted Twitter. She was asked to login to Twitter and thus she did it
This means that now FourSquare have access to her Twitter as well as your. Foursquare knows her Twitter id and your twitter id and can access Twitter (using Twitter API) to see who is following is following who. In other words when you say
The only field common in her profile is the email id. No other fields match.
You are wrong. Once she connected her FourSquare profile with her Twitter, all data that is accessible via Twitter API is in fact (at least potentially) part of her Foursquare profile.
But she needed to explicitly connect the two profiles (which she did when she opted to add friends to her Foursquare profile using Twitter).

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.