The following query will return results, but some of them will contain a limitedSyndication restriction. This cannot be filtered out by format or by restriction parameters.
http://gdata.youtube.com/feeds/api/videos?alt=json-in-script&callback=jQuery.youtube.response&q=Madonna&v=2&format=5&start-index=11&max-results=10
restriction parameter is not used in the query above because YouTube Data API reference guide states the following:
By default, the API filters out videos
that cannot be played in the country
from which you send API requests.
Am I doing something wrong? (Besides searching for Madonna)
How can I get rid of limitedSyndication results, or is this a bug?
As stated in the GData docs, you can pass a "restriction" param that will filter out results that can't be played by the ip you pass, so you just need to get the user's IP and pass that to the request:
To request videos playable from a specific computer, include the restriction parameter in your request and set the parameter value to the IP address of the computer where the videos will be played – e.g. restriction=255.255.255.255.
To request videos that are playable in a specific country, include the restriction parameter in your request and set the parameter value to the ISO 3166 two-letter country code of the country where the videos will be played – e.g. restriction=DE.
You should include this parameter in any request to retrieve a list of videos, including search results, playlists, favorite videos, video responses and so forth. If a video in the API response is not playable in the location that you're using to restrict availability of the content, the <entry> for that tag will not contain a <media:content> tag. However, it will contain a <yt:state> tag that indicates that the video is restricted.
Related
I'm trying to fetch YouTube videos for keyword 'Color&Co' but I'm unable to get similar response through YouTube API as compared to manually searching same keyword on youtube.com.
I have tried following encoding techniques to get response from YouTube API similar to manually searching on youtube.com:
keyword = 'Color&Co'
URI.encode(keyword)
CGI.escape(keyword)
ERB::Util.url_encode(keyword)
keyword.encode('iso-8859-1').encode('utf-8')
keyword.encode('iso-8859-1').force_encoding('utf-8')
keyword.force_encoding('iso-8859-1').encode('utf-8')
I'm expecting YouTube API to return response similar to searching same keywords with special characters on youtube.com.
Since it is a GET request to the endpoint documented here https://developers.google.com/youtube/v3/docs/search/list and the search term is passed as the q query string, you only need to use standard query string encoding as for any url. Even works with emojis.
Thus: ...?q=Color%26Co
I am attempting to use the Paginated Products API to make a GET request using the optional specialOffer parameter. I have made many requests with multiple variations of the parameters available and have received an empty JSON object for each request whenever I use the specialOffer parameter. However, when I use the other optional parameters available without the specialOffer parameter, such as category, brand, format, and count, I receive the expected response.
Example requests that returns empty JSON object:
http://api.walmartlabs.com/v1/paginated/items?apiKey=APIKEY&specialOffer=specialBuy
http://api.walmartlabs.com/v1/paginated/items?apiKey=APIKEY&category=3944_1060825_1939756&specialOffer=specialBuy&count=10
Example request that returns expected results:
http://api.walmartlabs.com/v1/paginated/items?apiKey=APIKEY&category=3944_1060825_1939756&count=10
In addition to this, I have ensured that there are items available which are in the specialBuy (as well as rollback and clearance) categories, by checking the Special Feeds like so:
http://api.walmartlabs.com/v1/feeds/specialbuy?apikey=APIKEY&categoryId=3944_1060825_1939756
Documentation for the Paginated Products API:
https://developer.walmartlabs.com/docs/read/Paginated_Products_API
Can anyone shed some light on this issue?
Suppose I have a Google Plus/Places URL (e.g https://plus.google.com/111840715355681175070/about?hl=en-US)
This is actually the URL for a result via the Google Places API (https://developers.google.com/places/documentation/). The sequence of numbers after plus.google.com doesn't seem to correspond to id, reference or place_id.
Suppose I only knew the URL, is there anyway of mapping this to an id, reference or placeid so I can find it via the Places API?
Once solution seems to dump the URL into the Places Text Search but this is expensive (10x multiplier in terms of rate limiting) and seems silly.
try this google places api through url
https://developers.google.com/places/documentation/
On YouTube API V3 search:list page, I try simple request with videoEmbeddable attribute to true.
It generates "Error 400, Invalid combination of search filters and/or restrictions.".
This parameter seems to be not supported and videoSyndicated too.
Is the API reference not up to date ?
URL: https://developers.google.com/youtube/v3/docs/search/list
Since the search is unified (returns videos, playlists, channels in response) you should filter type = video while using video filters like videoEmbeddable.
GET https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&videoEmbeddable=true&key={YOUR_API_KEY}
I am using "/reader/api/0/stream/items/ids" API to get the item ids for sources that I want.
I have quite a number of sources, so I repeated "s=" parameter to include in the api url.
However, google has given me an error of "URL is too long".
So the question is that How can I solve it so that I just use one time api call to get item ids for that many sources?
Thanks
It seems that /reader/api/0/stream/items/ids path supports a POST method. This means the amount of data you could pass by using POST verb is much more than by using a query string and a GET method.
So use https://www.google.com/reader/api/0/stream/items/ids URL for the post, and pass your query string as a post data. Don't forget to include an action token(T) which is required for POST requests.