Use the REST API¶
The iscc-search REST API lets you manage indexes, add assets, and search for similar content over HTTP.
Start the server¶
Start in production mode:
Start in development mode with auto-reload:
Configure the server via environment variables:
export ISCC_SEARCH_INDEX_URI=usearch:///var/lib/iscc-search
export ISCC_SEARCH_HOST=0.0.0.0
export ISCC_SEARCH_PORT=8000
export ISCC_SEARCH_LOG_LEVEL=info
See the deployment guide for production configuration.
Authentication¶
By default, the API is public. Set ISCC_SEARCH_API_SECRET to require authentication:
When enabled, include the secret in the X-API-Key header on every request:
Index management¶
Create an index:
curl -X POST http://localhost:8000/indexes \
-H "Content-Type: application/json" \
-d '{"name": "myindex"}'
List all indexes:
Get metadata for a specific index:
Delete an index and all its data:
Asset operations¶
Add assets to an index. The request body is an array of asset objects. Each must include iscc_id and at
least one of iscc_code or units:
curl -X POST http://localhost:8000/indexes/myindex/assets \
-H "Content-Type: application/json" \
-d '[
{
"iscc_id": "ISCC:MAIGIIFJRDGEQQAA",
"iscc_code": "ISCC:KECYCMZIOY36XXGZ7S6QJQ2AEEXPOVEHZYPK6GMSFLU3WF54UPZMTPY"
}
]'
Retrieve an asset by ISCC-ID:
Search¶
Search for similar assets using POST with a JSON body:
curl -X POST http://localhost:8000/indexes/myindex/search \
-H "Content-Type: application/json" \
-d '{"iscc_code": "ISCC:KECYCMZIOY36XXGZ7S6QJQ2AEEXPOVEHZYPK6GMSFLU3WF54UPZMTPY"}'
Limit the number of results with a query parameter:
curl -X POST "http://localhost:8000/indexes/myindex/search?limit=5" \
-H "Content-Type: application/json" \
-d '{"iscc_code": "ISCC:KECYCMZIOY36XXGZ7S6QJQ2AEEXPOVEHZYPK6GMSFLU3WF54UPZMTPY"}'
Search using GET with a query parameter:
curl "http://localhost:8000/indexes/myindex/search?iscc_code=ISCC:KECYCMZIOY36XXGZ7S6QJQ2AEEXPOVEHZYPK6GMSFLU3WF54UPZMTPY"
Health checks¶
iscc-search exposes two health endpoints for orchestrators and load balancers.
Liveness probe - returns 200 if the process is alive. Does not check index state:
Readiness probe - returns 200 only when the index is initialized and operational:
Interactive documentation¶
The server hosts interactive API documentation at /docs, powered by Stoplight Elements. Open
http://localhost:8000/docs in your browser to explore endpoints, view schemas, and send test requests.