SearchJet API Documentation
SearchJet Engine API Documentation
Overview
The SearchJet Engine API provides powerful, scalable search functionality for your applications. All API requests are made to the base URL below and must include authentication headers.
Base URL: https://app.searchjetengine.com
All endpoints accept and return JSON. Use Content-Type: application/json for all requests.
Authentication
SearchJet uses API key authentication. Include your key in the Authorization header as a Bearer token.
Authorization: Bearer YOUR_API_KEY
Key Types
| Key Prefix | Type | Use Case |
|---|---|---|
sj_pub_ |
Public | Client-side search, safe to expose in browsers |
sj_prv_ |
Private | Server-side operations, indexing, admin tasks |
sj_srch_ |
Search | Optimized for search-only queries |
Generate keys in your dashboard under Settings > API Keys.
Search API
The Search API is a GET endpoint that returns ranked results for a given query.
Endpoint
GET /v1/search
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
q |
string | Yes | — | Search query string |
site_id |
integer | No | Inferred from key | Site identifier |
limit |
integer | No | 20 | Results per page (max 100) |
offset |
integer | No | 0 | Offset for pagination |
page |
integer | No | 1 | Page number for pagination |
filters |
string | No | — | Meilisearch filter syntax |
sort |
string | No | — | Sort order |
facets |
string | No | — | Facets to return |
Example Request
cURL
curl -X GET "https://app.searchjetengine.com/v1/search?q=react+tutorial&limit=10" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx"
JavaScript
const params = new URLSearchParams({
q: 'react tutorial',
limit: '10'
});
const response = await fetch(
`https://app.searchjetengine.com/v1/search?${params}`,
{
headers: {
'Authorization': 'Bearer sj_prv_xxxxxxxxxxxxxxxx'
}
}
);
const data = await response.json();
console.log(data.results);
Python
import httpx
response = httpx.get(
"https://app.searchjetengine.com/v1/search",
params={"q": "react tutorial", "limit": 10},
headers={"Authorization": "Bearer sj_prv_xxxxxxxxxxxxxxxx"}
)
data = response.json()
print(data["results"])
Response Format
{
"results": {
"hits": [
{
"id": "doc_001",
"title": "Getting Started with React",
"url": "/blog/react-getting-started",
"excerpt": "Learn the fundamentals of React...",
"content": "Full content here..."
}
],
"estimatedTotalHits": 142,
"processingTimeMs": 12,
"query": "react tutorial"
},
"remaining_quota": {
"daily_limit": 10000,
"used_today": 142
}
}
Client Info
Get Meilisearch configuration for your authorized key.
Endpoint
GET /v1/client-info
Example Request
curl -X GET "https://app.searchjetengine.com/v1/client-info" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx"
Response Format
{
"meilisearch_host": "https://ms-xxxxx.searchjetengine.com",
"meilisearch_key": "xxxxx",
"meilisearch_public_key": "xxxxx",
"active": true,
"index": "site_123",
"domain": "example.com",
"plan": "pro",
"limits": {
"daily_limit": 10000,
"used_today": 142
},
"usage_limits": {
"max_indexed_pages": 50000,
"search_queries_per_month": 1000000
}
}
Index Management
Bulk Index Documents
Index multiple documents in a single request.
Endpoint:
POST /api/v1/index/bulk
Request Body:
{
"documents": [
{
"id": "doc-123",
"title": "Page Title",
"content": "Full page content...",
"url": "https://example.com/page",
"excerpt": "Short description...",
"author": "Author Name",
"date": "2025-01-15"
}
]
}
Example:
curl -X POST "https://app.searchjetengine.com/api/v1/index/bulk" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"documents": [
{
"id": "doc-001",
"title": "Getting Started",
"content": "Learn the basics...",
"url": "https://example.com/getting-started",
"excerpt": "A beginner guide"
}
]
}'
Delete a Document
Remove a document from the index.
Endpoint:
DELETE /api/v1/index/destroy
Request Body:
{
"id": "doc-123"
}
Example:
curl -X DELETE "https://app.searchjetengine.com/api/v1/index/destroy" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"id": "doc-123"}'
Search Logging
Store search log entries for analytics.
Endpoint
POST /api/v1/search-log
Request Body
{
"query": "react tutorial",
"results_count": 15,
"session_id": "abc-123",
"timestamp": "2025-01-15T10:30:00Z"
}
Example
curl -X POST "https://app.searchjetengine.com/api/v1/search-log" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"query": "react tutorial",
"results_count": 15,
"session_id": "abc-123",
"timestamp": "2025-01-15T10:30:00Z"
}'
Usage Reporting
Report API usage for billing and monitoring.
Endpoint
POST /v1/report-usage
Request Body
{
"operation": "search",
"count": 1,
"index": "site_123"
}
Example
curl -X POST "https://app.searchjetengine.com/v1/report-usage" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"operation": "search",
"count": 1,
"index": "site_123"
}'
Analytics
Get search analytics for your site.
Endpoint
GET /api/analytics
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
period |
string | No | 7d, 30d, or 90d (default: 30d) |
site_id |
integer | No | Site identifier |
Example
curl -X GET "https://app.searchjetengine.com/api/analytics?period=30d" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx"
Response Format
{
"total_searches": 15420,
"unique_queries": 2341,
"avg_response_time_ms": 45,
"top_queries": [
{"query": "react tutorial", "count": 523},
{"query": "javascript basics", "count": 412}
],
"zero_result_queries": [
{"query": "xyznonexistent", "count": 5}
]
}
API Keys
Manage your API keys programmatically.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/sites/{site}/keys |
List keys for a site |
| POST | /api/sites/{site}/keys |
Create a new key |
| PUT | /api/sites/{site}/keys/{key} |
Update a key |
| DELETE | /api/sites/{site}/keys/{key} |
Delete a key |
| POST | /api/keys/{key}/toggle |
Toggle key status |
Create Key
curl -X POST "https://app.searchjetengine.com/api/sites/123/keys" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"name": "Production Key"}'
Toggle Key
curl -X POST "https://app.searchjetengine.com/api/keys/key_abc/toggle" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx"
Sites
Manage your sites.
| Method | Endpoint | Description |
|---|---|---|
| GET | /sites |
List all sites |
| POST | /sites |
Create a new site |
| PUT | /sites/{id} |
Update a site |
| DELETE | /sites/{id} |
Delete a site |
Create Site
curl -X POST "https://app.searchjetengine.com/sites" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"name": "My Blog", "url": "https://example.com"}'
Dashboard
Get dashboard metrics.
Endpoint
GET /dashboard
Example
curl -X GET "https://app.searchjetengine.com/dashboard" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx"
Response Format
{
"siteCount": 3,
"apiKeyCount": 8,
"plan": "pro",
"usage": {
"searches_this_month": 15420,
"indexed_pages": 1250
},
"limits": {
"max_sites": 10,
"max_api_keys": 25,
"searches_per_month": 1000000
}
}
Profile
Manage your user profile.
| Method | Endpoint | Description |
|---|---|---|
| PUT | /profile |
Update profile |
| DELETE | /profile |
Delete account |
Update Profile
curl -X PUT "https://app.searchjetengine.com/profile" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"name": "John Doe", "email": "john@example.com"}'
Delete Account
curl -X DELETE "https://app.searchjetengine.com/profile" \
-H "Authorization: Bearer sj_prv_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"password": "your_password", "reason": "No longer needed"}'
Rate Limits
All plans enforce rate limits to ensure fair usage.
| Plan | Requests/min | Requests/day |
|---|---|---|
| Free | 60 | 10,000 |
| Starter | 300 | 100,000 |
| Pro | 1,200 | 1,000,000 |
| Enterprise | Custom | Custom |
Rate limit headers are included in every response:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 295
X-RateLimit-Reset: 1690000000
When rate limited, you receive a 429 status. Use the Retry-After header value (in seconds) before retrying.
Error Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid parameters or malformed request body |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Key lacks required permissions |
| 404 | Not Found | Resource does not exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Internal error, contact support |
See Error Handling for full details.
SDKs
Official client libraries for quick integration:
| Language | Package | Install |
|---|---|---|
| JavaScript/TypeScript | searchjet-connect |
npm install searchjet-connect |
| Python | searchjet-python |
pip install searchjet-python |
| PHP | searchjet/laravel |
composer require searchjet/laravel |
See the SDK Reference for detailed usage.
Related Pages
- API Endpoints Reference — Complete endpoint list
- Error Handling — Detailed error responses
- API Key Setup — Platform-specific setup guides
- SDK Reference — Client library documentation
- Search API — Search endpoint deep dive
- Index API — Indexing operations