Skip to main content

widecast (Python)

Official Python SDK for WideCast.ai — generate short-form videos from a script, an idea, a blog post, or an existing video/audio clip via a clean REST API. Python 3.8+.

pip install widecast

60-second example

from widecast import Widecast

client = Widecast(api_key="wc_live_REPLACE_ME")

# source="text" — you've already written the narration (used verbatim by the narrator).
video = client.create_video(
    source="text",
    script_text=(
        "The first 10 minutes after a car crash decide whether your insurance pays — or fights you. "
        "First: pull over, hazards on; if anyone's hurt, dial 911. "
        "Second: do NOT say 'I'm sorry' at the scene — admission of fault hurts your claim. "
        "Third: take photos of both cars, both plates, the road, skid marks. "
        "Fourth: swap name, license, plate, insurance company and policy number with the other driver. "
        "Fifth: call your insurance the same day. Save this so you don't have to think when it happens."
    ),
)

print(video.review_url)            # Show the user immediately — page handles early arrival.
done = video.wait()                # Polls /v1/status with backoff (5s → 60s cap).
print(done.status, done.video_url) # 'completed' + final MP4 URL

Source routing — pick honestly

WideCast's REST API takes one of several sources depending on what you have. If you're driving the SDK from an AI agent that cannot do real research (no web search, no URL fetch, no image search), don't write the script yourself — let WideCast research and write it for you:

# source="idea" — the server researches the topic AND writes the script.
# Use this when you (or the AI driving the SDK) can't fetch the web or
# harvest image URLs to back up a "current event" script.
video = client.create_video(
    source="idea",
    idea_text="5 things every first-time driver should do right after a car accident.",
)
done = video.wait()

Other sources:

source When to use Required field
"text" You have a finished 80–500-word narration. script_text
"idea" You have a short brief (5–1000 words). Server researches + writes the script. idea_text
"blog" Repurpose an existing 30–3000-word article into a video. blog_text
"video_url" / "audio_url" Remake from an existing media URL. video_url / audio_url
"video_file" / "audio_file" Same, from a local file (multipart upload — use the SDK helper). video_file / audio_file

The full writing method (research → harvest images → 3-Layer Hook → inline media → hand-off) is a vendor-neutral skill at https://widecast.ai/skills/video-script-writing.zip — fetch it from any LLM before drafting a source="text" script.

Setup

from widecast import Widecast

# API key from env (WIDECAST_API_KEY) or explicit
client = Widecast(
    api_key="wc_live_...",
    base_url="https://widecast.ai/app/dashboard2",   # default for v0.1.0 pilot
    timeout=60.0,
    max_retries=3,
)

Methods

client.create_video(
    source,                       # "text" | "idea" | "blog" | "video_url" | "audio_url" | ...
    script_text=None,             # required when source="text"
    idea_text=None,               # required when source="idea"
    blog_text=None,               # required when source="blog"
    video_url=None, audio_url=None,
    output_type=None,             # "text" | "scene" | "video"
    language=None, faceless=None,
    callback_url=None, metadata=None, idempotency_key=None,
) -> Video

client.get_status(video_id) -> Video       # single check
client.export_video(video_id) -> Video     # render final MP4 (scene → video)

client.create_content(content, content_type="blog", language=None) -> Video
client.enhance_script(script_text, language=None, intervention_level=None) -> Video

client.suggest_ideas(industry_id=None, num_topics=None, sub_industry=None, user_location=None)
client.collect_ideas(product_service_input, sub_industry=None, user_location=None)

client.publish(topic_id=None, text=None, video_url=None, photo_urls=None, platforms=None, title=None)
client.list_videos(from_record=0)
client.search(query, limit=10)
client.account()                  # plan + credits_remaining

# Video instance
video.id              # str — widecast<alphanumeric>
video.status          # 'pending' | 'processing' | 'completed' | 'failed'
video.review_url      # str — share with user immediately (present from first response)
video.video_url       # str | None — final MP4 (output_type='video' only)
video.progress_label  # str — UX hint like "Generating scene visuals · ~7 min left"
video.is_terminal     # bool
video.wait(timeout=600.0, poll_interval=3.0)  # blocks until terminal
video["any_field"]    # dict access for everything else

See openapi.json for the full schema.

Error handling

from widecast import (
    WidecastError, InvalidRequestError, NotFoundError,
    PreconditionFailedError, RateLimitError, APIError,
)

try:
    video = client.create_video(source="text", script_text="...")
except InvalidRequestError as e:
    if e.code == "credit_exhausted":
        # HTTP 402 — show user both options
        print(f"You're out of credits on the {e.details.get('current_plan')} plan.")
        print(f"Wait until {e.details.get('reset_at')} (monthly refresh) — or upgrade now:")
        print(e.upgrade_url)   # https://widecast.ai/#pricing_plans
    else:
        print(f"Bad input: {e} (param={e.param}, request_id={e.request_id})")
except RateLimitError:
    print("Slow down, retry after a moment.")
except APIError as e:
    print(f"Server-side issue: {e.code} — share request_id={e.request_id} in support tickets.")

Every error carries e.code, e.message, e.request_id, e.doc_url, e.status. HTTP 402 (credit_exhausted / account_expired) additionally carries e.details with upgrade_url, reset_at, current_plan, credits_remaining, next_plan, etc.

More

License

Apache-2.0.

Metadata

Release files for widecast 0.1.3

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

Source distribution (sdist)

Source distribution for widecast 0.1.3
File Size Uploaded
widecast-0.1.3.tar.gz 33.0 kB Details

Built distribution (wheel)

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

Total release size: 57.9 kB

Release files / widecast-0.1.3.tar.gz

Download URL widecast-0.1.3.tar.gz
Size 33.0 kB
Tags Source
SHA-256 checksum
How to use checksums
957d9fe76040b470a34e0f9d9841d12e7d5bf564d3905b1bf5194b1eb5efa770
BLAKE2b-256 checksum
How to use checksums
939edf3298c8246962d62276783962eeb0d87bb564ffc8c397f35b4a08f37b8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / widecast-0.1.3-py3-none-any.whl

Download URL widecast-0.1.3-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9837f9cb713a2d1a02c4e6f0078165dec7fcbf69dc2663486c4188b2642ff091
BLAKE2b-256 checksum
How to use checksums
5fbe95cdd644fa8a5db22bc3605040fcf8d50b4f8900cfebe54cde88c8f363ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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