Insert Image
Insert images in your database
Easily store images in your database using our API endpoint.
API Endpoint
POST https://api.vecstore.app/insert-image
Parameters
Authorization
Header - Required Your API key for authentication.
image
JSON - Required Base64-encoded image data to be inserted into the database.
database
JSON - Required The name of the database to insert the image into.
metadata
JSON - Optional JSON metadata to help identify documents after or during search.
Python Example
import requests
import base64
# Configuration
API_KEY = "your_api_key_here"
IMAGE_PATH = "path/to/your/image.jpg"
DATABASE = "your_database_name"
# Read and encode image
with open(IMAGE_PATH, 'rb') as image_file:
image_data = base64.b64encode(image_file.read()).decode('utf-8')
# Prepare JSON payload
payload = {
"image": image_data,
"database": DATABASE,
"metadata": {"category": "landscape", "id": 123}
}
headers = {
"Authorization": API_KEY,
"Content-Type": "application/json"
}
# Send request
response = requests.post(
"https://api.vecstore.app/insert-image",
headers=headers,
json=payload
)
# Check response
if response.status_code == 200:
result = response.json()
print(f"Image uploaded successfully: {result}")
Response Format
{
"id": "fd48a291-c2e6-4a39-9c88-af3e5a12e8b7",
"time": "80ms"
}
API Credit Usage
Each operation consumes one API credit.