Feedvault

Guide

From CSV to API: a practical guide

A CSV file is the most common way data gets passed around, and an API is the most useful way to consume it. This guide covers the decisions in between, whether you build it yourself or use a service like Feedvault.

Reviewed 2026-11-16 · Feedvault team

Step 1: clean the CSV

  • One header row with short, unique column names (lowercase, no spaces: unit_price, not "Unit Price (AED)").
  • One record per row; no merged cells, subtotals or notes at the bottom.
  • Consistent values: one date format, one currency per column, one spelling per category.
  • UTF-8 encoding, so names in Arabic or with accents survive.
  • Quoted fields where values contain commas, per the usual CSV conventions.

The free CSV to JSON converter shows how a file parses and which types each column looks like, in your browser.

Step 2: decide types and a key

An API is only as useful as its types. Numbers must be numbers so "less than 60" works; dates must be dates so "since November" works. Pick a key column whose value is unique and stable (a SKU, an id). The key is what lets you update a record later instead of creating a duplicate.

Feedvault infers types on import and normalises values such as prices with currency symbols. You review and adjust the schema before data is served.

Step 3: design the queries

Think about the questions consumers will ask, then make sure the API can answer them: filters on the right columns with the right operators, sorting, free-text search on a few columns, and pagination.

Filtering
filter[column]=value for equality, filter[column][operator]=value for others (lt, gte, in, icontains…).
Sorting
sort=column, or sort=-column for descending.
q=words across the columns you mark searchable.
Pagination
A cursor returned with each page, so the next request continues exactly where the last one stopped.

The free CSV to API tool shows the endpoint and example queries your file would get.

Step 4: authentication and limits

Never expose data without knowing who is asking. Issue API keys, one per consumer, send them in the Authorization header, keep them on servers, and give each a rate limit and a monthly quota. Metering requests per key tells you who uses the API and protects you from runaway clients. In Feedvault, keys are product-scoped, rate-limited, and can each have a monthly quota and an alert threshold.

Step 5: updates

  1. Export the latest CSV.
  2. Import it into the same dataset.
  3. Rows with an existing key are updated; new keys are added; changes are recorded.
  4. Consumers see the new data on their next request.

Decide what deletion means: many teams keep rows and mark them inactive, so consumers can tell "removed" from "never existed".

Build or use a service?

Building it yourself means a database, an import job, type handling, a query parser that is safe against injection, authentication, metering and hosting. That is worthwhile when the API is your product. When the data is the point and the API is plumbing, a service saves that work; Feedvault is one option, built for data you own.

Questions and answers

How often should I re-import?

As often as the source changes and consumers need fresh data: daily for prices and stock, weekly or monthly for slow-moving lists.

What about very large files?

Import them in slices so no single step runs too long. Feedvault does this automatically, about 50 rows per step in the background.

Is JSON better than CSV?

For APIs, yes: JSON keeps types (numbers, booleans, null) and nests naturally. CSV remains the easiest format to edit and exchange, which is why many APIs are fed from CSV.

How do I protect against injection?

Never build queries by pasting user input into SQL. Use parameterised queries and an allow-list of columns and operators, as Feedvault does.

More Feedvault guides