Getting Started with FLTR
This guide will walk you through creating your first dataset, uploading a document, and running semantic search queries using the FLTR API.
Prerequisites
Before you begin, make sure you have:
- A FLTR account (sign up at www.tryfltr.com)
- An API key (we’ll generate one in the next step)
- Basic familiarity with REST APIs
Step 1: Generate an API Key
- Log in to your FLTR Dashboard
- Navigate to Settings → API Keys
- Click Create API Key
- Give your key a descriptive name (e.g., “Development Key”)
- Copy and save your API key securely
API keys grant full access to your account. Never share them publicly or commit them to version control. Use environment variables to store them securely.
Step 2: Create Your First Dataset
Datasets are containers for related documents. Let’s create one using curl:
curl -X POST https://api.fltr.com/v1/datasets \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My First Dataset",
"description": "Testing FLTR semantic search",
"is_public": false
}'
The response will include a dataset_id - save this for the next steps:
{
"id": "ds_abc123",
"name": "My First Dataset",
"description": "Testing FLTR semantic search",
"is_public": false,
"created_at": "2024-01-10T12:00:00Z"
}
Step 3: Upload a Document
Now let’s add a document to your dataset. You can upload text, PDFs, or images:
Option A: Upload Text Content
curl -X POST https://api.fltr.com/v1/datasets/ds_abc123/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "FLTR is a powerful semantic search platform that makes your documents AI-ready. It supports hybrid search combining vector similarity and keyword matching.",
"metadata": {
"title": "About FLTR",
"category": "documentation"
}
}'
Option B: Upload a File
curl -X POST https://api.fltr.com/v1/datasets/ds_abc123/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@/path/to/document.pdf" \
-F 'metadata={"title":"My Document","category":"research"}'
The API will automatically:
- Extract text from PDFs and images
- Chunk the content into searchable segments
- Generate vector embeddings
- Index for hybrid search
Document processing happens asynchronously. Large files may take a few seconds to become searchable.
Step 4: Run Your First Query
Now you can search your dataset using semantic search:
curl -X POST https://api.fltr.com/v1/mcp/query \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What is FLTR?",
"dataset_id": "ds_abc123",
"limit": 5
}'
Response:
{
"results": [
{
"chunk_id": "ch_xyz789",
"content": "FLTR is a powerful semantic search platform that makes your documents AI-ready...",
"score": 0.89,
"metadata": {
"title": "About FLTR",
"category": "documentation"
},
"document_id": "doc_def456"
}
],
"total": 1,
"query_time_ms": 45
}
Code Examples
import requests
# Configuration
API_KEY = "your_api_key_here"
BASE_URL = "https://api.fltr.com/v1"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
# Create dataset
dataset_response = requests.post(
f"{BASE_URL}/datasets",
headers=headers,
json={
"name": "My First Dataset",
"description": "Testing FLTR",
"is_public": False
}
)
dataset_id = dataset_response.json()["id"]
# Upload document
doc_response = requests.post(
f"{BASE_URL}/datasets/{dataset_id}/documents",
headers=headers,
json={
"content": "FLTR is a powerful semantic search platform...",
"metadata": {"title": "About FLTR"}
}
)
# Query
query_response = requests.post(
f"{BASE_URL}/mcp/query",
headers=headers,
json={
"query": "What is FLTR?",
"dataset_id": dataset_id,
"limit": 5
}
)
print(query_response.json())
Rate Limits
FLTR has three authentication tiers with different rate limits:
| Method | Rate Limit | Best For |
|---|
| Anonymous | 50 requests/hour | Quick testing |
| API Key | 1,000 requests/hour | Production services |
| OAuth/MCP | 15,000 requests/hour | MCP clients |
Rate limits are per account, not per API key. If you need higher limits, contact support.
Common Errors
401 Unauthorized
{"error": "Invalid API key"}
Solution: Double-check your API key and ensure it’s properly formatted in the Authorization header:
Authorization: Bearer YOUR_API_KEY
404 Dataset Not Found
{"error": "Dataset not found"}
Solution: Verify the dataset ID exists and belongs to your account. List your datasets:
curl https://api.fltr.com/v1/datasets \
-H "Authorization: Bearer YOUR_API_KEY"
429 Rate Limit Exceeded
{"error": "Rate limit exceeded", "retry_after": 3600}
Solution: Wait for the retry period (in seconds) or upgrade to OAuth authentication for higher limits.
413 Payload Too Large
{"error": "Document exceeds maximum size of 10MB"}
Solution: Split large documents into smaller chunks before uploading, or use our chunking API.
Next Steps
Need Help?