How to get the twitter share count for a specific URL?

api

#1

I see API endpoint : http://cdn.api.twitter.com/1/urls/count.json?url=http://twittercommunity.com not work anymore to get the twitter share count for a specific URL?

It would be nice to grab that number to see how popular a url is. I’m attempting to do this through PHP. Any help is appreciated?


#2

Looks like it was closed down. Here’s an answer from Twitter.


#3

i see, maybe any function from new api realeased can do it.
but thanks ryanwi for information.


#4

The endpoint you were using was not a documented or supported feature.

There is no direct replacement.


#5

Hi,

I am Using Twitter search API.

endpoint : https://api.twitter.com/1.1/search/tweets.json?q={my_encoded_shortened_url}.

When I am using twitter search tool(https://twitter.com/search-home) to search any URL, it is searching and giving me matching tweets. But when I am making api call to above enpoint with bearer token. Its not giving me any results. And I made sure that the shared tweets are not 7 days older.

I have spent 3-4 days to figure out the solution but no luck so far. Please help.

Thanks


#6

Can you provide an exact example that is not providing matching Tweets on the API?


#7

Hi,

Thank you for your reply.

I am hitting below endpoint with bearer token.
endpoint: https://api.twitter.com/1.1/search/tweets.json?q=goo.gl%2FmuZavt

response:
{
“statuses”: [],
“search_metadata”: {
“completed_in”: 0.024,
“max_id”: 958372728960008192,
“max_id_str”: “958372728960008192”,
“query”: “goo.gl%2FmuZavt”,
“refresh_url”: “?since_id=958372728960008192&q=goo.gl%2FmuZavt&include_entities=1”,
“count”: 15,
“since_id”: 0,
“since_id_str”: “0”
}
}

And If you search from twitter search tool(https://twitter.com/search?src=typd&q=goo.gl%2FmuZavt), its showing the result.

Thanks.


#8

This appears to be a new account, no photo, very little legitimate content, and highly unlikely to be be indexed in the standard basic search API per https://developer.twitter.com/en/docs/tweets/search/overview/standard “relevance not completeness”.


#9

Thanks for the reply.

Yes, its a new account but i have verified my email address and phone number. Still, it’s not indexed. At some point in last week or the week before last week it was working fine, but now it’s not.

I have applied for enterprise level access but I haven’t gotten any reply yet. Will enterprise level APIs search for all the data(both indexed and non-indexed)?


#10

The premium and enterprise APIs work on a different index to standard search and I can confirm that the search term url:goo.gl/muZavt does return results from the premium 30-day search endpoint. The standard search index has always been optimised for recency rather than completeness and I’m unable to retrieve this particular URL Tweeted by that account from that endpoint.


#11

Thank you so much for your support.


#12

Hi,

Is there any way in the premium APIs to find tweets with multiple URLs?
For example url:goo.gl/muZavt1,url:goo.gl/muZavt2,url:goo.gl/muZavt3 etc or something like this; where I can pass multiple URL as query parameter and get list of tweets.

Thanks,


#13

Yep, it’s all based on how you create the rule:

{“query”:“url:goo.gl/muZavt1 OR url:goo.gl/muZavt2 OR url:goo.gl/muZavt3…”}
up to 256/1024 characters

More here