As part of current caching system, we are trying to fetch twitter share count for our site url using “https://cdn.api.twitter.com/1/urls/count.json?url=” . We call this API from Spring Java Rest Controller and store the count into our system to show it for next few minutes. This Api works fine for few attempts for the same url. But many time this is throwing timeout exception even after retrial.
We tried to run curl command on above API for same url and we see the same behavior. Do we know, why it is happening. Does twitter blocks server Ip address if many requests comes from same server. Is it the right API to get count for a url or do we need to use different API.
Any help in this regard will be great.