The Official Python SDK for the B2Brilliant Campaign Agent API
Project description
B2B Campaign Agent Python SDK
A Python client for the B2B Campaign Agent API that helps you generate personalized B2B campaigns by analyzing business websites and social media profiles.
Want to Join The Beta?
Visit here to register for beta access!
Installation
pip install b2brilliant-sdk
Basic Usage
from b2brilliant_sdk import B2BrilliantAgent
# Initialize with your API key
agent = B2BrilliantAgent(api_key="your-api-key")
# Discover information about your business
user_business = agent.user.discover([
"https://yourbusiness.com"
])
# Discover information about a target business
target_business = agent.business.discover([
"https://targetbusiness.com"
])
# Generate campaigns (email, DM, SMS)
campaigns = agent.campaigns.create(
user_business,
target_business,
["email", "dm", "sms"]
)
# Use the generated campaigns
print(campaigns)
API Reference
Initialization
from b2brilliant_sdk import B2BrilliantAgent
agent = B2BrilliantAgent(api_key="your-api-key")
User Business Methods
Discover User Business Information
options = {
"find_competitors": True,
"find_branding": True,
"deep_search": False
}
user_business = agent.user.discover(
["https://yourbusiness.com", "https://yourbusiness.com/about"],
options
)
Refine User Business Information
refined_business = agent.user.refine(
user_business,
"We recently launched a new service called 'Advanced Analytics'"
)
Target Business Methods
Discover Target Business Information
target_business = agent.business.discover(
["https://targetbusiness.com"],
{"find_branding": True}
)
Refine Target Business Information
refined_target = agent.business.refine(
target_business,
"They recently announced a Series B funding round"
)
Assess Business Compatibility
compatibility = agent.business.compatibility(
user_business,
target_business
)
print(f"Compatibility score: {compatibility['score']}")
print("Positives:", compatibility["reasoning"]["positives"])
print("Negatives:", compatibility["reasoning"]["negatives"])
print("Recommendations:", compatibility["reasoning"]["recommendations"])
Campaign Methods
Create Campaign
# Generate all campaign types
all_campaigns = agent.campaigns.create(
user_business,
target_business
)
# Generate only specific campaign types
campaign_types = ["email", "dm"]
specific_campaigns = agent.campaigns.create(
user_business,
target_business,
campaign_types
)
Refine Campaign
refined_campaigns = agent.campaigns.refine(
user_business,
target_business,
all_campaigns,
"Make the tone more professional and focus on their recent funding"
)
Error Handling
The SDK raises typed exceptions that can be caught and handled:
from b2brilliant_sdk.exceptions import ApiError, ValidationError
try:
campaigns = agent.campaigns.create(user_business, target_business)
except ApiError as e:
print(f"API error ({e.status}): {e.message}")
print("Error data:", e.data)
except ValidationError as e:
print("Validation error:", e.validation_errors)
except Exception as e:
print("Unexpected error:", e)
Data Structures
The SDK works with the following key data structures:
BusinessObject
{
"profile": {
"name": str,
"summary": str,
"services": List[str],
"current_events": str,
"target_audience": str,
"industry": str
},
"contacts": {
"point_of_contact": { # Optional
"name": str,
"position": str
},
"social": List[Dict], # List of social channels
"email": str,
"phone": str
},
"branding": {
"voice": str,
"tone": str,
"style": str,
"phrases": List[str]
},
"competitors": List[Dict], # Optional
"confidence": {
"score": float, # 0-10
"reasoning": str
}
}
CampaignObject
{
"target_business": str,
"user_business": str,
"campaigns": [
{
"type": str, # "dm", "email", or "sms"
"content": str,
"rating": float,
"feedback": {
"strengths": List[str],
"weaknesses": List[str],
"suggestions": List[str]
}
}
]
}
BusinessCompatibilityScore
{
"target_business": str,
"user_business": str,
"score": float,
"reasoning": {
"positives": List[str],
"negatives": List[str],
"recommendations": List[str]
}
}
License
This software is licensed under the Business Source License 1.1 (BSL).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file b2brilliant_sdk-0.1.2.tar.gz.
File metadata
- Download URL: b2brilliant_sdk-0.1.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5b15b6efe86fdfea805fa78d536d124f47f5e0ffd8bd0beee0c0deb43db0936
|
|
| MD5 |
db0f998bddf3a7c08e9f8f6b64b0449e
|
|
| BLAKE2b-256 |
2e2ae4e09f1614c8212aced5c37ad66cac757ca295ad920acd24cad27ed16380
|
File details
Details for the file b2brilliant_sdk-0.1.2-py3-none-any.whl.
File metadata
- Download URL: b2brilliant_sdk-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdd8fc5ae88845526756d14d0e7367c74f3e1c2f84c0e5763d5df2e0a5156e8b
|
|
| MD5 |
f10da47521e974ba1d5d06175e73ffe7
|
|
| BLAKE2b-256 |
054446e89b39bddc4e47e60d70e842b25c76762a057c84433393313362054833
|