Auto-Generated OpenAPI Docs for Every Dataset
Every dataset gets interactive Swagger documentation with your exact schema, ready to test and share with your team.
Auto-generated API docs for every dataset
Every dataset you create on csv-api now comes with automatically generated OpenAPI (Swagger) documentation. This means you get interactive, testable API docs that reflect your exact column schema — no manual writing required.
Whether you're onboarding a new developer, sharing API details with a client, or just exploring what's possible, the Swagger UI makes it easy to understand and test your endpoints.
Accessing your API docs
There are two ways to access the documentation for a dataset:
- 1 Web UI: From your dataset's detail page, click the Swagger Docs link. This opens an interactive Swagger UI page where you can explore and test endpoints directly in your browser.
-
2
API endpoint: Fetch the raw OpenAPI JSON spec programmatically at
/api/v1/datasets/:public_id/swagger.
What's included in the spec
The auto-generated OpenAPI specification covers everything you need to integrate with your dataset:
- Endpoints — GET records (list) and GET record (single) with full path and method details
- Query parameters — filter, sort, fields, page, per_page, and prompt with descriptions and examples
- Response schemas — JSON structure with your actual column names and detected data types
- Authentication — Bearer token auth scheme documented and ready to use in the "Try it out" feature
- Pagination metadata — total count, page info, and navigation links
Testing endpoints with Swagger UI
The Swagger UI isn't just documentation — it's an interactive playground. Here's how to test your API:
- 1 Click the Authorize button and enter your API key.
- 2 Expand an endpoint and click Try it out.
- 3 Fill in any query parameters (filters, sort, pagination).
- 4 Click Execute to see the actual response, including headers and status code.
This is a great way to explore your data and build the exact query you need before writing any code.
Using the spec with code generators
The OpenAPI spec isn't limited to the Swagger UI. You can use it with any tool that supports OpenAPI 3.0:
- Client generation — generate typed API clients in TypeScript, Python, Go, or any language using tools like openapi-generator
- Postman/Insomnia — import the spec URL directly to create a ready-made collection for manual testing
- API gateways — use the spec with tools like Kong or AWS API Gateway for advanced routing
- Documentation hosting — embed the spec in tools like Redoc or Stoplight for custom-branded docs
Fetching the raw spec:
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://csv-api.com/api/v1/datasets/YOUR_ID/swagger"
Schema stays in sync
The OpenAPI spec is generated dynamically from your dataset's current schema. This means:
- Rename a column and the spec updates instantly
- Column types are always accurate — the spec reflects the actual database types
- No stale documentation — the spec is always generated fresh from the live schema