SDK quickstart

Get started with the Bundata SDK: install, authenticate, and run your first extraction or search from code.

1. Install the SDK

Install the official SDK for your language (e.g. Python or Node). Example for Python:

pip install bundata

Check SDK overview for the latest package name and version.

2. Authenticate

Create an API key in the Bundata dashboard, then set it in your environment or pass it to the client:

import os
from bundata import BundataClient

client = BundataClient(api_key=os.environ.get("BUNDATA_API_KEY"))

Never commit API keys. Use environment variables or a secrets manager.

3. Run extraction

Submit a document (or a reference to storage) for extraction:

# Example: extract from a file path or URL
result = client.extract.run(
    source={"type": "file", "path": "document.pdf"},
    schema_id="your-schema-id",
)
print(result.smart_bites)

Output is schema-aware: you get the fields and metadata defined in your schema.

4. Query the Vector Catalog (optional)

If you have indexed smart bites in the Vector Catalog, query with natural language or an embedding:

results = client.search.query(
    collection_id="your-collection-id",
    query="What is the refund policy?",
    limit=5,
)
for hit in results.hits:
    print(hit.content, hit.metadata)

Next steps