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.1.tar.gz (6.1 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.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lightreel-0.1.1.tar.gz
  • Upload date:
  • Size: 6.1 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.1.tar.gz
Algorithm Hash digest
SHA256 7ddb56cc6270ee53e1b0e9dc06688d2a5d79454331117eefe37be6981f3a57f0
MD5 ff84ec140c097de6a212c3f67b9f5bdc
BLAKE2b-256 6cc24498ce12c803fd72986bcc9849940c2955b86700a125e164ee64f99c870e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightreel-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 805eef428818f935e50161575caa0ca76f92eabe56f36f921eab9b1895b36aa9
MD5 7cafee0b1317d7fe31e374125bc497c2
BLAKE2b-256 cf62dca7459d595f4ab18ceab93e8a0d436c2d3e3eedc39cca498fbe4b2055ca

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