---
title: "Responses Download"
method: POST
path: "/api/responses/download/"
tags: ["Responses"]
---

# Responses Download

`POST /api/responses/download/`

Retrieves `size` search results matching the query `q` in the selected `indices`.

The Netlas SDK and CLI tool additionally include a `download_all()` method and an `--all` key that allow you to query all available results.

## Request body

- DownloadPayload
  - `q` string, required — The query string used for searching. See [Query Syntax](/knowledge-base/query-language/) for more details.
  - `size` integer, required — Number of documents to download. Call corresponding __Count__ endpoint to get a number of available documents.
  - `indices` IndiceLabel[] — A list of indice labels to search in. If not provided, the search will be performed in the default (most relevant index). Call [indices](#tag/Indices) endpoint to get the list of available indices.
  - `fields` Field[], required — You can control the amount of output data by specifying which fields to include or exclude in the response. Use the `source_type` parameter to select between `include` and `exclude` options.
  - `source_type` 'include' | 'exclude', required — Specify `fields` and use `source_type` to choose between: - `include` to return only the specified fields - `exclude` to return all fields except the specified ones
  - `type` 'json' | 'csv' — Download output format. - `json`: JSON array output. - `csv`: CSV text output in the response body. Note: the API may still respond with `Content-Type: application/json` for CSV output, and `Accept: text/csv` may return `406`. Use request field `type: csv` to request CSV.

## Response `200`

__Search Results__

- union
  - object[]
    - `data` ResponseDocument — An object representing the response
  - string — CSV text content returned by download endpoints when `type: csv` is requested.

## Other responses

- `400` — __Bad Request__: Some required parameters were not passed or were not validated
- `401` — __Unauthorized__: The request was rejected due to missing or invalid authentication credentials
- `402` — __Not Enough Coins__: You are out of your current subscription plan limits
- `403` — __Access Denied__: You are not allowed to perform this action Error details are included in the response body.
- `429` — __Daily request limit exceeded__ or __Request throttled__. Additional error details are provided in the response body
- `500` — __Internal Server Error__: Details are included in the response body
- `504` — __Timeout__: The request took too long to process

---

[API](https://skmtc.net/netlas/apis/netlas-api.md) · [All operations](https://skmtc.net/netlas/apis/netlas-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/netlas/netlas-api/revisions/2b1f84425791/schema)
