Consult this page for an overview of how to query Meilisearch’s API, which types of parameters it supports, and how it structures its responses.
{}
) in API routes represent path parameters, for example, GET /indexes/{index_uid}
*
)MASTER_KEY
Authorization
header along with a valid API key to access protected routes (all routes except /health
.
/keys
route can only be accessed using the master key. For security reasons, we recommend using regular API keys for all other routes.
X-MEILI-API-KEY: apiKey
authorization header:/indexes
, GET /documents
, GET /keys
, etc. This allows you to work with manageable chunks of data. All these routes return 20 results per page, but you can configure it using the limit
query parameter. You can move between pages using offset
.
All paginated responses contain the following fields:
Name | Type | Description |
---|---|---|
offset | Integer | Number of resources skipped |
limit | Integer | Number of resources returned |
total | Integer | Total number of resources |
/tasks
endpoint/tasks
endpoint uses a different type of pagination, the response contains different fields. You can read more about it in the tasks API reference.
/indexes/{index_uid}/documents/{document_id}
.
If an endpoint does not take any path parameters, this section is not present in that endpoint’s documentation.
?
) in the endpoint. You can list multiple query parameters by separating them with an ampersand (&
). The order of query parameters does not matter. They are mostly used with GET endpoints.
If an endpoint does not take any query parameters, this section is not present in that endpoint’s documentation.
--data-binary
) requires a Content-Type
header. Content type headers indicate the media type of the resource, helping the client process the response body correctly.
Meilisearch currently supports the following formats:
Content-Type: application/json
for JSONContent-Type: application/x-ndjson
for NDJSONContent-Type: text/csv
for CSVContent-Type: application/json
.
Content-Encoding
header indicates the media type is compressed by a given algorithm. Compression improves transfer speed and reduces bandwidth consumption by sending and receiving smaller payloads. The Accept-Encoding
header, instead, indicates the compression algorithm the client understands.
Meilisearch supports the following compression methods:
br
: uses the Brotli algorithmdeflate
: uses the zlib structure with the deflate compression algorithmgzip
: uses the gzip algorithmContent-Encoding: gzip
header, indicating that the request body is compressed using the gzip
algorithm:
Accept-Encoding
header. The code sample below uses the gzip
algorithm:
task
object:
taskUid
to get more details on the status of the task.
See more information about asynchronous operations.