I want to get the information of exact categories from Google Photos API, such as the each people in PEOPLE categories - google-photos

I want to get the information of exact categories from Google Photos API, such as the each people in PEOPLE categories ,but I find any methods in Google Photos APIs, Can you help me to get the information of exact categories?

I assume you want to programmatically get a list of categories that you can filter.
To my knowledge and after having worked with the API for some weeks, this is currently not possible.
There is a static list of categories that you can currently use for filtering at : https://developers.google.com/photos/library/guides/apply-filters#content-categories
Of course it would be nice of Google to provide a way to get this list dynamically with an API call in case this list is updated/modified in the future.
The Google Photos API is still very new and in beta, so maybe this will be a future feature from Google.

Related

Facebook/Instagram API - Getting Popular Hashtags

I am trying to use the Instagram API for one of my projects. The task I'm trying to accomplish is getting popular hashtags based on an input keyword.
To elaborate a bit: when you're on Instagram, and start typing a hashtag, you get a popup with suggested hashtags related to what you're typing, sorted by popularity.
I'm trying to get these suggestions, but through an API call. Looking at the Instagram API docs, there is Hashtag Search as shown here, but this endpoint searches for posts which use the input hashtag, which is not what I want.
Another post suggested I have a look at Facebook Graph API instead, but again no luck there either.
I know this is possible to do as certain websites which provide services to schedule posts, like this one do it.
So, is there an endpoint in either Instagram or Facebook API that I've missed, or is there any third party API / tool that can accomplish this?
There is not currently any "trending" features as part of Instagram Graph API.

Facebook opengraph insights api on specific post id from my app

