Skip to content

Custom HTTP

The HTTP adapter connects to any JSON REST API. A mapping file tells VisiGrid how to extract the 9 canonical columns from each JSON response item.

No fixed authentication — configure the auth method that matches your API. Credentials are always resolved from environment variables, never inline.

Terminal window
vgrid fetch http \
--url https://api.example.com/v1/transactions \
--auth bearer-env:EXAMPLE_API_KEY \
--map mapping.json \
--from 2026-01-01 --to 2026-02-01 \
--out transactions.csv

Use --sample to inspect the raw API response before writing a mapping:

Terminal window
vgrid fetch http \
--url https://api.example.com/v1/transactions \
--auth bearer-env:EXAMPLE_API_KEY \
--from 2026-01-01 --to 2026-01-02 \
--sample
FlagDescriptionDefault
--urlAPI endpoint (HTTPS only)required
--authAuth methodnone
--mapPath to mapping JSONrequired
--from / --toDate range (YYYY-MM-DD)required
--outOutput CSV pathstdout
--samplePrint raw JSON response and exitoff
--save-rawSave raw JSON to file for auditoff
--timeoutRequest timeout in seconds15
--max-itemsSafety cap on total items10,000
--max-pagesSafety cap on pages fetched100
--fingerprintWrite signed request fingerprint JSONoff
-q / --quietSuppress progress messagesoff
MethodFlagExample
None--auth nonePublic APIs
Bearer token--auth bearer-env:VARbearer-env:FORTE_TOKEN
Custom header--auth header-env:NAME:VARheader-env:X-API-Key:MY_KEY
Basic auth--auth basic-env:USER:PASSbasic-env:API_USER:API_PASS

User-defined via the mapping file. Use map dictionaries with a * wildcard for unmapped values:

"type": { "path": "$.category", "map": { "payment": "charge", "refund": "refund", "*": "adjustment" } }

Dates are extracted from arbitrary fields via the columns section. The params section maps --from/--to to API query parameters with format options: iso (YYYY-MM-DD), unix_s, or unix_ms.

See vgrid fetch for the complete mapping file reference, including pagination configuration, transforms, value mapping, and request fingerprinting.

HTTPS enforced. HTTP URLs are rejected.

Response size cap. 10 MB per page.

Default sort. group_id, effective_date, source_id (overridable via sort_by in the mapping file).