Limits

Rate limits, size limits, counts, timeouts and lifetimes that apply to apps using the SDK, taken from the SDK and the server. Server numbers are defaults that can change.

Request rates

All of these count per app and person: two people using your app do not share a budget, and your app does not share one with another app. A 429 carries Retry-After (seconds) and becomes RateLimited with retryAfterSeconds.

WhatLimitWindow
Every call of the REST API120 requests1 minute
Publishing posts (createPost)10 posts10 minutes
Publishing posts, in total100 posts1 day

Every answer also carries X-RateLimit-Limit and X-RateLimit-Remaining for the 120-requests-per-minute budget.

Write actions

On top of the budgets above, actions that change things have their own limits. Each kind has a short window and a daily total.

KindShort windowPer dayCovers, for example
Reactions60 per minute2,000Likes and unlikes, the bell on a post, installing sticker packs, "not interested"
Comments20 per 10 minutes200Writing and editing comments
Follows30 per 10 minutes300Following and unfollowing, the profile bell, follow requests, removing a follower
Safety30 per 10 minutes200Blocking, muting, reports
Profile10 per hour30Editing the profile, removing the banner
Settings30 per 10 minutes300Changing settings, muted keywords

The exact set of calls under each kind can change.

Lookups

Calls that ask an outside provider have a small budget of their own, per minute:

CallLimitWindow
Search301 minute
Places search201 minute
GIF search301 minute
Sticker packs301 minute

Per address

These limits count per IP address, not per person. Many people behind one address (an office, a mobile network) share them.

WhatLimitWindow
The REST API (read limiter)10,000 requests15 minutes
The sign-in token endpoint (/oidc/token, including token introspection)600 requests15 minutes
The authorization endpoint (/oidc/auth)600 requests15 minutes
The sign-in pages300 requests15 minutes
Password, key and 2FA steps on the sign-in page50 attempts15 minutes

Use retries to let the SDK wait out a 429 for you, and cache what you can. A server that verifies tokens with verifyAccessToken should cache the answer for a short while rather than ask for every request, because each check is a request to the token endpoint.

Sizes

WhatLimit
A whole upload request (createPost with media)250 MB
A profile picture or banner10 MB
A JSON request body10 MB
Pictures in one post10
Pictures in one comment3
A comment2,000 characters
Links on a profile5

A picture that is too large is answered with payload_too_large (413). Everything uploaded passes the same scans, size limits and moderation as in the UNET apps. See Media.

Counts

WhatLimit
Pinned posts3 by default (pin_limit_reached beyond that, with the limit in the answer)
Comment edit window30 minutes after posting
Posts watched by one realtime stream12
Realtime streams per person, app and kind3 (a new one replaces the oldest)

Page sizes

Lists take a limit, and the server keeps it between a minimum and a maximum. A few that are fixed in the server:

ListDefaultRange
postLikes, postReposts, commentLikes, commentReposts301 to 100
placePosts201 to 30
hashtagPosts, topicPosts201 to 30
mutualConnections301 to 50
notInterestedItems501 to 100

For the others, ask for what you show, and use paginate() or the cursor or offset in each answer. See Calling the API.

Timeouts and times

In the SDK

WhatValue
A JSON request (timeoutMs)60 seconds. Uploads, media downloads and realtime streams have none.
Renewing the access tokenA minute before it ends
A pending sign-in15 minutes
The cached discovery document1 hour
The cached signing keys (verifyIdToken)10 minutes; an unknown key id triggers at most one new fetch every 30 seconds
Clock difference accepted by verifyIdToken60 seconds
Longest access token the server-side check accepts2,048 characters
Longest ID token verifyIdToken accepts8,192 characters

On the server

WhatDefault
Authorization code10 minutes
Access token1 hour
ID token1 hour
Refresh token60 days, renewed each time it is used
The person's permission for your app (the grant)180 days
The person's browser session on UNET14 days
Reuse window for a just-used refresh token60 seconds

See Tokens for what these mean.

Realtime

WhatValue
A stream's lifetime50 minutes, then the server ends it and the SDK reconnects at once
A keep-alive commentEvery 20 seconds
Waiting before a reconnect1 second, doubling to 30 seconds (minDelayMs, maxDelayMs)
Streams in total, on the server5,000