Newer Version Available

This content describes an older version of this product. View Latest

Getting Started with Streaming API

Streaming API enables streaming of events using push technology and provides a subscription mechanism for receiving events in near real time. The Streaming API subscription mechanism supports multiple types of events, including PushTopic events, generic events, platform events, and change data capture events.

If you're writing an app for publishing and subscribing to platform events and change data capture events, we recommend you use Pub/Sub API instead of Streaming API. Pub/Sub API is a newer API. Based on gRPC API and HTTP/2, Pub/Sub API efficiently publishes and delivers binary event messages.

Important

Consider these applications for Streaming API.

Applications That Poll Frequently
Applications that have constant polling action against the Salesforce infrastructure consume unnecessary API calls and processing time. They can benefit from Streaming API because it reduces the number of requests that return no data.
General Notification
Applications that require general notification of data changes in an org. By using Streaming API, these applications can reduce the number of API calls and improve performance.

You can use Streaming API with any Salesforce org as long as you enable the API. To ensure continuity during instance refreshes and org migrations, we recommend using your org’s My Domain login URL instead of its instance in the Streaming API endpoint.

Note