Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: geo-tagged videos #24

Open
geraldstanje opened this issue Apr 6, 2015 · 1 comment
Open

Question: geo-tagged videos #24

geraldstanje opened this issue Apr 6, 2015 · 1 comment

Comments

@geraldstanje
Copy link

Hi,

Is it possible to search for the latest geo-tagged youtube videos using this api? I prefer golang...

YouTube Data API (v2) provides:
...location and location-radius parameters, which can
be used on a search query to restrict results to videos that are
geotagged and within a certain area:

http://code.google.com/apis/youtube/2.0/reference.html#locationsp

what can i use with YouTube Data API (v3)?

Thanks,
G

@Umriyaev
Copy link

Hi,
I'm not Go developer, but .Net developer. However, I checked following link to see if it's still supported:
https://developers.google.com/youtube/v3/guides/implementation/search

v2 API parameter v3 API parameter
3d videoDimension
caption videoCaption
category videoCategoryId
duration videoDuration
ends-after not supported
ends-before not supported
format not supported
hd videoDefinition
license videoLicense
location location
location-radius locationRadius
lr not supported
orderby order
q q
restriction regionCode
safeSearch safeSearch
starts-after not supported
starts-before not supported
status eventType
time publishedBefore, publishedAfter
uploader channelId

As you see, location parameter wasn't changed and moved to v3 as it was.

If you check youtube package in Go client repository:
https://github.com/google/google-api-go-client/blob/master/youtube/v3/youtube-gen.go
you can find following code starting from line 11603:

// Location sets the optional parameter "location": 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.
func (c *SearchListCall) Location(location string) *SearchListCall {
    c.opt_["location"] = location
return c
}

// LocationRadius sets the optional parameter "locationRadius": The
// locationRadius parameter, in conjunction with the location parameter,
// defines a circular geographic area.
//
// The parameter value must be a floating point number followed by a
// measurement unit. Valid measurement units are m, km, ft, and mi. For
// example, valid parameter values include 1500m, 5km, 10000ft, and
// 0.75mi. The API does not support locationRadius parameter values
// larger than 1000 kilometers.
//
// Note: See the definition of the location parameter for more
// information.
func (c *SearchListCall) LocationRadius(locationRadius string) *SearchListCall {
    c.opt_["locationRadius"] = locationRadius
    return c
}

Hope this helps.

Sincerely,
Shokhrukh Umriyaev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants