CaptureKit

Run a competitor audit across multiple pages

Analyze several competitor pages with one prompt and save a report.

Analyze several competitor landing pages with a consistent prompt and save the results as a structured report.

import json
import os
import time
import requests

API_KEY = os.environ["CAPTUREKIT_API_KEY"]


def get(path, params):
    response = requests.get(f"https://api.capturekit.dev{path}", headers={"x-api-key": API_KEY}, params=params)
    if not response.ok:
        raise SystemExit(f"Error {response.status_code}: {response.text}")
    return response.json()


PROMPT = "Focus on the value proposition, the target audience and the main features."

COMPETITORS = [
    {"name": "Stripe", "url": "https://stripe.com"},
    {"name": "Paddle", "url": "https://paddle.com"},
    {"name": "Lemonsqueezy", "url": "https://lemonsqueezy.com"},
]
report = []

for competitor in COMPETITORS:
    data = get("/v1/analyze", {"url": competitor["url"], "custom_prompt": PROMPT})["data"]
    report.append({
        "competitor": competitor["name"],
        "url": competitor["url"],
        "value_proposition": data.get("valueProposition"),
        "target_audience": data.get("targetAudience"),
        "key_features": data.get("keyFeatures", []),
    })
    print(f"✓ {competitor['name']} analyzed")
    time.sleep(2)

with open("competitor_audit.json", "w", encoding="utf-8") as file:
    json.dump(report, file, indent=2)
print("Report saved to competitor_audit.json")

To get fields of your own in the answer, pass them in custom_response, a JSON object written as a string, for example {"sentiment": "sentiment", "language": "language"}.