Skip to main content

CrowTerminal Python SDK

External Brain for AI Agents - Persistent memory for AI agents working with creators.

While your agent stores 10-50 lines of context, CrowTerminal stores 6 months of versioned history.

Installation

pip install crowterminal

Quick Start

from crowterminal import CrowTerminal

# Initialize with your API key
client = CrowTerminal("ct_your_api_key")

# Get memory for a creator
skill = client.memory.get("client_123")
print(f"Niche: {skill.primary_niche}")
print(f"Engagement: {skill.avg_engagement}%")
print(f"Best hooks: {skill.hook_patterns}")

Self-Registration

Don't have an API key? Register programmatically:

from crowterminal import CrowTerminal

# This creates a new API key and returns an initialized client
client = CrowTerminal.register(
    agent_name="MyBot",
    agent_description="Content optimization agent"
)
# API key is printed - save it!

Core Features

Memory Operations

# Get current skill
skill = client.memory.get("client_123")

# Get version history
versions = client.memory.get_versions("client_123", limit=10)

# Compare versions
diff = client.memory.get_diff("client_123", from_version=5, to_version=10)

# Track a field over time
pattern = client.memory.get_pattern("client_123", field="avgEngagement")
print(f"Trend: {pattern['trend']}")  # increasing, decreasing, stable

Validate Before Changing (Prevent Mistakes)

result = client.memory.validate("client_123", [
    {"field": "hookPatterns", "oldValue": ["POV"], "newValue": ["tutorial"]}
])

if result.validation == "blocked":
    print("Don't make this change!")
    for warning in result.warnings:
        print(f"  - {warning['message']}")

Engagement Analysis (The Killer Feature)

analysis = client.memory.engagement_analysis("client_123", {
    "hookPatterns": ["confession"],
    "contentStyle": "casual",
    "primaryNiche": "fitness"
})

print(f"Peak engagement: {analysis.peak_engagement}%")
print(f"Your similarity to top performers: {analysis.similarity_to_top}")

for rec in analysis.recommendations:
    print(f"Recommendation: {rec}")

Data Ingestion (Push Your Data)

Push platform data we can't access via API:

# Push retention data from TikTok Studio
client.data.ingest(
    client_id="client_123",
    platform="TIKTOK",
    data_type="retention",
    video_id="video_456",
    data={
        "retentionCurve": [100, 95, 88, 75, 60, 45, 30],
        "avgWatchTime": 12.5,
        "completionRate": 0.30
    }
)

# Push demographics
client.data.ingest(
    client_id="client_123",
    platform="TIKTOK",
    data_type="demographics",
    data={
        "ageGroups": {"18-24": 45, "25-34": 35, "35-44": 15, "45+": 5},
        "genderSplit": {"male": 40, "female": 58, "other": 2},
        "topCountries": ["BR", "US", "PT"]
    }
)

# Bulk ingest (up to 50 items)
client.data.ingest_bulk([
    {"clientId": "client_123", "platform": "TIKTOK", "dataType": "retention", "data": {...}},
    {"clientId": "client_123", "platform": "TIKTOK", "dataType": "demographics", "data": {...}},
])

Intelligence (Read-Only)

# Get creator profile
profile = client.intelligence.get_profile("client_123")

# Get hook recommendations
hooks = client.intelligence.get_hooks("client_123", count=5)

# Get optimal posting times
timing = client.intelligence.get_timing("client_123")

# Get platform algorithm insights
intel = client.intelligence.get_platform_intel(["TIKTOK", "INSTAGRAM"])

Error Handling

from crowterminal import (
    CrowTerminal,
    AuthenticationError,
    RateLimitError,
    ResourceNotFoundError,
)

client = CrowTerminal("ct_your_api_key")

try:
    skill = client.memory.get("client_123")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds")
except ResourceNotFoundError:
    print("Client not found")

Webhooks (Async Notifications)

# Register a webhook
webhook = client.webhooks.register(
    url="https://your-server.com/webhook",
    events=["skill.updated", "data.ingested"]
)
print(f"Webhook ID: {webhook['id']}")
print(f"Secret (save this!): {webhook['secret']}")

# List webhooks
webhooks = client.webhooks.list()

# Delete a webhook
client.webhooks.delete(webhook_id="wh_xxx")

Service Status

# Check service health (no auth required)
status = client.status.get()
print(f"Service status: {status['status']}")
print(f"Database: {status['services']['database']['status']}")

Sandbox Testing

Use the sandbox endpoints for testing without affecting real data:

# Test without auth
import requests

# Get mock client data
response = requests.get("https://api.crowterminal.com/api/agent/sandbox/client")
print(response.json())

# Test validation
response = requests.post(
    "https://api.crowterminal.com/api/agent/sandbox/validate",
    json={"proposedChanges": [{"field": "hookPatterns", "newValue": ["tutorial"]}]}
)
print(response.json())  # Will show "blocked" response

Valid Data Types

TikTok

  • retention, demographics, traffic_sources, watch_time
  • audience_activity, follower_growth, video_performance
  • sound_performance, hashtag_performance

Instagram

  • retention, demographics, reach_sources, watch_time
  • audience_activity, follower_growth, content_interactions
  • story_metrics, reel_metrics

YouTube

  • retention, demographics, traffic_sources, watch_time
  • audience_activity, subscriber_growth, click_through_rate
  • impression_sources, end_screen_performance

License

MIT

Metadata

Release files for crowterminal 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crowterminal 0.1.0
File Size Uploaded Provenance Actions
crowterminal-0.1.0.tar.gz 10.4 kB Without provenance Details for crowterminal-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crowterminal 0.1.0
File Interpreter ABI Platform Actions
crowterminal-0.1.0-py3-none-any.whl Python 3 none any Details for crowterminal-0.1.0-py3-none-any.whl

Total release size: 19.4 kB

Release files / crowterminal-0.1.0.tar.gz

Download URL crowterminal-0.1.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
62733f12a744029f485f7c3f42fc6b75c6f891ce9b5246a74a2f67bdbbb6d47e
BLAKE2b-256 checksum
How to use checksums
3ef1f626c481466cfbf31c0874da58f7a97e20fcddbc8f18f096f6cdf392676d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / crowterminal-0.1.0-py3-none-any.whl

Download URL crowterminal-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94c1ba98adda93537b5fa8c820bd2fd5f83c793543d8451d2429a45fd573ef16
BLAKE2b-256 checksum
How to use checksums
493141aa683c09e1c8373152bbe0b0ba8a270500b60c046bbd6f1397ea4672c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for crowterminal 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page