Events in Batch
Returns all upcoming events in your coverage, a batch at a time. Use it to sync a local copy of the catalog.
Parameters
next_cursorstringThe
next_cursorfrom your last response, exactly as you got it Default: Start.countintegerEvents per call, 1 to 1000. A larger value becomes 1000;
0, a negative or a non-whole number answers400. Default:1000.updated_afterUnix timestampOnly events updated after this time (compare
updated_at)min_scorenumberOnly events with at least this internal ranking score. The score itself isn't returned.
cachedbooleanfalsefetches fresh data. See Cached answers. Default:true.
How to sync
- Call without
next_cursor. - Save the
next_cursorfrom each response, and send it on the next call. - Stop when
messageisEND_OF_RESULTS(has_moreis thenfalse). That answer'snext_cursoris empty: keep the cursor you sent. - Later, call again with the last cursor you saved to pick up newly published events, and use
updated_afterfor changes.
next_cursor is an opaque string of about 50 characters (base64url). It changes on every response, even for the same position, so don't parse or compare it: store it and send it back untouched. Cursors from before 24 November 2026 (c<number>) answer 400 next_cursor is not valid.: start again without next_cursor.
A call can return fewer events than count, or none, while the cursor moves on. If result_count is 0 and message isn't END_OF_RESULTS, continue with the new cursor. With narrow coverage, message can be NO_COVERED_EVENTS_YET (error is 0): this stretch of the catalog had none of your events. It costs 0 credits; continue with next_cursor, which moves forward every time.
cursor=""while true; do body=$(curl -sf -G "$AE_BASE_URL/events/batch" \ -H "X-API-Key: $AE_API_KEY" \ --data-urlencode "next_cursor=$cursor" \ -d "count=1000") || exit 1 next=$(printf '%s' "$body" | jq -r '.next_cursor') [ -n "$next" ] && cursor=$next # empty at END_OF_RESULTS: keep the last one # save the event here printf '%s' "$body" | jq -r '.data[] | "\(.event_id) \(.eventname)"' if [ "$(printf '%s' "$body" | jq -r '.message')" = "END_OF_RESULTS" ]; then break # save cursor to continue from here next time fidoneErrors
| Status | message | Cause |
|---|---|---|
200 | END_OF_RESULTS | No more events for now. error is 1, data is empty, next_cursor is "" and description says to try again later. Retry later with the cursor you sent. |
200 | NO_COVERED_EVENTS_YET | None of this stretch of the catalog is in your coverage. data is empty and it costs 0 credits. Continue with next_cursor. |
400 | count must be between 1 and 1000. | count is 0, negative or not a whole number. 0 credits. Leave it out for 1000. |
400 | next_cursor is not valid. | The cursor isn't one this API returned, was changed, or is an old c<number> cursor. Start again without next_cursor. |
503 | Something went wrong. Try again shortly. | Temporary failure, 0 credits. Retry with the same cursor. |