I want to build a dashboard that returns more customized insights from the insights generated by app.
The app is a facebook connect website that users visit and view a list of products. They can post to facebook about that particular product by sharing a custom story that incorporates that product on their timeline.
When I go to the insights for my app, it does a great job of showing me all social impressions for all custom stories that were generated on my site.
I'd like to narrow that down even more for specific products.
My plan is to record the object ids that are generated by these actions and link them to a partucular product in my database.
I'd then like to create a new dashboard page that will allow me to login, request read_insights permission from me and then use that object_id:product mapping from my database to show how many social impressions where recorded for a given product's object_ids.
Is this possible? I've read alot about it but still haven't found the most elegant way to get a segmented report of social impressions per type of content that was posted.
Thanks for your time.
The implementation all depends on which platform you want your app to run on.
The first major component is you must have a Facebook developers account which is easy to signup for. Just go to developers.facebook.com and register. Takes like 2 mins. After that you will need to create your first app and add the correct domain name where your app will be hosted and what platform it will run on. (iOS, Android, Web, ect.) Once that is finished you can make your app public so you can use the Facebook API in your code.
For the app creation itself. The first thing you need to do is import the correct API for your platform. Which you can find a walk through at https://developers.facebook.com/docs/. Once the API is imported you must build a Facebook object which contains your app id and possibly app secret. If you're using JavaScript you don't want to use the app secret because it will be visible to the public.
Now that you have your Facebook object you must require the app users to log in and grant permission to your app. You can add extended permissions to your log in process by adding a scope value to the log in button generated by Facebook. Here is an example.
<fb:login-button id="loginBtn" max_rows="1" scope="basic_info,read_insights,manage_pages" size="medium" show_faces="false" auto_logout_link="true"></fb:login-button>
After the user is logged in you can now query information from the users account using Facebook Api calls to Social Graph. Facebook also provides a tool to help you figure out what information you can query. https://developers.facebook.com/tools/explorer
Everything else you want to do with the app can be done by Facebook API calls. You just need to insure you grant the user the correct permissions before making the API calls.
API calls are a little different depending on which language syntax you are using but they all follow the same data model and return some array of responses which can be parsed using JSON or the standard array format. The Graph Explorer tool listed above will show you the output for your queries so you can handle them accordingly.
I hope this helps gets you started.
EDITED
Here's the implementation in JavaScript
function getMetric(){
// make the API call
FB.api(
"/{app-id}/insights/application_opengraph_story_impressions",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
}
Here's the reference now that Facebook docs are back up https://developers.facebook.com/docs/graph-api/reference/insights
application_opengraph_story_impressions will probably give you the total impression of all stories made by your app. I ran it against my Facebook app and it came back empty but I don't have any stories so it might work with your's. Also to note in the documentation there is an * by this metric and I could't find what that means.
I'm pretty sure that right now Facebook don't give developers ability to get insights about app custom stories.
Currently Facebook documentation has the following Graph APIs for Insights data:
/{page-id}/insights
/{app-id}/insights
/{domain-id}/insights
/{post-id}/insights (where this is a Page post)
So /{post-id}/insights won't work because custom story is actually user's post and others endpoints don't apply to your case.
As far as I know the only other option to access Insights is FQL. For that you'd use insights table in a manner similar to this:
SELECT ... FROM insights WHERE object_id = ... AND metric = ... AND end_time = ... AND period = ...
Now most likely this also won't work with your custom story posts (I don't have posts which I could try it on right now, so I can't tell) but at least it is not explicitly stated so in the documentation, so you should probably try it out.
UPDATE:
I wasn't able to get any insights data via FQL, although as far as I understand the following code should have gave me at least something (object id is for my page):
SELECT breakdown, end_time, event, metric, object_id, period, value FROM insights WHERE object_id = 224981264214413 and metric = 'page_fans' and period = period('lifetime') and end_time = 1395597892
But it results just in
{
"data": []
}
Facebook also has some pretty old bug report about similar topic: https://developers.facebook.com/x/bugs/508088155954330/ where they confirmed the issue, assigned it, and... did nothing to fix it for 6 months.
In case FQL doesn't work, my suggestion to you is - use your own analytics code to track the creation of custom stories and get the friend count of the users. It won't show you the real exposure of the posts but at least you will see some data on which types of custom stories where posted more often and what was the maximum potential friend count that could have seen them. By the way - to make charting easier, you could use Google Analytics events for that.

Facebook Graph API to search user statuses

I am trying to pull some of my facebook statuses that contain a particular keyword and show them on a web page, what is the url query string I should use?
The best I can came up with is graph.facebook.com/me/statuses
But it returns all the statuses, but i want statuses that contain a particular keyword, such in a search, how should I do it? Or is it even possible?
You'll have to manually go through the statuses returned from /me/statuses to find the ones that you care about. Facebook doesn't really let you use their computing power to search stuff like that.

How to get Tour Dates information from a band page through API

I'm working on a web site for a friend's band and I want to pull information from their facebook band page. Specifically I am looking to get tour dates. I am a beginner with the facebook APIs, but I did read through all of the documentation and I couldn't find anything on the tour date information through the graph API. I can pull basic info from them, but I can't seem to figure out how to get tour dates. Any help is much appreciated. Thank you!
The Tour Dates are provided by the Bandsintown Facebook app (ID: 123966167614127). As such, you need to use their API to access the dates.
Fortunately, Bandsintown.com does offer a nice API. Check it out at: http://www.bandsintown.com/api/requests
The above was just to obtain the dates as you see in the 'Tour Dates' link for most popular bands.
If the band uses Facebook events along with the app, you could just do a simple call to something like https://developers.facebook.com/tools/explorer/?method=GET&path=coldplay%2Fevents
If the band is using the Events functionality on Facebook you can use that to retrieve a list of all tour dates. Check the Events API page in the Facebook documentation:
http://developers.facebook.com/docs/reference/api/event/
And look at their example of what this looks like here:
http://developers.facebook.com/tools/explorer/?method=GET&path=331218348435

Facebook Page - Get Post feedback and impression via Graph API

I'm trying to get some insights on a list of Posts by a Page on Facebook.
To be specific, I want to get the information highlighted in this blog post via the API.
But I can't figure out how, anyone knows how?
As far as I know it's only possible using the "stream" table. So you've got to use FQL to query this data. Using this technique you'll only get the impressions directly. Feedback rate can be calculated by adding #comments and #likes and dividing the result by #impressions. Hope they'll add this to the insights graph api as well.
MartinHN
Refer to https://developers.facebook.com/docs/reference/api/#analytics
If you are trying to aggregate multiple pages or a page other than the requesting app then you may need grant read_insights permissions to your application.
Refer to http://developers.facebook.com/docs/reference/api/insights/