Search API for user Output differs from real time twitter search


#1

When I do search in Twitter with hashtag, the first four records that displays does not shows up when I hit the search with the twitter api.

The URL that twitter posts when I type #TBT is GET https://twitter.com/i/search/typeahead.json?count=10&filters=true&q=%23tbt&result_type=topics%2Cusers&src=SEARCH_BOX HTTP/1.1

When I use the Twitter API for search, https://api.twitter.com/1.1/users/search.json?q=%23TBT&count=5 , it displays the users, not the first four records.As the twitter API is specific to users it displays the users perfectly, what api call should I use to get the first four cached records ? or it is the limitation of the public API ?

When I tried to hit the twitter api with the url as same as twitter search, it returned me the forbidden exception,
"your credentials do not allow access to this resource twitter api "

I have to implement the autocomplete dropdown similar to the real time twitter search.


#2

Those first four entries are usually saved or recent searches. There’s no API to retrieve them.

That’s because that is not a public API endpoint.


#3

Thanks @andypiper