It seems that youtube api search video with q parameter doesnt work as search on youtube wesite itself
If I search this channel for 'jorneot
https://www.youtube.com/user/GoProCamera/search?query=jornet
I get 5 search results (4 videos and a playlist)
But If I use api for same search I get only 2 videos:
https://www.googleapis.com/youtube/v3/search?part=id,snippet&maxResults=50&channelId=UCqhnX4jA0A5paNd1v-zEysw&key=API_KEY&q=jornet
Related
I am using the google API and I wanted to do a youtube search.
I request a search with https://www.googleapis.com/youtube/v3/search?part=snippet&q=[word that I searched for]&key=my_keyto get the items array. I noticed though that the items array does not return the results in the same order as when you search youtube yourself.
Ex: if I search for the word 'bad' the first result in the items array is the "Young Lex ft AwKarin - BAD ( Official Music Video Clip )" while if I searched like a youtube user its the "Michael Jackson - Bad (Shortened Version)".
Perhaps they are not ordered and I have to order them using a property or something I have missed.
So my question is how can I make the items array return as the first item the first result that would have appeared in the youtube search.
edit: I have tried adding chart=MostPopular leaving to default videoCategoryId, but it still showed the same first result.
Well, it seems that the YouTube acts like that and it is a natural behavior of it. The only possible way that you can do to match the API and the YouTube site itself is by passing the same filter for it. Example is upload date and viewCount.
Here is the example request for viewCount.
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&maxResults=10&order=viewCount&q=spider&_h=1&
and this is for the YouTube site
https://www.youtube.com/results?q=spider&sp=CAM%253D
Hope this slight information helps you.
I'm building a JavaScript app that returns Instagram posts with a given tag, using the tags/tag-name/media/recent endpoint. I'm trying to add in functionality to search by date range. Min/max_timestamp works for the Users API, but the Tag API only accepts min/max_tag_id. Following the suggestion here, I am trying to search the Users API with my dates of interest. The idea is to get post id's that correspond with my dates, then plug those id's into the min/max_tag_id in the Tag API.
However, the post id returned from the Users API (ie 9999999999999999999_9999999) appears to be a different format than what min/max_tag_id is looking for, confirmed by a Tag API paging response (131 character string of characters, numbers, underscores and hyphens).
Is there any way I can find a tag_id using a date-based search?
The max_tag_id and min_tag_id value is not media_id anymore after the June 1, 2016 API changes.
When API was first launched, the max_tag_id and min_tag_id was taking epoch timestamp value, then it was changed to actual media_id and now it looks like it is some cryptic value that is not easy to decode.
I was supporting date/time search for all feeds before, but now it is not possible for tag media feed. I have implemented date/time search in https://picodash.com for all feeds except tag media
I've found out, that you can get latest public posts of an instagram page by using simple media url:
https://www.instagram.com/PAGE_ID_NAME/media/
I've noticed that it returnes JSON with maximum of 20 posts and information if there are "more_available".
Now I don't want to pull 20 posts - I just need like 5 and provide a pagination for possible more - but I did not find how to limit these results - I've tried adding ?limit=NUMBER and ?count=NUMBER without success.
So 2 questions arise:
How do I limit results while using url structure above?
How do I make pagination links while using url structure above?
Is 1. & 2. even possible?
Try building this url.
https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token={YOUR-ACCESS-TOKEN}&COUNT={NUMBER-RESULTS}
Get a list of recently tagged media. Use the max_tag_id and min_tag_id parameters in the pagination response to paginate through these objects.
PARAMETERS
COUNT Count of tagged media to return.
MIN_TAG_ID Return media before this min_tag_id.
MAX_TAG_ID Return media after this max_tag_id.
# instagram api : As we can write description of a photo (160 characters ) in Instagaram. I want to utilize this information.
Q: Can I create a complex search expression like FIFAorFOOTBALLandFRANCEnotSPAIN which gives me the images having fifa, football and france in description field but not the spain.
The Instagram API only supports searching a single tag at a time.
There isn't a way to do it directly on YouTube, so I wondered if there's a way to do it via the API? On the website, you can just filter videos that have captions, but if you want to search videos that have French captions for example, you can't.
Thanks a lot.
It seems it's not possible:
caption The caption parameter enables you to restrict a search to
videos that have or do not have caption tracks: To only request videos
that have captions, set the caption parameter value to true. For
example, the URL below would retrieve videos that have captions and
that match the search term "surfing":
https://gdata.youtube.com/feeds/api/videos?q=surfing&caption&v=2 Note:
For backward-compatibility reasons, the API will also only return
videos that have captions if you include the caption parameter but do
not specify a parameter value.
To only request videos that do not have captions, set the caption
parameter value to false. For example, the URL below would retrieve
videos that do not have captions and that match the search term
"surfing":
https://gdata.youtube.com/feeds/api/videos?q=surfing&caption=false&v=2
Note: The API will return an HTTP 400 response if you specify the
parameter with any value other than true or false.
Source: https://developers.google.com/youtube/2.0/developers_guide_protocol#captionsp