Skip to main content

Tiny client + CLI for the Lightreel API (api.lightreel.ai). Ask Lightreel questions from your code or terminal.

Project description

lightreel

The API to answer any social media questions.

Tiny client + CLI for the Lightreel API. Ask Lightreel questions from your code or terminal.

Ask about TikTok and Instagram, find trends, creators, and more.

Zero dependencies (standard library only). Works as an import and as a CLI.

Install

pip install lightreel
# or run the CLI without installing:
pipx run lightreel "find me the top fitness hooks this week"

Use it in code

from lightreel import Lightreel

client = Lightreel(api_key="lr_live_xxx")  # or set LIGHTREEL_API_KEY

# Plain question
res = client.chat(question="find me the top fitness hooks this week")
print(res["answer"])           # prose string
print(res["conversationId"])

# Continue the conversation
client.chat(question="give me 5 more", conversation_id=res["conversationId"])

# Structured output (max 5 fields) — "answer" comes back as a dict
out = client.chat(
    question="find me the top fitness hooks this week",
    response_fields={
        "hooks":   {"type": "array",  "description": "the hook lines"},
        "summary": {"type": "string", "description": "one-paragraph recap"},
    },
)
print(out["answer"]["hooks"])

# History
client.list_chats()
client.get_chat(res["conversationId"])

Requests default to a 20-minute timeout because /v1/chat runs the agent live and can take a few minutes. Override with Lightreel(timeout=seconds).

Use it in the terminal

export LIGHTREEL_API_KEY=lr_live_xxx

lightreel "find me the top fitness hooks this week"
lightreel "give me 5 more" -c <conversationId>
lightreel "top fitness hooks" -f "hooks:array:the hook lines" -f "summary:string:one-paragraph recap"
lightreel list
lightreel get <conversationId>
Flag Meaning
-k, --key API key (or LIGHTREEL_API_KEY)
-c, --conversation continue an existing conversation
-f, --field name:type:description request structured output (repeatable, max 5; type = string|array)
--json print the raw JSON response

Errors

Non-2xx responses raise LightreelError with .status and .type.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightreel-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lightreel-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file lightreel-0.1.0.tar.gz.

File metadata

  • Download URL: lightreel-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for lightreel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f375f85a8986f57a617523dcdfc3b0d9de269b3f7d9855d1653f3b8a856c2485
MD5 73d2f096a6f3173f463e6f4bff86e27f
BLAKE2b-256 4164585daf626f5f7a76c784b3b448079da8d1d75120cb622b8299ec559e0b00

See more details on using hashes here.

File details

Details for the file lightreel-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lightreel-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for lightreel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96a11ae6d4444732e42de760446ae82eaf60ca58e2365ef7d50355c4a5c70920
MD5 4b96f390b3bdd7a2c90c12f17ae33dad
BLAKE2b-256 ff640088a8e83f678c286b0f4f46d396bbc1040f2a91bf0add5909066d0efef4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page