Spotify: Getting metadata without a user logging in - rest

I would like to be able to get song metadata (song title, artist name, album title) from Spotify's Restful Web API. I've looked through the Spotify Web API Documentation and played around with their console, but I almost seems like a user needs to login to be able to get the OAuth token or to refresh the token. Is it possible to get song metadata from the Spotify Web API without the user logging in?

This is possible with the Client Credentials flow.

Related

How to get user information from Twitter in flutter application?

I am building a flutter application where I am integrating twitter login(without firebase).
The twitter login is working fine, I am able to make the login using twitter.
I am using the package: flutter_twitter: ^1.1.3
But after login I am only getting the username of the user.
Is there any way to get the email address, profile picture and other personal information of the user?
Your package seems to only manage authentication, you will need to make HTTP request yourself to Twitter API if you want to fetch any other data.
Based on Twitter Users API Documentation you cannot get user's email address but you can get the profile picture url (profile_image_url) or informations such as the user's name and username.
I let you refer to the API full documentation to see all informations you might be able to fetch.

how can get data from facebook api and write those data in my own database using web services?

For this task I have already created my own facebook application to get the API key and secret key. Can anyone explain the next steps that should be done to
1) Read from facebook API
2) Write my own database
by using web services
Thanks in advance!
A high level answer:
I'm assuming you want to use the authorization code OAuth flow (this means you want Facebook users to give you access to their profiles so you can grab data from there). If so, you need to bring up a web server and an application that will run your users through the Facebook OAuth flow. In case you just want to access Facebook with your own credentials you don't have to have a web server, simply use the client credentials OAuth flow.
So, Once you have a valid access token, you simply make calls to Facebook API using this token. using Facebook Graph API is simply a matter of calling URLs and getting the data as JSON.
You can test-drive the API here.
BTW, according to Facebook's platform policy, you're only allowed to store Facebook data for caching purposes.
Let me know if this helps.

Get foursquare place details with/without API

I want to know the best way how to obtain the basic info of a foursquare location, so for instance the mayor, total checkins, profile picture,...
Important: I should be able to get this information without providing an oauth_token, and that exactly is my problem. The API demands a token, but I figured it should be possible to get the data without the token, because you can access places without authenticating.
E.g.: https://foursquare.com/v/whole-foods/49bc3b0af964a52020541fe3
The reason I want to do this, is because I want to make a facebook application which fetches the data for a locationbased facebook page and I don't want to demand the facebook users to login to foursquare first.
An alternative is webscraping, but that really is my last option.
Thanks in advance for your responses.
The "Venues Platform" allows you to access venue information through the API without an OAuth token. You can access all the information you're looking for, all you need to do is supply your Client ID and Client Secret when making a request to the /venues API endpoint.

Graph API - Creating new photo album for facebook app

I'm trying to create an album on my Facebook app using the Graph API. It's quite easy to create an album for a user account. We just need to have a user access token and send a post request for
https://graph.facebook.com/USER_ID/albums
{
name :'my USER album'
}
It seems to be logical sending the same post request for app:
https://graph.facebook.com/APP_ID/albums
{
name :'my APP album'
}
However it doesn't work. I use the app token which I get from:
access token tool.
Does anybody know how can I do this?
I found a solution. It's quite wird, but what can I do.
Only a user who is an admin of the app can create new albums and photos. If you meet this criterion your app needs to request the user for one more permission: manage_pages.
After this you can request http://graph.facebook.com/ADMIN_USER_ID/accounts. There you will get an array of all pages managed by this user. Find en element which contains your APP_ID. The same element contains an access_token which is required to perform create album and upload photo actions.
Quite simple solution detailed on the facebook Authentication documentation.(Scroll down to "App Login")
You have to query this url :
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
grant_type=client_credentials
the response will be an access token that you can use to perform actions on behalf of you app.
Use page access token instead of user access token,for some operation we require page access token.
It looks like the new API (GraphQL 2.9 as of today) is no more able to create albums dedicated to the Application.
https://developers.facebook.com/docs/graph-api/reference/application/
I have opened a question here : Create photo albums in a Facebook app

Graph API save login information

I am using the Graph API for Facebook on my iPhone application. The problem is, I don't want the user to have to re enter their email address each time they want to login to integrate Facebook with my app. Is there a way to save and auto fill the login information using the Graph API?
Using the Graph API, there is no need for you to store the credentials, more than that, you should NOT store the credentials. As explained in the API dedicated help page the authentication process is handled by a secure token.
Meaning that if the user is already authenticated on Facebook using another application, it might be ( based on authentication process used ) already authenticated within your app.
You might check the token validity by using the isSessionValid method from the Facebook class.
Have a look to the iOS Facebook SSO link, it explains everything you need.