Back to Features
Feature

Filtering & Sorting

Query any column. Sort any field. No SQL required.

Filter by exact values, ranges, or patterns. Sort ascending or descending on any column. Combine multiple conditions in a single request — all with plain query parameters.

What it does

Every csv-api dataset supports rich filtering and sorting through standard URL parameters. You can filter rows by exact match, comparison (greater than, less than), or pattern matching, and you can sort the results by any column in either direction. Filters and sorts compose freely, so you can ask for 'all customers in Portland over 30, sorted by signup date descending' in a single HTTP call.

How it works

  1. 1

    Filter by column

    Pass any column name as a query parameter. ?city=Portland returns only rows where city equals Portland. Combine multiple filters by chaining them: ?city=Portland&status=active.

  2. 2

    Use comparison operators

    Append _gt, _gte, _lt, _lte, or _ne to filter on numeric or date columns. ?age_gt=30&age_lte=50 returns rows where age is between 31 and 50.

  3. 3

    Pattern matching for strings

    Use _like for substring search on text columns. ?name_like=ali matches Alice, Khali, and Mali.

  4. 4

    Sort with one parameter

    ?sort=age sorts ascending. Prefix with - for descending: ?sort=-age. The same column you can filter, you can sort.

See it in action

bash
# All Portland customers over 30, newest first, page 1
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://csv-api.com/api/v1/datasets/d_a8f3bc91/records?\
city=Portland&age_gt=30&sort=-signup_date&per_page=20"

{
  "data": [
    { "name": "Alice", "age": 32, "city": "Portland", "signup_date": "2024-08-12" },
    { "name": "Carol", "age": 41, "city": "Portland", "signup_date": "2024-06-30" }
  ],
  "meta": { "total": 12, "page": 1, "per_page": 20, "total_pages": 1 }
}

Why it matters

  • No query language to learn

    If you can build a URL, you can query your data. Standard query parameter syntax that works in any HTTP client.

  • Operators respect column types

    Type detection means _gt and _lt work correctly on numbers and dates, while _like is reserved for strings. No coercion bugs.

  • Composable filters

    Chain as many filter conditions as you want in a single request. They're combined with AND semantics.

The problem it solves

You uploaded a 5,000 row CSV but you only need 12 of those rows for the screen you're building. Without filtering, you'd have to fetch everything and filter on the client. With csv-api filtering, the server returns exactly the rows you asked for — faster, cheaper, and easier to reason about.

Common use cases

  • Powering search and filter UIs without writing a search backend

  • Building dashboards that slice and dice the same dataset many ways

  • Letting non-technical teammates pull subsets of data via URL

  • Replacing one-off SQL queries with reusable, shareable URLs

Try Filtering & Sorting for yourself

Create a free csv-api account, upload a file, and see your API live in under a minute.

We use essential cookies to keep you logged in. No tracking or analytics. Privacy policy