Insert Text

Insert Text to Your Database

Easily store and index text documents in your database using our API. endpoint. Supports over 100+ languages.

API Endpoint

POST https://api.vecstore.app/insert-text

Parameters

Authorization Header - Required

Your API key for authentication.

text JSON - Required

The text content to be indexed in the database.

database JSON - Required

The name of the database to insert the text into.

metadata JSON - Optional

JSON metadata to help identify documents after or during search. This can include information like document ID, title, author, or any other relevant attributes.

Python Example

import requests

# Configuration
API_KEY = "your_api_key_here"
DATABASE = "your_database_name"
TEXT_CONTENT = """
This is a sample document that will be inserted in the database.
It can contain multiple paragraphs and will be semantically searchable.
The embeddings will be generated automatically by the API.
"""

# Prepare JSON payload
payload = {
   "text": TEXT_CONTENT,
   "database": DATABASE,
   "metadata": {"title": "Sample Document", "author": "John Doe", "id": "doc-123"}
}
headers = {
   "Authorization": API_KEY,
   "Content-Type": "application/json"
}

# Send the request
response = requests.post(
   "https://api.vecstore.app/insert-text",
   headers=headers,
   json=payload
)

# Check response
if response.status_code == 200:
   result = response.json()
   print(f"Text uploaded successfully: {result}")
   

Response Format

{
 "id": "fd48a291-c2e6-4a39-9c88-af3e5a12e8b7",
 "time": "95ms"
}

API Credit Usage

Each operation consumes one API credit.