techdog
techdog

Reputation: 1481

YouTube search url for searching username and keywords; and sort results by rating

I have a script that will display the json results of a youtube search. The following url will not sort though it does return the results provided I put in a username into username.

http://gdata.youtube.com/feeds/users/username/uploads?alt=json-in-script&search_sort=video_view_count

This doesn't seem to sort. And also it doesn't seem to be able to search by keywords if I append &q=dogs

Is it possible to search for username plus keywords and sort it afterwards?

Upvotes: 0

Views: 3318

Answers (2)

Salman Arshad
Salman Arshad

Reputation: 272236

Here is the URL you need:

http://gdata.youtube.com/feeds/api/videos
?v=2
&author=SesameStreet
&q=rubber+ducky
&orderby=viewCount
&start-index=1
&max-results=10
&alt=json-in-script
&callback=myCallbackFunction
&prettyprint=true

Click here to view the output

Parameters used:

author In a search request, the author parameter restricts the search to videos uploaded by a particular YouTube user.

q The q parameter specifies a search query term.

orderby The orderby parameter, which is supported for video feeds and playlist feeds, specifies the method that will be used to order entries in the API response.

The complete documentation is available here, you should refer it for additional parameters, possible values and behavior.

Upvotes: 1

techdog
techdog

Reputation: 1481

instead of using q=something
I used search_query=something
q apparently searches for the exact match

Upvotes: 0

Related Questions