Using the latest Twitter API is there a way to get your followers handles? I don't know the correct term for this but I am referring to their name with that # symbol. For example: #MyTwitterHandle
The code I am looking for would do this.
///Necessary Twitter Code
Outputs:
Your followers are:
1. #IFollowYou
2. #MyTwitterHandle
etc...
35k more followers etc...
The most efficient way to do it is a two-step process:
Get all user IDs with followers/ids. This lets you get 5000 at a time.
Perform a users/lookup, which will give you the screen_name. This gives you 180 requests every 15 minutes for 100 users at a time.
This will take you about a half hour if everything is working well. The alternative, using followers/list, will take you over 3 hours because you only get 200 users in a 30 minute window (for app-only auth).
Related
I'm having a bit of trouble with a GMail API implementation. I'm running a query that is returning only a partial data set of emails. (This is the first time that I am retrieving emails for this account, so I want to retrieve some deeper historic records as a base, before moving forward with a daily increment retrieval.)
I am using the 'after' operator, and using the Unix Epoch seconds as the value.
When I enter the same "after:" search into the Search bar on the Google website for this account, I get 598 emails (for 60 days back), and 292 emails (for 30 days back). When I use the API, I only get 103 (and this is after letting it paginate over all the results; the initial 'page' is only 100 email IDs; the 2nd Page then has 3.)
Here are a couple of the query URLs that I am hitting:
https://content.googleapis.com/gmail/v1/users/me/messages?q=after%3A1619045685
https://content.googleapis.com/gmail/v1/users/me/messages?q=after%3A1616453916
Any ideas? Is there an internal limit that I'm hitting? Is there some setting that I haven't set?
Thanks.
We are using Linkedin REST API and we need to get the number of likes and comments from owned companies updates. The method get-updates always returns the last 3 likes/comments and also the total is 3, even if you have more than 3. So in order to get all the likes/comments of the updates we have to make a query to each update because that way we get all the likes/comments. But this is not a good method because if I have 100 updates then I have to do 101 api calls and a user has a limit of 700 per day, so they are very easily get depleted. We really find it hard to believe there is no way your API doesn't solve the n+1 problem. So how can it be done?
Thank you!
if you hit this URL -> "https://api.linkedin.com/v1/companies/{id}/company-statistics", provided if you have the id of the company page.
you can get the likes,clicks,impressions,engagement,shares,comments in month break up wise.
For more info
LinkedIn API Company statistics data
I'm having this use case I'm not figuring out by the soundcloud documentation page: I fetch the last 10 most recent tracks. In 2 hours, I want to see if there are new tracks. So technically, I want to ask "give me the tracks with created_at greater than the created_at of my last fetched track". How can I do that using the current Soundcloud API spec?
You can send created_at[from] parameter in the request which will allow you to set a minimum creation date for your query.
For example
/users/x/tracks.json?created_at[from]=2012-11-01%2016%3A02%3A00
For more info check the filters heading underneath each resource :)
I've been poring over the Twitter docs for some time now, and I've hit a wall how to get stats for growth of followers over a period of time / count of tweets over a period of time...
I want to understand from the community what does since_id and max_id and count mean in the Twitter API.
I've been following this page https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline
I'm trying to get stats for a user --
counts of tweets in a particular time period
count of followers over a particular time period
count of retweets
I'd like some help forming querystrings for the above..
Thanks..
since_id and max_id are both very simple parameters you can use to limit what you get back from the API. From the docs:
since_id - Returns results with an
ID greater than (that is, more recent
than) the specified ID. There are
limits to the number of Tweets which
can be accessed through the API. If
the limit of Tweets has occured since
the since_id, the since_id will be
forced to the oldest ID available.
max_id - Returns results with an ID
less than (that is, older than) or
equal to the specified ID.
So, if you have a given tweet ID, you can search for older or newer tweets by using these two parameters.
count is even simpler -- it specifies a maximum number of tweets you want to get back, up to 200.
Unfortunately the API will not give you back exactly what you want -- you cannot specify a date/time when querying user_timeline -- although you can specify one when using the search API. Anyway, if you need to use user_timeline, then you will need to poll the API, gathering up tweets, figuring out if they match the parameters you desire, and then calculating your stats accordingly.
The max_id = top of tweets id list .
since_id = bottom of tweets id list .
for more : get a deep look in the last diagram .. here
The max_id and since_id are used to prevent redundancy in the case of Twitter API calls. Visualize the tweets coming in as piling onto a stack. One API call has to specify how many (count) tweets will be processed. But as this call is made, new tweets may be added. In that case, if you draw out a stack and run through the process, you notice that there can be some 'fragmentation' or sections of unprocessed tweets stuck in between processed ones. This is visible in below image as well.
To get around this problem, two parameters are used to keep track of the latest/greatest ID tweet previously processed (since_id) and the oldest/lowest ID tweet recently processed (max_id). The since_id points to the bottom of the 'fragment' and the (max_id-1) points to the top of the 'fragment'. (Note that the max_id is inclusive unlike the since_id)
So, the parameters together keep track of which part of the tweet stack still needs to be processed.
I've been doing some research into using the Twitter API, and I'm not sure if I'm understanding it correctly. I want to get tweets from a specific user for a specific time-frame. From what I can tell, using the search function to specify a date range doesn't work because only the last 7 days are kept. I could just get the tweets and work out the date range with JavaScript, but the documentation states the the max you can get is 200 tweets, so if the tweets from the date range I want aren't in the last 200 I can't do it.
Is there anyway I can do this?
You can use the page=n URL argument to go back through the previous pages of 200 status updates.
as described here:
http://dev.twitter.com/doc/get/statuses/user_timeline