Skip to content

Enterprise API: Python SDK

The official GridBank Python SDK provides a type-safe, Pythonic wrapper around the REST API. Build video search, metadata retrieval, and download features with just a few lines of code.

Why Use the SDK?

  • Type hints — Full type annotations for IDE autocomplete and better development experience
  • Error handling — Automatic exception raising with detailed error messages and status codes
  • Dataclass models — Strongly-typed request/response objects
  • Zero friction — No manual header management, authentication, or JSON parsing

Installation

pip install gridbank-api

Requires: Python 3.9+

Quick Example

from gridbank_api import EnterpriseClient

# Initialize the client with your API key
client = EnterpriseClient(api_key="apik_...")

# Search for videos
results = client.search_videos(q="nature", per_page=5)

# Display results
for video in results.videos:
    print(f"{video.title} ({video.duration}s)")
    print(f"  Creator: {video.creator.name}")

What's Included

  • EnterpriseClient — Main API client with 4 core methods
  • search_videos() — Full-text video search with pagination
  • get_video() — Fetch complete video metadata (requires subscription)
  • download_video() — Generate signed download URLs (requires subscription)
  • usage_summary() — Check your account tier and download quota
  • EnterpriseAPIError — Exception class for comprehensive error handling
  • Type models — Dataclasses for all response shapes

Authentication

All requests require a Bearer token. Get your API key →

client = EnterpriseClient(api_key="apik_your_key_here")

Next Steps