Skip to main content

HTTP Requests

Qdrant provides a plethora of HTTP request calls to interact with the database. Here we have listed a few to get you started:

Note

You can run these HTTP requests directly from the Qdrant Dashboard console or use any HTTP client like cURL and Postman. All these requests need to be made to your Qdrant database endpoint.

Note

For all the following HTTP requests, you will either get a 200 for a successful operation or you will get some error code with the error stated in the response.

Pre-requisites

You need the URL and API-Key to connect to the Qdrant database.

To get the URL and the API-Key:

  1. Go to TIR and head to the Vector Database section.
  2. There you will find all your Vector Databases.
  3. Click on the Qdrant Database you want to connect to.
  4. You will find your database's Endpoint URL and the API-Key in the Overview Tab.

Creating a Collection

  • We will create a collection called test_collection.
  • We are going to set the vector size to 4. This means that each vector will have 4 dimensions.
  • We are going to set the distance metric to DOT. The distance between vectors will be calculated using the dot product.
  • We are going to set the shard_number to 6. This means that your data will be sharded into 6 individual shards.
  • We are also going to set the replication_factor to 2. This means 2 shard-replicas will be stored, i.e., 1 additional copy of each of your data will be maintained automatically.

For a more detailed explanation of sharding and replication factors, you can refer to the Basic Terminology section.

Example Request

curl -X PUT \
-H "api-key: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"vectors": {
"size": 4,
"distance": "Dot"
},
"shard_number": 6,
"replication_factor": 2
}' \
https://<your-endpoint-url>:6333/collections/test_collection