Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

any way to count twitter tweets of a particular user using Twitter API?

Tags:

php

twitter

api

Does any one have any Idea or methods or codes(PHP) to find number of tweets for a particular user using twitter API?

like image 816
aron n Avatar asked Feb 02 '11 15:02

aron n


People also ask

How do you see how many Tweets someone has on Twitter?

If you click on “Tweets” at the top of the page, you'll be able to see how many Tweets you sent out each month day and how many views, engagements and clicks you got. You can click on the 'choose date' button, on the right of the page, to choose the time period you want to see your most popular Tweets from.


1 Answers

There is a way, you need to use the users/show resource,
you can find the documentation here and here's an output example

more precisely, you're looking for statuses_count


Here's a truncated output taken from the documentation page

{
"name": "Twitter API",
"profile_sidebar_border_color": "87bc44",
"profile_background_tile": false,
"profile_sidebar_fill_color": "e0ff92",
"location": "San Francisco, CA",
"profile_image_url": "http://a3.twimg.com/profile_images/689684365/api_normal.png",
"created_at": "Wed May 23 06:01:13 +0000 2007",
"profile_link_color": "0000ff",
"favourites_count": 2,
"url": "http://apiwiki.twitter.com",
"contributors_enabled": true,
"utc_offset": -28800,
"id": 6253282,
"profile_use_background_image": true,
"profile_text_color": "000000",
"protected": false,
"followers_count": 160752,
"lang": "en",
"verified": true,
"profile_background_color": "c1dfee",
"geo_enabled": true,
"notifications": false,
"description": "The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",
"time_zone": "Pacific Time (US & Canada)",
"friends_count": 19,
"statuses_count": 1858,
[...]
like image 167
Serge Avatar answered Nov 07 '22 05:11

Serge