Unable to retrieve youtube username - youtube-api

I do have channelId of a channel. But now I want to get the username of that channel (NOT TITLE). I have used following request and I got many details like likes, views, title, description but it is not providing with the username.
https://www.googleapis.com/youtube/v3/channels?part=snippet,contentDetails,statistics&id=UCgT2O93IiQT3XdpQYI6KDYQ&maxResults=10&key=123456789
P.S I've used my api_key properly.

Upon checking all the possible data which can be included in the response of channel API, I can say that it is not possible to retrieve the username as of now. And I don't think there is an alternative way of doing that.
Let's hope they include it in the future.

Related

Return Users ordered by followers Instagram API

I have an issue, I want to get the biggest accounts in Instagram using the API for ruby. When I said "biggest", I meant the accounts ordered by the amount of followers.
I found the service /search, but I don't know how to make the query. It seems that it's only to search by username.
Any idea or workaround?
Thanks!
As far as Instragrams documentation goes this is not possible: https://www.instagram.com/developer/endpoints/users/#get_users_search
From what I can see you can only search by username and I don't see any other way to add parameters. So unless there is an unknown hidden param I don't think this is possible.
If you have a specific user you can see how many users follow that user here: https://www.instagram.com/developer/endpoints/relationships/#get_users_follows but you would need an access token for that user.

channelId, username and tags functionality in API v3

I am new in youtube API v3 and I would like to ask some theoretical questions that confuse me a litle.
The first question is about the username, chanelID and channelTitle. So far I have understand that in API v3 channelID is the one we should use in order to distinquish users and not usernames. Is that true? If yes this means that each user has a unique channelID by default we he creates an Youtube account? Does the ChannelTitle follows the same logic?
The second question I would like to ask is about tags/keyworks that an uploaders optionally attach into their uploads. In the API documentation says that tags are available
only for uploaders. This means that we can not retrieve tags for the queried videos through API v3? Until now I could't notice any tag variable into the snippet obtained
from video->list for some videos I tested. Is authorization matter? In my account YouTube Analytics API, YouTube Data API v3 are enabled.
PS: I am working Youtube API v3 in Python.
Thank you in advance.
Only channelID is unique, user may not have username and channelTitle is not unique.
Tags should be available for response. Example here shows how to update tags. https://code.google.com/p/youtube-api-samples/source/browse/samples/python/update_video.py
Mind that you can only retrieve tags (aka keywords) of your own videos.
More information in the blog post.

Finding Twitter users with follower count = MAX_FOLLOWER

I have been looking at finding Twitter users with followers more than MAX_FOLLOWER (any number set up by programmer).
I visited the twitter API and found I can search via q="keyword" but could not find any way where I can have a search in API using followers_count >= MAX_FOLLOWER
Tried looking some methods at https://dev.twitter.com/tags/finding-users as well but they were not really helpful as I could not find exactly what I am looking for.
Even for oAuth stuff, I tried creating a URL after creating a signature but still not able to consume that.
From the signature base string if I copy the url and decode it for addreess bar and send the request it says page does not exist. So looks like I am not even able to consume the services properly.
My end result will be I want a list of users who have followers_count more than MAX_FOLLOWER and then I can do a new query on those users.
I have been trying this stuff for over 4-5 hours and totally clueless where I am doing wrong or how to proceed. Read a lot of twitter api docs but nothing I could find was useful in my case.

How do I use Youtube Data API V3 to fetch channel uploads using chanel's username?

I've explored most of this topic using the previous question How do I get a list of uploaded videos for a certain channel with the new YouTube Data API (V3)?, but I wanted some specifics that build upon the answer given.
Is it possible to use the channel's username without calling a search query to get the channel ID? I have an https request that can get a search list shown below, but I'd rather not waste API quotas when I know the exact channel username.
https://www.googleapis.com/youtube/v3/search?q={channel_username}&key={my_api_key}&part=snippet
My hack for this is just take a videoid from the channel and extract a uploader ID from there, but its not elegant and won't work if the upload is removed.
Also, once I've worked my way down to getting the uploads key, how can I get a json that shows all of the uploads and not just a list of 25? If I do have to recursively call pages of uploads, how can I do that?
Thanks.
I think that to get a channel, using the channel's username, the only option is to use the search, and the best strategy to minimize the use of quota is to use a cache, or save the channel ID.
For a full list of videos uploaded, as JSON, you can use contentDetails.relatedPlaylists.uploads (the ID of the playlist that contains the channel's uploaded videos) and retrieve the PlaylistItems, using pages with 50 items per page, and using the nextPageToken value to retrieve each page in the result set.
I've found the answer. The correct way to go about it is to query the site using the search, but directly state the type of list to respond with, in effect searching only channels. This is done by
https://www.googleapis.com/youtube/v3/search?q={search_term}&key={API_key}&type=channel&part=snippet
As you can see the type is channel. By searching with a search term of the exact channel username, you'll get a return list with the first item object as the channel, and you can store the channel ID and upload ID from there.
To update this answer, you need to recognise the "quota limits".
As such, to use the "search?q=[search]" will incur a 100 quota usage.
Better to use "channels?part=id&forUsername={username]" as is only a quota of 1.
Then you can use "channels?part=id,snippet ....... &id={channel_ID]" to grab all your data

Twitter Search API: Determining Conversations

Twitter's REST API returns a in_reply_to_status_id value for tweet statuses, yet the Search API does not.
What puzzles me is, if you search using the http://search.twitter.com/ webpage directly, tweets that are in reply to another tweet contain a "Show Conversation" link, but when searching using the API directly, there doesn't seem to be any data suggesting that a conversation exists (with JSON, at least).
How does this search page know which tweets are part of a conversation, and what would be the best way to emulate this behaviour (JSON preferred) in a rate-friendly way? I imagine I would have to do additional calls or something...?
related_results is officially dead along with the v1 API. It appears official Twitter apps use a call to /1.1/conversation/show.json?id=___ as mentioned here https://dev.twitter.com/discussions/17647 however it appears to be blocked from non-Twitter clients.
Just check the JSON field "to_user", which contains screen_name of the #replied person. If its null, you can assume its not a reply. You could also check, if the tweet string starts with a #username, which
http://search.twitter.com/search.json?q=%40aplusk
When you use the search.twitter.com, look for a field name in_reply_to_status_id This contains the original status_id to which this tweet was a reply. Next, there is a currently unsupported/undocument api call to get the whole conversation:
https://api.twitter.com/1/related_results/show/169145505824256000.json?include_entities=1
The value (169145505824256000) is the status_id you want to retrieve the conversation for.
An update on this as I was just faced with the same problem. The Twitter v1.1 API should now return valid in_reply_to_status_id values. But the unsupported v1 related_results has now gone forever.
You can see information about this, and some suggestions about using the streaming API, at https://dev.twitter.com/discussions/11292

Resources