Quickstart
Follow this guide to get up and running with Graffo in just a few steps.
The simplest way to use Graffo is through our hosted cloud platform at graffo.io.
Graffo provides SDKs for Python and Node.js. Install the package.
Note: The SDK is currently not stable. We recommend using the API directly. You can find detailed API usage in the API References tab.
pip install graffo-sdknpm install @graffo/sdkNow, create and copy your API key from your Graffo dashboard:
Go to app.graffo.io and sign in to your account
Navigate to Agent Contexts → Org API Keys
Click "New Org API Key"
Give your key a descriptive name (e.g., "My Project API Key")
Copy the generated API key - you'll need it for the next step
Important: Store your API key securely. It won't be shown again after creation.
Initialize the Graffo client with your new API key.
from graffo import GraffoSDK
graffo = GraffoSDK(api_key="YOUR_API_KEY", base_url="https://api.graffo.io")import { GraffoSDKClient } from "@graffo/sdk";
const graffo = new GraffoSDKClient({apiKey: "YOUR_API_KEY", base_url: "https://api.graffo.io"});A collection is a group of different data sources that you can search using a single endpoint.
collection = graffo.collections.create(name="My First Collection")
print(f"Created collection: {collection.readable_id}")const collection = await graffo.collections.create({name: "My First Collection"});
console.log(`Created collection: ${collection.readable_id}`);curl -X POST 'https://api.graffo.io/collections' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "My First Collection"
}'A source connection links a specific app or database to your collection. It handles authentication and automatically syncs data.
source_connection = graffo.source_connections.create(
name="My Stripe Connection",
short_name="stripe",
readable_collection_id=collection.readable_id,
authentication={
"credentials": {
"api_key": "your_stripe_api_key" # Replace with real API key
}
}
)
print(f"Status: {source_connection.status}")const sourceConnection = await graffo.sourceConnections.create({
name: "My Stripe Connection",
short_name: "stripe",
readable_collection_id: collection.readable_id,
authentication: {
credentials: {
api_key: "SK_TEST_YOUR_STRIPE_API_KEY"
}
}
});
console.log(`Status: ${sourceConnection.status}`);curl -X POST 'https://api.graffo.io/source-connections' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "My Stripe Connection",
"short_name": "stripe",
"readable_collection_id": "my-first-collection-abc123",
"authentication": {
"credentials": {
"api_key": "SK_TEST_YOUR_STRIPE_API_KEY"
}
}
}'You can now search your collection and get the most relevant results from all connected sources.
results = graffo.collections.search(
readable_id=collection.readable_id,
query="Find returned payments from user John Doe?",
)
for result in results.results:
print(result)const results = await graffo.collections.search(
collection.readable_id,
{ query: "Find returned payments from user John Doe?" }
);
results.results.forEach(result => {
console.log(result);
});curl -X GET 'https://api.graffo.io/collections/my-first-collection-abc123/search?query=Find%20returned%20payments%20from%20user%20John%20Doe%3F' \
-H 'x-api-key: YOUR_API_KEY'You've now successfully set up Graffo, connected your first data source, and searched your first collection. To continue, you can explore more integrations and dive into the API reference. For support, check out the link below.
Explore our comprehensive API documentation.
View endpoints, examples, and integration guides.Get help from our team and community.
Share feedback and feature requests.Last updated
