Natural Language Queries: Ask Your Data Questions in Plain English
Skip complex filter syntax — use the prompt parameter to query your CSV data with everyday language, powered by AI.
Ask your data questions in plain English
Building complex filter queries can be tedious. What if you could just ask your API a question like you'd ask a colleague? With csv-api's natural language query feature, you can do exactly that — pass a prompt parameter and let AI translate your question into structured filters automatically.
No query syntax to memorize. No documentation to reference. Just describe what you want in plain English.
How it works
Add the prompt query parameter to any records endpoint. csv-api sends your question to an AI model along with your dataset's column schema, and the AI generates the appropriate filters, sorts, and conditions.
Example request:
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://csv-api.com/api/v1/datasets/YOUR_ID/records?prompt=people%20older%20than%2030%20in%20Portland"
Behind the scenes, csv-api interprets your prompt and applies the equivalent of filter[age][gt]=30&filter[city]=Portland. The response is identical to a standard filtered request — same JSON structure, same pagination.
Example prompts
Here are some real-world examples of natural language queries you can use:
-
?prompt=orders over $500 from last month -
?prompt=top 10 products by revenue -
?prompt=employees in engineering who started this year -
?prompt=cities with population between 100k and 500k -
?prompt=items that are out of stock sorted by name
Limits and quotas
Each prompt can be up to 128 characters. Prompt queries are rate-limited per plan to manage AI processing costs:
| Plan | Prompts per hour |
|---|---|
| Free | 5 |
| Starter | 100 |
| Pro | 500 |
| Scale | 1,000 |
Results are cached for one hour, so repeated identical prompts won't count against your quota.
Combining prompts with other parameters
You can use prompt alongside other query parameters. For example, combine a natural language query with field selection and pagination:
GET /api/v1/datasets/abc123/records?prompt=active%20users%20in%20California&fields=name,email&per_page=25
The AI-generated filters are applied first, then field selection and pagination run on top of the filtered results.
Tips for better prompts
- Reference your actual column names — the AI knows your schema, so using exact column names like "salary" or "created_at" produces more accurate results.
- Be specific with comparisons — "greater than 100" is clearer than "high values".
- Keep it concise — prompts are capped at 128 characters. Focus on what you want, not how to get it.
- Use standard filter params for production — natural language queries are great for exploration and prototyping. For production apps, explicit filter parameters give you deterministic, repeatable results.