Hello Guy's I'm trying to count all of the tweets from a Twitter search API response, anyone got any ideas?
Everything I tried doesn't seem to work, I'm doing everything with jSON so my best guess is get the max_id and subtract the id from the first item in the object. But I think that's not giving me a correct number.
I'm guessing you can't do that: the twitter api docs don't show anything and you can see Count number of results for a particular word on Twitter for more detail.
Related
In the Twitter REST API, is it possible to find the reply count? I see retweet_count and favorite_count. However, I'd like to get the reply count, which you can see in any of the GUIs next to the text bubble icon (see below on the left).
As far as I can tell, there's no direct way to get this data point; one would have to do two or more api hits to collect that count. Am I missing something?
The twitter API doesn't provide a field for reply count but there are work arounds which can help.
But there are few points which are very tricky as each reply even by the same person is counted (much like a dialogue) handling that to count it once is a tricky task.
you can find further details here
Check this link : https://developer.twitter.com/en/docs/twitter-api/metrics
data.public_metrics.reply_count
A count of how many times the Tweet has been replied to.
Using the public_metrics field, this will return the total count of replies from both organic and paid contexts, in order to maintain consistency with the counts shown publicly on Twitter.
data.organic_metrics.reply_count
Using the organic_metrics field, this returns the total count of replies from organic contexts.
data.promoted_metrics.reply_count
Using the promoted_metrics field, this returns the total count of replies from paid contexts.
I've tried querying the Picasa WEb Albums API for an account that for sure contains more than 2400 public albums, but only returns 1000 results.
I know I must use the parameters start-index and max-results in the query and cycle for every 1000 results, but this doesn't produce the desired list.
I've also found that the returned data contains a of only 1000 albums despite the fact that I KNOW I have 2400.
Any ideas, please help?
UPDATE: Found this related answer, which says maximum results by API cannot exceed 1000. If it is correct can you suggest a workaround?
How am I supposed to get a list of ALL my albums?
'startindex' and 'maxresults' listed below in connection to Youtube api should have analogs for the picasa/google+ (photos) aspect. Check the api details in order to get parm names so you can set them in your data calls.
youtube example
I am also running into this same issue. Except I am trying to list photos instead of albums. If you figured out a work around I would love to see it.
I'm trying to get one good photo result on the Foursquare API which are representative of a venue.
Currently I'm using:
https://api.foursquare.com/v2/venues/VENUE_ID/photos?group=venue&limit=1
This works, but it appears that the photo filtered is always the most recently added photo for that venue, which is not necessarily always the best. There also doesn't seem to be anyway to any sort differently (by rating etc.). I would prefer that the photo that appears be always the first photo result on the foursquare website for the venue, whatever that may be.
I was playing around with the suffix, and I found that if instead of
photos?group=venue&limit=1
I just put
photos?&limit=1
I would get the results I am looking for (the first photo that appears on the website for that venue). However, on the documentation it says that having a group value is required. Obviously, I don't want to set behavior based on a bug, but it works.
So, is it a bug? Or is it just a problem with the documentation that says group is required. Any help would be appreciated.
Thanks!
That's probably a bug you're encountering, but to get the first photo on the venue page, you can query the venues detail endpoint and then use the photo object in the venue result: https://developer.foursquare.com/docs/explore#req=venues/40a55d80f964a52020f31ee3
I want to use twitter api to grab the number of twitter followers I have and logs that information. How can I do that?
Check out twitters REST API documentation -- it's generally quite good.
In your case, what you want to do to start is
GET /followers/ids.json?screen_name=<your screen name goes here>&cursor=-1
This will return a JSON document with the first 5000 followers in it. You can count the number of items in the 'ids' array. If there are more pages of results, the 'next_cursor' key will be non-zero. If so, use that as the 'cursor' argument and call the API again. Repeat until you have found all of the followers.
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/