REST API and MCP
When to use it
Use the API when you build the shop yourself, when product data comes from several systems, or when no module or feed fits. Your code decides what to send and when. An AI agent can do the same over MCP.
You still start in the cabinet: an API key can only be created there, and the index is quickest to create there too.
Set it up
Create a key
In the cabinet, open API keys in the project menu and click New key. Enter a Name, pick the Type Secret key (sk), server side and the Access Full access, and click Create key. Copy the key; it is shown only once. Keep it on your server, because it can change the index. See API keys.
Create an index
In the cabinet, open Indices, click New index, enter a Name, pick a Language and click Create index. Or create it with POST /v1/projects/:projectId/indices. Leave out the fields and the first upload maps them for you. See Indices and languages.
Your code needs the project id and the index id. The project id is in the cabinet URL, /app/p/<project id>/..., and on the project's Settings page under Project ID. The index id follows /indices/ in the URL of any index page.
Send documents
Send products in batches of up to 1000:
curl -X POST https://api.search.zaproo.cloud/v1/projects/$PROJECT_ID/indices/$INDEX_ID/documents \
-H "Authorization: Bearer $SECRET_KEY" -H "Content-Type: application/json" \
-d '[{"id": "tape-48", "title": "Brown packaging tape 48mm", "price": 1.86, "brand": "Packwell"}]'
Writes are asynchronous: the answer is 202 with a taskId that you can follow. The index's Tasks page in the cabinet lists the same tasks. See Documents and tasks.
Keep it in sync
- Changes. Send a product again whenever it changes. A document with the same
idreplaces the stored one. - Deletes. Delete products by id when they leave the shop.
- Full rebuilds. Send the whole catalog through a replace session. Products you don't send disappear when you commit, and search keeps working until then. See Full catalog sync.
- Retries. Send an
Idempotency-Keyheader, so a retried request never writes twice.
With an AI agent
Connect Claude Code or any MCP client with the same kind of secret key. The project's MCP connection page in the cabinet has the endpoint and a ready-made command. The agent can create indices, upload documents, change fields and tune search by talking to you. See MCP setup.
Related
Product feed
Connect any shop that can publish its catalog as a feed. You set it up in the cabinet, and Zaproo downloads the feed on a schedule and writes only what changed.
Shopify
A Zaproo Search integration for Shopify is coming soon. Until then, connect the shop through a product feed or the REST API.