Get Tweets with a Specific Hashtag, from any User
Your application needs to get data from Twitter ? Search Tweets by hashtag with Twitter API is possible via several ways.
1- How to search Tweets by hashtag with Twitter API or other API ?
A : With Twitter API
Search Tweets by hashtag with Twitter API may be done since 2018 via three new API levels.
- Standard search API : free and perfect for main API users with basic features and limited quantity data returned.
- Premium search API : paid services for advanced API users for whom standard search API doesn’t not give enough data.
- Enterprise search APIs : most complete services dedicated to data providers. Very expensive.
Standard search API is the most useful and widely consumed API for developpers, as its endpoints are enough for main projects requirements such as as hashtag or keyword search.
It requires authentication for all requests. Resource URL is https://api.twitter.com/1.1/search/tweets.json. Parameters are passed in the request. Most important are:
- q, which is a UTF-8, URL-encoded search query of 500 characters maximum, including operators. Queries may additionally be limited by complexity. For example @profilename.
- geocode, which returns tweets by users located within a given radius of the given latitude/longitude.
Advantages: free, direct access
Drawbacks: requires lots of integration time, code rewriting necessary in case of API update
B : With Providers
Search Tweets by hashtag outside Twitter API is also possible. Third party providers are good alternative to give access to a part of Twitter search API.
Usually, it requires to create an account and use the provider user interface to add Twitter sources, such as profile, keyword, location, hashtag…
Then, the provider API endpoints enable to retrieve the data.
Advantages: quick to use, user friendly
Drawbacks: not free, less consequences in case of API update
2- Dialogfeed Twitter API endpoints
A : If you need posts with a hashtag, keyword or profile
Dialogfeed can provide you with latest tweets.
For tag, our API aggregates latest tweets with a certain tag, keyword or users, with data such as content, likes count, picture, date, author… It is delivered a raw JSON or XML feeds for data consumption.
At first pull, time is limited to latest week and latest 20 tweets. After the API will get almost all tweets.
B : If you need posts from a location
Location is based on longitude, latitude and range.
Our API aggregates latest tweets with the given location.
Unfortunately, we estimate that only 10% of tweet do have a location shared by the author. 90% have null location, due to the fact that lots of Twitter users don’t want to be geolocalized.
C : List of Dialogfeed API endpoints
- Latest posts: get recent posts full data. Use this for hashtag search.
- Source profile: get profile data
- Tweet likes count update. Use this for hashtag top trend tweets identification.