Guide

Turn JSON, JSONL, or CSV into an API for AI agents

You have JSON, JSONL, or CSV and you want it accessible to AI agents as an API. Instadash turns any structured file into a hosted grid with a JSON API, search index, and MCP endpoint — one CLI push command, no server to deploy.

The transformation

file (JSON/JSONL/CSV)
  →  npx instadash push
  →  hosted grid at https://instadash.io/<handle>/<slug>
  →  agent reads via /rows, /llms.md, or MCP

No web framework, no database, no auth code. The file is the input; the grid is the API.

Push patterns by source format

JSON array

cat data.json | npx instadash push \
  --key "$INSTADASH_API_KEY" \
  --name my-grid

Each element becomes a row. Object keys become columns.

JSONL (one row per line)

npx instadash push \
  --key "$INSTADASH_API_KEY" \
  --name my-grid \
  --file events.jsonl

Streams memory-flat — fine for files larger than RAM.

CSV

npx instadash push \
  --key "$INSTADASH_API_KEY" \
  --name my-grid \
  --file customers.csv

Headers map to column names. Type inference treats empty strings as null.

Database query (DuckDB, Postgres, BigQuery)

DuckDB to JSONL to push:

duckdb -c "COPY (SELECT * FROM orders WHERE date >= '2026-01-01') TO '/dev/stdout' (FORMAT JSON, ARRAY false)" \
  | npx instadash push --key "$INSTADASH_API_KEY" --name q1-orders

Postgres:

psql -c "COPY (SELECT * FROM orders) TO STDOUT WITH (FORMAT csv, HEADER)" \
  | npx instadash push --key "$INSTADASH_API_KEY" --name orders --format csv

From a Python script

import requests, json
 
rows = [{"id": i, "name": f"row-{i}"} for i in range(1000)]
requests.post(
  "https://instadash.io/ingest",
  headers={
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json",
    "X-Grid-Slug": "my-grid",
  },
  data=json.dumps(rows),
)

What the agent sees

After the push completes, the grid is reachable four ways:

SurfaceURLUse case
HTML/<handle>/<slug>Humans, crawlers
JSON/<handle>/<slug>/rowsCode, downstream agents
Markdown/<handle>/<slug>/llms.mdLLM context windows
Plain text/<handle>/<slug>/llms.txtPlaintext crawlers
MCP toolinstadash_read via mcp.instadash.io/mcpMCP-aware agents

Filters and pagination work on all the read surfaces. The agent doesn't need to know about ingestion — it just reads.

Common automation pattern

Run a nightly job (cron, GitHub Actions, your scheduler of choice) that:

  1. Queries the source system.
  2. Pipes JSONL into instadash push.
  3. Tags the grid with a date.

The agent always points at the same URL and gets fresh data. See /recipes/github-actions-nightly for a copy-paste template.

FAQ

Is there a row count limit per push?

Single pushes scale to hundreds of thousands of rows. For larger files, the CLI streams JSONL in chunks so memory stays flat. Multi-million-row backfills are routinely run from a GitHub Actions workflow.

Does Instadash infer the schema from my file?

Yes. The first push detects column types (string, number, boolean, date, JSON). Subsequent pushes either match the schema or create a new grid version with the updated columns.

What if my CSV has bad rows?

The CLI emits a per-row error with line number and skips the row. The push as a whole succeeds with whichever rows parsed cleanly, and the error report is in the response body.

Can I push from a database query instead of a file?

Yes — anything that produces JSONL to stdout works. Common pattern is duckdb -c 'SELECT * FROM table FORMAT JSONLines' piped into instadash push. See the DuckDB recipe.

What does the agent see when it reads the result?

It can fetch /rows for paginated JSON, /llms.md for a markdown table that fits LLM context, or call instadash_read via MCP to get filtered/sorted rows directly as a tool result.

Related

More guides

Related across sections

canonical: /guides/json-csv-to-api-for-ai-agents