As Twitter switched off version 1.0 of their API on June 2013. I have to rewrite code for fetching tweets containing a specific hashtag by using new v1.1 api which needs OAuth. So, I have used (. Receipts 1 6 3 – smart document collection jobs. Today, we’re excited to release the next version of the Twitter API, version 1.1.A few weeks ago, we outlined many of the v1.1 changes, and with today’s release, we’ve also updated the Developer Rules of the Road (see a summary of the most important policies here) and Developer Display Requirements. I know how to get tweets from a hashtag (Twitter request to get the latest tweets for a hashtag using Twitter API V1.1 using OAuth settings) But it appears that some tweets associated with a hashtag aren't retrieved, even with the parameter 'recent'. And if I tweet on #somethingforexample, there isn't a tweet with the api for that same hashtag. Fetch tweets from Twitter API v1.1 with PHP. Contribute to jabranr/twitter-api-v1.1 development by creating an account on GitHub. We would like to show you a description here but the site won’t allow us.
Standard v1.1 compared to Twitter API v2
If you have been working with the v1.1statuses/filter endpoint, this guide can help you understand the similarities and differences between the standard and Twitter API v2 filtered stream endpoints.
- Similarities
- Request parameters and operators
- Differences
- Endpoint URLs
- App and Project requirement
- Authentication method
- Rule volume and persistent stream
- Request parameters
- JSON format
- Query operators
Similarities
Request parameters and operators
The standard v1.1 statuses/filter endpoint features a few parameters that can be passed along with the request to filter the stream. With v2 recent search, you instead use a set of over 25 operators that can be connected together using boolean logic to filter for desired Tweets. The available operators include some that are direct replacements for the existing standard v1.1 parameters.
The following standard v1.1 request parameters have equivalent operators in Twitter API v2:
Standard | Twitter API v2 |
follow - A comma-separated list of user IDs, indicating the users whose Tweets should be delivered on the stream. | Many operators that can help you find Tweets related to specific users:
|
track - A comma-separated list of phrases which will be used to determine what Tweets will be delivered on the stream. | Many operators that can help you find Tweets related to specific keywords:
|
Differences
Endpoint URLs
- Standard v1.1 endpoints:
- https://stream.twitter.com/1.1/statuses/filter.json
- Twitter API v2 endpoint:
- https://api.twitter.com/2/tweets/search/stream
- https://api.twitter.com/2/tweets/search/stream/rule
![Tweetspro For Twitter V1 1 Tweetspro For Twitter V1 1](https://pbs.twimg.com/media/ETmE81OXkAEJzrQ.jpg)
App and Project requirements
The Twitter API v2 endpoints require that you use credentials from a developer App that is associated to a Project when authenticating your requests. All Twitter API v1.1 endpoints can use credentials from standalone Apps or Apps associated with a project.
Authentication method
The standard endpoint supports OAuth 1.0a User Context, whereas the new Twitter API v2 filtered stream endpoints supports OAuth 2.0 Bearer Token (also referred to as Application-only authentication). To make requests to the Twitter API v2 version you must use a Bearer Token to authenticate your requests.
If you no longer have the Bearer Token that was presented to you when you created your Project and app in the developer portal, you can generate a new one by navigating to your app's “Keys and tokens” page on the developer portal. If you’d like to generate a Bearer Token programmatically, see this OAuth 2.0 User Context guide.
Rule volume and persistent stream
The standard v1.1 endpoint supports a single rule to filter the streaming connection. To change the rule, you have to disconnect the stream and submit a new request with the revised filtering rules submitted as parameters.
The new Twitter API v2 filtered stream endpoint allows you to apply multiple rules to a single stream and add and remove rules to your stream while maintaining the stream connection.
Request parameters
One of the biggest differences between standard v1.1 and Twitter API v2 endpoint versions is how you select which fields return in your payload. For the standard endpoints, there are several parameters that you could use to identify which fields or sets of fields would return in the payload, while the Twitter API v2 version simplifies these different parameters into fields and expansions.
- fields: Twitter API v2 endpoints enable you to select which fields are provided in your payload. For example, Tweet, User, Media, Place, and Poll objects all have a list of fields that can be returned (or not).
- expansions: Used to expand the complementary objects referenced in Tweet JSON payloads. For example, all Retweets and Replies reference other Tweets. By setting `expansions=referenced_tweets.id`, these other Tweet objects are expanded according to the `tweet.fields` setting. Other objects such as users, polls, and media can be expanded.
You can learn more about how to use fields and expansions by visiting our guide, and by reading through our broader data dictionary.
There are also a set of standard Tweet lookup request parameters not supported in Twitter API v2:
Tweetspro For Twitter V1 11
Standard v1.1 parameter | Details |
---|---|
locations - A comma-separated list of longitude,latitude pairs specifying a set of bounding boxes to filter Tweets by. | We have not released location-based operators for Twitter API v2 yet. |
Delimited | With the v1.1 endpoint, setting this to the string length indicates that statuses should be delimited in the stream, so that clients know how many bytes to read before the end of the status message. This functionality is not available with Twitter API v2. |
Stall_warnings | With the v1.1 endpoint, setting this parameter to true will cause periodic messages to be delivered if the client is in danger of being disconnected. With Twitter API v2, stall warnings are sent by default with the new line sent every so often. |
New JSON format
Twitter API v2 is introducing new JSON designs for the objects returned by the APIs, including Tweet and user objects.
- At the JSON root level, the standard endpoints return Tweet objects in a statuses array, while Twitter API v2 returns a data array.
- Instead of referring to Retweeted and Quoted 'statuses', Twitter API v2 JSON refers to Retweeted and Quoted Tweets. Many legacy and deprecated fields, such as contributors and user.translator_type are being removed.
- Instead of using both favorites (in Tweet object) and favourites (in user object), Twitter API v2 uses the term like.
- Twitter is adopting the convention that JSON values with no value (for example, null) are not written to the payload. Tweet and user attributes are only included if they have non-null values.
In addition to the changes that we made to our new JSON format, we also introduced a new set of fields to the Tweet object including the following:
- conversation_id
- Two new annotations fields, including context and entities
- Several new metrics fields
New query operators
Twitter API v2 introduces new operators in support of two new features:
Tweetspro For Twitter V1 1st
- Conversation IDs - As conversations unfold on Twitter, a conservation ID will be available to mark Tweets that are part of the conversation. All Tweets in the conversation will have their conversation_id set to the Tweet ID that started it.
- conversation_id:
- Twitter Annotations provide contextual information about Tweets, and include entity and context annotations. Entities are comprised of people, places, products and organizations. Contexts are domains, or topics, that surfaced entities are a part of. For example, people mentioned in a Tweet may have a context that indicates whether they are an athlete, actor, or politician.
- context: - matches on Tweets that have been annotated with a context of interest.
- entity: - matches on Tweets that have been annotated with an entity of interest.
Tweetspro For Twitter V1 13
Standard APIs
Tweetspro For Twitter V1 101
Our free, standard APIs are great for getting started, testing an integration, validating a concept, or creating solutions that complement what you can create with premium and enterprise products. Examples include posting content to Twitter and retrieving similar data to what is on twitter.com and the Twitter mobile app.
Tweets | Post, retrieve, and engage with Tweets |
Get Tweet timelines | |
Curate a collection of Tweets | |
Search Tweets: 7 day* | |
Filter realtime Tweets | |
Sample realtime Tweets | |
Users | Manage account settings and profile |
Mute, block, and report users | |
Follow, search, and get users | |
Create and manage lists | |
User profile images and banners | |
Direct Messages | Sending and receiving events |
Welcome Messages | |
Message attachments | |
Quick Replies | |
Buttons | |
Typing indicator and read receipts | |
Conversation management | |
Custom profiles | |
Customer feedback cards | |
Media | Upload media |
Trends | Get trends near a location |
Get locations with trending topics | |
Geo | Get information about a place |
Get places near a location |
* Similar functionality included in other tiers.