It is possible?
I read the documentation, there are examples of receiving the number of views by country, but I need the number of views by city.
regionCode string
The regionCode parameter instructs the API to return search results for videos that can be viewed in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.
The YouTube API only supports searching by region code that being ISO 3166-1 alpha-2 country code
No you cant search by city.
Related
I need get a list of most viewed music video on Youtube.
I used this API:
https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&chart=mostPopular®ionCode=US&videoCategoryId=10&key=[YOUR_API_KEY]
By default regionCode is US, I want get results by global.
Can someone help me?
You can't really using using the chart means you must include a reagion and the default is the USA.
string
The regionCode parameter instructs the API to select a video chart available in the specified region. This parameter can only be used in conjunction with the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code.
remove ®ionCode=US Should be the same as US
GET https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&chart=mostPopular&key=[YOUR_API_KEY]
You would have to query EACH region and take the videos with the highest cumulative viewCount over all regions. This would be difficult as different regions will have different music videos that are most popular. Unfortunately the API doesn't have a global regionCode option.
For an app I need the users to create addresses. It is important that the addresses are valid and include an ISO 3166 ALPHA-2 country code as well as an ISO 3166-2 code for the province, state, etc.
I can use NSLocale to get all country codes and the localized names for a country code but is there a similar way to get the codes and names (they doesn't have to be localized) for the subdivisions of a country or do I have to create that massive dictionary by myself? :D
Thank you in advance
I need to implement a city search dialogue field in my app and use
the ISO 3166-1 country code of the search result.
The country in the result is as a string in the current locale (e.g. "United Kingdom", "Vereinigtes Königreich", ...) instead of just "uk", which is a problem. I could do a string search for all 248 countries in all languages google maps supports but that is very error prone.
Is there a way to include the country code in the search result?
My work around for now is to reverse lookup the reported coordinate afterwards but that's an additional request, resulting in wait time for the user.
I need to fetch trending videos for a specific keyword with the Youtube API.
For example, videos that are trending for "Lebron James".
Can it be done via the Youtube API? Thanks!
Trending Videos
https://www.googleapis.com/youtube/v3/videos?part=contentDetails&chart=mostPopular®ionCode=IN&key=API_KEY
1.part : The part names that you can include in the parameter value are id, snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails.
chart :The chart parameter identifies the chart that you want to retrieve. (string) like 'mostPopular'
regionCode :The parameter value is an ISO 3166-1 alpha-2 country code. (string)
key : Google Project API key
I wish to get only city names from autocomplete api for iOS. For example if i search like Avadi then it should return city name as Chennai. I used google places api. It returns many strings separated by comma from which i couldn't get exact city name if user give any area name of city.
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Avadi&types=(cities)&types=postal_code&key=GOOGLE_API_KEY