api - Official way to fetch the number of tweets for a URL -


twitter has private endpoints one:

http://urls.api.twitter.com/1/urls/count.json

tweet counts can fetched here, not recommended twitter. besides, keep saying gonna shut down these endpoints in near future.

the site streams api in closed beta, don't accept applications.

https://dev.twitter.com/streaming/sitestreams

so leaves 1 option, rest api, don't see endpoint there return number of tweets given url.

what's best way data? there "official" endpoint this?

or way use public stream api or rest api search endpoints , filter results?

the private endpoint shut down 20 nov , there'll nothing replace it. this blog post twitter explains background: apparently it's move new "real-time, multi-tenant distributed database" system codenamed manhattan.

the rest api of limited use purpose. you'd have search url, collect each page of results , add total number of tweets yourself. example request

https://api.twitter.com/1.1/search/tweets.json?q=metro.co.uk&count=100 

will tweets associated http://metro.co.uk. (it won't work if paste browser - have authenticate first. can try on twitter api console tool.) search api returns max of 100 tweets per page of results, , returns tweets last 7 days.

it seems solution (explained here) elaborate 1 using twitter streaming api. you'd have create own app count relevant tweets. open connection stream.twitter.com passing url track parameter. twitter return tweet every time tweets address, , app have count them. example given in post is:

curl -u user:password "https://stream.twitter.com/1/statuses/filter.json" -d "track=https%3a%2f%2fdev.twitter.com%2fdiscussions%2f5653" 

i'm not sure how deal shortened urls in scenario.

this change has meant third-party services sharedcount report count of twitter shares having stop offering data. sorry give bad news - i'm disappointed situation myself. seems crazy can't total of tweets given url.

you can find little bit more in this thread.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -