Skip to main content
Catalogs store your product data in Rastro. Create a catalog, add items, then enrich them with Flows or the Enrich API.

1. Create a catalog

import requests

response = requests.post(
    "https://catalogapi.rastro.ai/api/public/catalogs",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "name": "Products",
        "unique_id_field": "sku",
        "schema_definition": {
            "fields": [
                {"name": "sku", "type": "string"},
                {"name": "title", "type": "string"},
                {"name": "price", "type": "number"}
            ]
        }
    }
)
catalog = response.json()
print(f"Created catalog: {catalog['id']}")
Response:
{
  "id": "cat_abc123",
  "name": "Products",
  "unique_id_field": "sku"
}

2. Add items (bulk)

response = requests.post(
    f"https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/items/bulk",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "items": [
            {"sku": "A1", "title": "Product A", "price": 29.99},
            {"sku": "A2", "title": "Product B", "price": 39.99},
            {"sku": "A3", "title": "Product C", "price": 49.99}
        ],
        "unique_field": "sku"
    }
)
print(response.json())
Response:
{
  "created": 3,
  "updated": 0,
  "failed": 0
}

3. List your items

response = requests.get(
    f"https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/items",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(response.json())
Response:
{
  "items": [
    {"id": "item_1", "sku": "A1", "title": "Product A", "price": 29.99},
    {"id": "item_2", "sku": "A2", "title": "Product B", "price": 39.99},
    {"id": "item_3", "sku": "A3", "title": "Product C", "price": 49.99}
  ],
  "total": 3,
  "page": 1
}

4. Update an item

response = requests.put(
    f"https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/items/{item_id}",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"price": 24.99}
)
print(response.json())
Response:
{
  "id": "item_1",
  "sku": "A1",
  "title": "Product A",
  "price": 24.99
}

Key Concepts

  • unique_id_field — The field used to identify items (e.g., sku, id, email). Used for upserts.
  • Bulk upsert — Add up to 1000 items at once. Existing items (matched by unique field) are updated.
  • Catalogs + Flows — Connect a catalog to a Flow to automatically enrich items when they’re added.

What’s Next