CSV to API

A CSV can already be put online as a file to download. But code that uses it usually wants more: rows as JSON, only the rows it asks for, sorted, a page at a time. Building that means a database, a small service and somewhere to run it, which is a lot of work for a list of products or a price sheet.

rho gives a table a hosted, read-only API: upload the file, and its URL answers JSON with filters, sorting and paging. There’s no backend to write or keep running.

From a file to JSON

One example throughout: a small product catalogue, products.csv (made up):

sku,name,category,price,country
00412,Desk lamp,Lighting,49.50,SE
00413,Office chair,Furniture,189.00,SE
01007,Notebook,Stationery,8.90,DK
00415,Floor lamp,Lighting,79.00,DE
  1. Upload it. Sign up, then drop the file anywhere in the app. rho reads CSV, TSV, Excel, JSON, NDJSON and Parquet: see Upload a file.
  2. Check the types. Before anything is saved, rho shows the type it read for each column and the first rows. Here price is a number (DOUBLE), and sku, name, category and country are text. Save it, say as shop/products.
  3. Copy the URL. The table’s API panel has its URL, https://api.rho.store/v/<key>. The key is random and names nothing.
  4. Call it, with an API token of your workspace:
curl -H "Authorization: Bearer $RHO_API_KEY" \
"https://api.rho.store/v/<key>?price__lt=100&sort=-price&select=name,price"
  1. Get the rows that match, as JSON:
{
"table": "shop/products",
"version": 1,
"columns": [
{ "name": "name", "type": "VARCHAR" },
{ "name": "price", "type": "DOUBLE" }
],
"rows": [
{ "name": "Floor lamp", "price": 79.0 },
{ "name": "Desk lamp", "price": 49.5 },
{ "name": "Notebook", "price": 8.9 }
],
"offset": 0,
"total": 3,
"next": null
}

total is how many rows match, all pages together, and next is the URL of the next page, null on the last.

Filtering, sorting and paging

Each is a query parameter, named after a column where it’s about one:

ParameterWhat it does
?country=SEOnly rows whose country is exactly SE
?price__lt=100Compare: __gt, __lt, __gte, __lte on a column of numbers or dates; also __eq, __ne, __contains, __empty, __not_empty
?sort=-priceOrder by a column; - for descending
?select=name,priceOnly these columns, in this order
?q=lampRows with this text in any column
?limit=20&offset=40The page’s size and where it starts; follow next rather than counting
.csv, .ndjson, .parquetEvery row of the version as a file, as in /v/<key>.csv, without filters or paging

Filters combine: every one has to match. The table API guide has the details and limits.

Private or public

CORS is open on table APIs, so a page in a browser can call one. Only do that with a public table: an API token is a secret that reads and writes every table in your workspace, so it belongs on a server or in a script, never in a web page’s JavaScript.

Latest and pinned versions

Every upload to the table makes a new version, and both kinds of URL are useful:

A stable URL isn’t a stable schema: if a new upload drops or renames a column, the latest version answers without it, so code that reads price should still check it’s there. Every answer has an ETag and an X-Rho-Version header; send the ETag back as If-None-Match, and you get 304 Not Modified until there’s a new version.

To update the data, upload a new file to the table (to replace its rows, add to them, or update them by a key), and a wrong one is undone by restoring the version before. The API only reads.

Check the types

rho reads each column’s type from its values: numbers, dates, true/false, or text. That’s convenient, and still worth a look before you save:

The same table elsewhere

The table behind the API is an ordinary rho table. An AI agent can query it with SQL and keep it up to date over MCP, and the Python SDK reads and writes it as a DataFrame.

When something else fits better