Bahasa Indonesia
Get an API key

Concepts

Rate limits

How many calls you can make, and what happens when you reach the limit.

Limits per key

LimitValue
Per minute60 calls
Per day5,000 calls, resets at 00:00 Western Indonesia Time (UTC+7)
Rows per page100
Reports30 files per day, the same request within 60 minutes is not counted

Checking your quota

Usage per day, per key, and per endpoint is in the Wefluence app, under Settings, then API key.

Every response carries these headers:

HeaderContents
X-RateLimit-LimitLimit per minute
X-RateLimit-RemainingCalls left this minute
X-RateLimit-ResetReset time, in Unix seconds
X-Daily-LimitLimit per day
X-Daily-RemainingCalls left today

When you hit the limit

The API answers 429 with a Retry-After header in seconds. Wait that long before trying again.

Python
import time

r = requests.get(url, headers=headers)
if r.status_code == 429:
    time.sleep(int(r.headers.get("Retry-After", "60")))

Saving calls

  • Pull only active campaigns. A finished campaign only needs one more pull after it ends.
  • Need all content at once? A report costs one call, however much content there is.
  • Need only the best content? Top content costs one call.
  • Stats are cached for up to 60 minutes, or 24 hours for finished campaigns. Calling more often does not make the numbers fresher.
  • Send If-None-Match with the last ETag to Campaign stats. The API answers 304 with no body when nothing has changed.