Get A Users Over All Retweet and Mention Counts using Twitter API - api

We are working on some analytics using the amount a user is retweeted or mentioned... I can't seem to find a way to get these numbers using the apis does anyone have any ideas?

https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name={screen_name}&count={count}
it's important to include the line include_entities=true to the request. This will give you an expanded response including re-tweet and mention counts.
Get Status / User Timeline
Twitter API Console
Update:
to get tweets from the last 90 days, there is a Node.js library you can use called Snapbird
https://github.com/remy/snapbird
.. and here is another resource covering the same topic.
http://blog.tweetsmarter.com/twitter-search/10-ways-and-20-features-for-searching-old-tweets/

Related

Soundcloud API: Find track like date via API

I've tried searching through Stack overflow as well as the soundcloud API reference but couldn't find any answer. I'm trying to retrieve the date a user liked a song on Soundcloud. I tried two parts of the API:
- /users/{id}/favorites: This will return all tracks liked by the user, but no date when it was liked.
- /me/activities: This returns track reposts, comments and seemingly tracks that show up on the stream. Sadly there doesn't seem to be a type track-like, but maybe I'm doing something wrong here or need to pass additional parameters.
I'm having the user log into Soundcloud before utilizing the API.
Any chance someone knows if retrieving the track like date via the API is possible?
Thanks!
With the public API available right now, this is not possible.
You have to build it on your own and track the changes in a different, your own database.
Example call from the website when you lookup your likes, i dont know what you will see with a pro account:
https://api-v2.soundcloud.com/users/soundcloud:users:1672444/stats/timeseries/likes?from=1442016000000&to=1442534400000&resolution=day&tracks=soundcloud%3Atracks%3A30984358&client_id=02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea&app_version=39e9f65
Response:
[{"user_urn":"soundcloud:users:1672444","timeseries":[{"time":1442016000000,"count":1},{"time":1442534400000,"count":1}]},{"user_urn":"soundcloud:users:1672444","track_urn":"soundcloud:tracks:30984358","timeseries":[{"time":1442016000000,"count":1},{"time":1442534400000,"count":1}]}]
Here is and older, related answer about playback stats:
How to fetch playback statistics

What is the maximum results returned for YouTube Data API v3 call

Context
I am in the process of providing some consultancy on doing a HTTP GET using YouTube Data API V3; in order to develop a Windows based application to GET a list of results from Youtube, for say a specific CATEGORY, or a specific TAG.
We are open to using any programming language(I'm from a C++ background and am hoping You tube will support direct HTTP connections without using Google client SDK and so on) to connect to YouTube and (HTTP) GET data.(Once a month or so, so YouTube API quotas should not be problem).
The Issue
We are being told by some of my client's web developers that YouTube API v3 will only return a maximum of 500 records/results, for say a query that returns JUST the Total viewers, the Video's link, and basic meta data such as that.
S, say I wish to find 5,000 results for category "House music" or "basketball" - and I have the Developer Key etc are all set up, would that be possible?
If so, what GET fields would I need to populate(such as "max_results_per_page")?
Thank you.
The API won't provide more than ~500 search results for any arbitrary query. It's by design. Technically, it means that the nextPageToken field won't be returned once you hit ~500 results. No additional parameter can change that.
If you want more than ~500 results for a query, you have to split it into more specific sub-queries. I'd suggest using the publishedAfter and publishedBefore parameters to achieve that, but feel free to experiment with the other ones here.
This only holds for the search-Query. Other queries like "PlaylisItem:list" deliver more results. I have tested with 100.000 items to get the videos of a playlist.

count how many times URL was shared in twitter

Is it possible to count how many times some URL was twitted in some period of time?
You can use the Twitter Search API and search for URL's, then examine the Tweet objects to find the ones in your date range. Use the GET search/tweets call. This is limited to the past 6-7 days in their index.
You can also write an app to watch the Twitter stream for the URL over a period of time, then count the occurrences. This can be done using the Twitter Streaming API using the POST statuses/filter call. Specify the string you are watching for and matching results will stream.
In Ruby, for example, you can do this using the Twitter Gem. It's best to search for known URL-shortened versions as well as the full URL. You can control this somewhat by registering the URL with several known URL shorteners in advance, so you know what to watch for.

How to retrieve all tweets from a user and not just the first 3,200 as Twitter limits it’s timeline and API to

With https://dev.twitter.com/docs/api/1/get/statuses/user_timeline I can get 3,200 most recent tweets. However, certain sites like http://www.mytweet16.com/ seems to bypass the limit, and my browse through the API documentation could not find anything.
How do they do it, or is there another API that doesn't have the limit?
You can use twitter search page to bypass 3,200 limit. However you have to scroll down many times in the search results page. For example, I searched tweets from #beyinsiz_adam. This is the link of search results:
https://twitter.com/search?q=from%3Abeyinsiz_adam&src=typd&f=realtime
Now in order to scroll down many times, you can use the following javascript code.
var myVar=setInterval(function(){myTimer()},1000);
function myTimer() {
window.scrollTo(0,document.body.scrollHeight);
}
Just run it in the FireBug console. And wait some time to load all tweets.
The only way to see more is to start saving them before the user's tweet count hits 3200. Services which show more than 3200 tweets have saved them in their own dbs. There's currently no way to get more than that through any Twitter API.
http://www.quora.com/Is-there-a-way-to-get-more-than-3200-tweets-from-a-twitter-user-using-Twitters-API-or-scraping
https://dev.twitter.com/discussions/276
Note from that second link: "…the 3,200 limit is for browsing the timeline only. Tweets can always be requested by their ID using the GET statuses/show/:id method."
I've been in this (Twitter) industry for a long time and witnessed lots of changes in Twitter API and documentation. I would like to clarify one thing to you. There is no way to surpass 3200 tweets limit. Twitter doesn't provide this data even in its new premium API.
The only way someone can surpass this limit is by saving the tweets of an individual Twitter user.
There are tools available which claim to have a wide database and provide more than 3200 tweets. Few of them are followersanalysis.com, keyhole.co which I know of.
You can use a tool I wrote that bypasses the limit.
It saves the Tweets in a JSON format.
https://github.com/pauldotknopf/twitter-dump
You can use a Python library snscrape to do it. Or you can use ExportData tool to get all tweets for the user, which returns already preprocessed CSV and spreadsheet files. The first option is free, but has less information and requires more manual work.

No results for a specific user in Twitter search API

For some reason, when searching on one specific Twitter user, the search API return nothing. (ie http://search.twitter.com/search.atom?q=+from%3ATWITTERHANDLE_A) TWITTERHANDLE_A here is the Twitter account name. This user has been active for over a month, has had many RTs, #s and has sent such tweets out as well.
Meanwhile, I created a new Twitter account - we will call it TWITTERHANDLE_B. Immediately after I created the account, I sent 1 tweet and performed the same search as above (http://search.twitter.com/search.atom?q=+from%3ATWITTERHANDLE_B)
The tweet was returned.
Is there ANYWAY to find out if and/or why a particular user would be blocked from search results? Thanks so much for any help... I'm going crazy here. Twitter's documentation just says sometimes a user's tweets won't be searched!
The documentation you refer to has a link to this page:
http://support.twitter.com/forums/10713/entries/42646
The bottom entry addresses your issue, hopefully you can fix it that way.
Bear in mind the search API only grabs results from the last couple of weeks, so if the user hasn't tweeted in a while then there won't be any results.
You could try not using the Search API and grab the results directly:
http://twitter.com/statuses/user_timeline/-username-.json
Works fine for http requests at least... >_<