Skip to main content

API Source

The api source type polls any HTTP endpoint on a configurable interval, diffs the response against previously stored state in SQLite, and emits only the changes as standard pipeline messages. Any request/response API becomes a real-time event stream — no webhooks, no changes to the upstream system, no event infrastructure required.

Quick Start

Poll an OpenWeatherMap endpoint every 30 seconds and emit changes:
Three fields are required: url, interval, and key_path. Everything else has a sensible default.

Config Reference

Source-Level Fields

api Block Fields

Core

Watermark Block

Controls incremental polling — how the source avoids re-fetching data it has already seen.

Pagination Block


Watermark Strategies

Full-scan on every poll. Diffs against stored state. Simple and correct for any API.Best for: small result sets, APIs with no filtering support.

Pagination Strategies


Change Detection Modes

diff (default)

Field-level comparison. Emits records annotated with _change metadata:

hash

SHA-256 hash of the full payload. If the hash changes, the record is emitted. No field-level metadata. Lower CPU overhead for large payloads.

Cookbook Examples

GitHub Pull Requests

Poll open PRs with Link header pagination and ETag caching:

Stripe Charges

Cursor-based pagination and watermark:

Jira Issues

Timestamp watermark with offset pagination:

Operational Guidance

Choosing a Poll Interval

Rate Limiting

LiteJoin handles rate limiting automatically:
  • 429 Too Many Requests — retried with Retry-After header delay
  • X-RateLimit-Remaining: 0 — pauses until reset
  • 5xx errors — retried with exponential backoff (max 3 retries)
  • 4xx errors (except 429) — not retried (configuration problem)

Environment Variables

Header values and URLs support ${ENV_VAR} expansion:

gjson Paths

All path fields use gjson syntax: