Hello i am new to Youtube api and looking for getting all the users public Youtube videos in Youtube by location using Youtube api .There are some existing apps like Geofeedia,COEverywhere, TrackinU which can get public posts of social networking sites by location . Is there is any way to get public Videos of an area in Youtube ?
Using YouTube Data API, using Search list with location parameter:
The location parameter, in conjunction with the locationRadius
parameter, defines a circular geographic area and also restricts a
search to videos that specify, in their metadata, a geographic
location that falls within that area. The parameter value is a string
that specifies latitude/longitude coordinates e.g.
(37.42307,-122.08427).
The location parameter value identifies the point at the center of the
area. The locationRadius parameter specifies the maximum distance that
the location associated with a video can be from that point for the
video to still be included in the search results. The API returns an
error if your request specifies a value for the location parameter but
does not also specify a value for the locationRadius parameter.
Related
Video.js provides a method to get video metadata such as player.duration(). This works for regular mp4 videos. Is it possible to get information about license and title of YouTube videos?
You may check in this link the list of parameters that this query (Videos: list) supports.
The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include.
If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties.
With a channel reporting job, we can get the end_screen_element_ids for a given video. These IDs look like GUIDs.
The question is : How do we query the Youtube API to get what video/channel/... these end_screen_element_ids points to ?
Thanks!
You may use the reportTypes.list method. This returns a list of report types that the channel or content owner can retrieve. Each item in the list contains an id property, which identifies the report's ID, and you need this value to schedule a reporting job.
Friends,
I want to search in the query, channels that belong to a certain category (categoryId).
In the example of the app console(https://developers.google.com/apis-explorer/),its ok.
But when I try to run the task with my key, the search returns no result.
i use this key:
https://www.googleapis.com/youtube/v3/channels?part=snippet&categoryId=GCQmVhdXR5ICYgRmFzaGlvbg&key={YOUR_API_KEY}
Try to use the videoCategoryId parameter which filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video.
You may encounter a badRequest (400) invalidSearchFilter error if the request contains an invalid combination of search filters and/or restrictions.
Note that you must set the type parameter to video if you set a value for the eventType, videoCaption, videoCategoryId, videoDefinition, videoDimension, videoDuration, videoEmbeddable, videoLicense, videoSyndicated, or videoType parameters.
Twitter provides an API for getting a place object for any given location. As per twitter API documentation at https://dev.twitter.com/docs/api/1/get/geo/search :
"Given a latitude and a longitude pair, an IP address, or a name, this request will return a list of all the valid places that can be used as the place_id when updating a status.".
API returns a place object. I am specifically interested in getting the bounding coordinates for that place which can be a Point or a polygon which is included in place object. I will then use this to check if user's location lies within some other location say New York.
Now, for any user one can fetch his profile using twitter API. API returns a json object which contains user's location which is basically a string e.g, "San Francisco, CA". This location can be passed to geo search api mentioned above to get coordinates for the polygon which defines a user's location.
I am using twitter4j library to do the same. Method 'searchPlaces()' corresponds to
/geo/search API of twitter and takes a GeoQuery object as argument. However, GeoQuery object has only two constructors which take GeoLocation i.e, latitude, longitude information or ip address.
https://github.com/twitter/twitter4j/blob/master/twitter4j-core/src/main/java/twitter4j/GeoQuery.java
As can be seen in GET geo/search API, all parameters all optional. However, providing only two constructors in GeoQuery class forces one to provide either latitude and longitude values or ipaddress. What I have instead is the string for user's location from his profile.
Can someone please help me out with why there is this disparity between twitter4j and twitter API. Also, can someone suggest some other way to find if some twitter user is from New York.
PS: Any attempt to geocode user's location to get lat,long also requires GeoQuery object which again needs lat, long and I don't seem to be able to figure out how this can be done too.
Thanks in Advance.
I encountered this as well. A workaround is:
GeoQuery geo = new GeoQuery((String)null);
geo.setQuery("New York")
I created a web view to open google maps. I got no problems getting the location by CLLocationManager. However, I need to specify a query string like this: "hospital loc: [latitude], [longitude]" to put in the search box to locate the nearest hospitals. How can I implement this after I load "maps.google.com" in my web view?
Try this :
http://maps.google.com/?q=hospital+loc:+[latitude],+[longitude]
Notes :
Obviously replace with your desired latitude, longitude coordinates
Remember to properly encode the parameter passed to q=