Custom REST Connectors
Connect any REST API endpoint by creating a local YAML config. Data is fetched via dlt (handles auth, pagination) and cached as JSON files that DuckDB queries via read_json_auto().
Use this when Dinobase doesn’t ship a built-in connector for the service you need — any REST API with JSON responses works.
Quick start
Section titled “Quick start”# Scaffold a connectordinobase connector create posthog_flags \ --url "https://app.posthog.com/api/" \ --endpoint "projects/123/feature_flags/" \ --data-selector results
# Add credentialsdinobase add posthog_flags --api-key phx_xxx
# Query (auto-fetches on first access in live mode)dinobase query "SELECT name, active FROM posthog_flags.feature_flags"Connector YAML format
Section titled “Connector YAML format”Configs live at ~/.dinobase/connectors/<name>.yaml and use the same format as built-in connectors:
name: posthog_flagsdescription: "PostHog feature flags"mode: live # live | sync | auto
credentials: - name: api_key flag: "--api-key" env: POSTHOG_API_KEY secret: true
client: base_url: "https://app.posthog.com/api/" auth: type: bearer token: "{api_key}" paginator: type: json_link next_url_path: "next"
resource_defaults: primary_key: id endpoint: data_selector: "results"
resources: - name: feature_flags endpoint: path: projects/12345/feature_flags/Authentication types
Section titled “Authentication types”| Type | Description |
|---|---|
bearer | Authorization: Bearer {token} header |
http_basic | HTTP Basic auth with username/password |
api_key_header | Custom header (e.g., X-API-Key: {key}) |
Set the --auth-type flag on dinobase connector create or edit the client.auth.type field in the YAML.
Fetch modes
Section titled “Fetch modes”| Mode | Behavior |
|---|---|
live | Auto-fetches when queried and data is missing or stale |
sync | Only fetches on dinobase sync or dinobase refresh |
auto (default) | live if no paginator, sync if paginator is defined |
Managing connectors
Section titled “Managing connectors”dinobase connector list --pretty # List all local connectorsdinobase connector validate my_api # Check YAML for errorsdinobase connector edit my_api # Open in $EDITORdinobase refresh my_api # Re-fetch dataSee also
Section titled “See also”- Connectors guide — overview of all connector types
- CLI reference for
connector create— all flags - MCP server connectors — for MCP-based tools instead of REST APIs