Python
A lightweight Python client for the NeuralSnap API using requests. Copy it into your project and start building.
Installation
Terminal
pip install requests
API Client
A lightweight Python client you can drop into any project:
neuralsnap.py
"""NeuralSnap API client for Python."""import requestsfrom typing import OptionalBASE_URL = "https://neuralsnap.ai/api/v1"class NeuralSnapClient:"""Lightweight wrapper around the NeuralSnap REST API."""def __init__(self, api_key: str):self.session = requests.Session()self.session.headers.update({"Authorization": f"Bearer {api_key}","Content-Type": "application/json",})def _request(self, method: str, path: str, **kwargs) -> dict:res = self.session.request(method, f"{BASE_URL}{path}", **kwargs)res.raise_for_status()return res.json()def create_snapshot(self, data: dict) -> dict:"""Create a new Neural Snapshot. Returns {"data": snapshot}."""return self._request("POST", "/snapshots", json=data)def list_snapshots(self,limit: int = 50,offset: int = 0,snap_type: Optional[str] = None,) -> dict:"""List snapshots. Returns {"data": [...], "count": N}."""params: dict = {"limit": limit, "offset": offset}if snap_type:params["type"] = snap_typereturn self._request("GET", "/snapshots", params=params)def get_snapshot(self, snapshot_id: str) -> dict:"""Get a single snapshot by ID. Returns {"data": snapshot}."""return self._request("GET", f"/snapshots/{snapshot_id}")def update_snapshot(self, snapshot_id: str, data: dict) -> dict:"""Update a snapshot. Returns {"data": snapshot}."""return self._request("PUT", f"/snapshots/{snapshot_id}", json=data)def delete_snapshot(self, snapshot_id: str) -> dict:"""Delete a snapshot. Returns {"data": {"success": true}}."""return self._request("DELETE", f"/snapshots/{snapshot_id}")def search(self, query: str, limit: int = 10) -> dict:"""Semantic search. Returns {"data": [...], "count": N, ...}."""return self._request("GET", "/snapshots/search",params={"q": query, "limit": limit},)def crystallize(self, text: str, source_type: str = "api") -> dict:"""Crystallize raw text into Neural Snapshots."""return self._request("POST", "/crystallize",json={"text": text, "source_type": source_type},)def get_profile(self) -> dict:"""Get your profile and usage stats. Returns {"data": {...}}."""return self._request("GET", "/profile")
Complete Working Example
example.py
"""Full NeuralSnap workflow: create, list, search, crystallize."""import osfrom neuralsnap import NeuralSnapClientclient = NeuralSnapClient(os.environ["NEURALSNAP_API_KEY"])# 1. Create a snapshot manuallyresult = client.create_snapshot({"name": "Short-form video outperforms blogs","core": "TikTok and Reels drive 3x more signups than blog posts","type": "Conviction","confidence": 0.85,"tags": ["marketing", "content", "growth"],})snap = result["data"]print(f"Created: {snap['id']}")# 2. List all snapshotsresult = client.list_snapshots(limit=10, offset=0)print(f"Found {result['count']} snapshots")for s in result["data"]:print(f" • {s['name']} ({s['type']})")# 3. Get a single snapshotsingle = client.get_snapshot(snap["id"])["data"]print(f"Fetched: {single['name']}")# 4. Update a snapshotupdated = client.update_snapshot(snap["id"], {"confidence": 0.95,"tags": ["marketing", "content", "growth", "verified"],})["data"]print(f"Updated confidence: {updated['confidence']}")# 5. Semantic searchsearch = client.search("content marketing strategy", limit=5)for r in search["data"]:print(f" [{r['similarity']}] {r['name']}")# 6. Get profileprofile = client.get_profile()["data"]print(f"Plan: {profile['plan']}, Snapshots: {profile['snapshot_count']}")# 7. Crystallize a meeting transcripttranscript = """Team standup — Jan 20 2026Sarah: Auth migration is done. Clerk is live in staging.Mike: Scoped the walkthrough component. Custom build is 2 weeksbut worth it for the polish.Dana: Simplified onboarding wireframes approved. Startingimplementation today.Sarah: Target Feb 1 for staging deploy — 3 weeks of testingbefore launch."""result = client.crystallize(transcript.strip(), source_type="conversation")snapshots = result["data"]["snapshots"]print(f"\nCrystallized {result['data']['count']} snapshots "f"({result['usage']['totalTokens']} tokens)")for s in snapshots:print(f" • {s['name']} (confidence: {s['confidence']})")# 8. Delete a snapshotclient.delete_snapshot(snap["id"])print("Deleted snapshot")
Run it
export NEURALSNAP_API_KEY="ns_live_your_key_here"python example.py
Async Support
For async Python, swap
requests for httpx and use httpx.AsyncClient with the same headers and endpoints — just add await.