PubNub API

PubNub provides a globally distributed publish/subscribe API for real-time data streaming, presence detection, message persistence, and push notification delivery across web, mobile, and IoT devices — accessible via REST and WebSocket.

Evaluated Mar 06, 2026 (0d ago) vcurrent
Homepage ↗ Communication pubnub realtime pub-sub websocket presence streaming iot push-notifications
⚙ Agent Friendliness
60
/ 100
Can an agent use this?
🔒 Security
86
/ 100
Is it safe for agents?
⚡ Reliability
87
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
85
Error Messages
80
Auth Simplicity
78
Rate Limits
75

🔒 Security

TLS Enforcement
100
Auth Strength
82
Scope Granularity
85
Dep. Hygiene
82
Secret Handling
82

PubNub Access Manager provides channel-level and user-level permissions with signed tokens. Secret key must be kept server-side only. TLS is enforced for all API connections. Cipher-key based AES-256 message encryption is available client-side for end-to-end encrypted channels.

⚡ Reliability

Uptime/SLA
95
Version Stability
85
Breaking Changes
83
Error Recovery
85
AF Security Reliability

Best When

An agent needs to broadcast real-time events to many connected clients simultaneously, or ingest live data streams from distributed sources like IoT devices or user activity feeds.

Avoid When

You need guaranteed exactly-once delivery, message ordering across channels, or processing backpressure — PubNub's at-least-once semantics and lack of consumer group coordination make these difficult.

Use Cases

  • Publish real-time status updates or events to subscribed clients from an agent processing backend events
  • Subscribe to channels to receive live data streams (IoT sensor readings, user activity events) for agent processing
  • Query message history from a channel to reconstruct state or catch up on missed events after an agent restart
  • Use presence APIs to determine which users or devices are currently connected before sending targeted messages
  • Send mobile push notifications (APNs, FCM) via PubNub's push gateway as part of a multi-channel notification workflow

Not For

  • Persistent message queue semantics with consumer groups and guaranteed delivery — PubNub is a pub/sub bus, not a durable message queue
  • Large payload transfer — PubNub messages are limited to 32KB; use object storage for large data with PubNub signaling the availability
  • Complex stream processing, aggregation, or windowing — a dedicated stream processor (Kafka Streams, Flink) is more appropriate for analytics pipelines

Interface

REST API
Yes
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
Yes

Authentication

Methods: publish-subscribe-key-pair access-manager-token
OAuth: No Scopes: Yes

All API calls require a publish key and subscribe key pair issued per application. PubNub Access Manager (PAM) provides token-based fine-grained permissions on channels and user IDs with TTL. Subscribe-only operations use the subscribe key alone. REST calls include keys as query parameters.

Pricing

Model: freemium
Free tier: Yes
Requires CC: No

Free Sandbox plan is suitable for development and small-scale production. Pricing scales with transaction volume; presence and persistence add-ons cost extra on paid plans.

Agent Metadata

Pagination
token
Idempotent
Partial
Retry Guidance
Documented

Known Gotchas

  • Publish and subscribe keys are different — using the wrong key for an operation (e.g., using subscribe key to publish) returns a non-obvious auth error
  • PubNub Access Manager tokens must be generated server-side and refreshed before TTL expiry — clients with expired tokens are silently disconnected from protected channels
  • Message history requires the Storage and Playback add-on to be enabled per key set in the dashboard — history queries on keys without persistence return empty results without a clear error
  • The REST subscribe API uses long-polling by default (not WebSocket) — agents using the REST API will hold connections open for up to 5 minutes; SDK-based subscriptions use WebSocket automatically
  • Channel group limits (2000 channels per group, 10 groups per subscribe) can be hit by agents managing many data streams; exceeding limits causes silent filtering of channel events

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for PubNub API.

$99

Scores are editorial opinions as of 2026-03-06.

5173
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered