Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mavera.io/llms.txt

Use this file to discover all available pages before exploring further.

Scenario

G2 reviewers often include powerful recommendation quotes — “I’d recommend this to any marketing team scaling content production.” These endorsements are more credible than anything you could write. You extract recommendation text, group by use case and reviewer profile, then use Mavera to generate social proof marketing assets (testimonial cards, case study headers, email proof points) grounded in real G2 language. Flow: G2 GET /survey-responses → Extract recommendations → Mavera POST /generations → Social proof content assets

Code

import os, requests, time

G2 = os.environ["G2_API_KEY"]
MV = os.environ["MAVERA_API_KEY"]
G2_H = {"Authorization": f"Token token={G2}", "Content-Type": "application/vnd.api+json"}
MV_H = {"Authorization": f"Bearer {MV}", "Content-Type": "application/json"}

# 1. Pull reviews with recommendations
reviews = []
page = 1
while len(reviews) < 200:
    r = requests.get(f"https://data.g2.com/api/v1/survey-responses",
        headers=G2_H, params={"page[size]": 50, "page[number]": page})
    if r.status_code == 429:
        time.sleep(1); continue
    r.raise_for_status()
    data = r.json().get("data", [])
    if not data: break
    reviews.extend(data)
    page += 1
    time.sleep(0.1)

# 2. Extract high-rating recommendations
quotes = []
for rev in reviews:
    attrs = rev.get("attributes", {})
    if attrs.get("star_rating", 0) < 4:
        continue
    for key, val in attrs.get("comment_answers", {}).items():
        text = val if isinstance(val, str) else val.get("text", "")
        if ("recommend" in key.lower() or "love" in key.lower()) and len(text) > 30:
            quotes.append({
                "text": text[:300],
                "role": attrs.get("title", "User"),
                "industry": attrs.get("industry", "Technology"),
                "company_size": attrs.get("company_size", "Mid-market"),
                "star": attrs.get("star_rating", 5),
            })

# 3. Generate social proof assets
quote_block = "\n\n".join(
    f'"{q["text"]}" — {q["role"]}, {q["industry"]}, {q["company_size"]}'
    for q in quotes[:15]
)

gen = requests.post(f"https://app.mavera.io/api/v1/generations",
    headers=MV_H,
    json={
        "prompt": f"""Using these real G2 reviewer quotes, generate:

1. Five testimonial card headlines (15 words max each)
2. Three case study header lines pairing the quote with a metric
3. Five email proof-point bullets for a nurture sequence
4. Three social media post variants featuring quotes

QUOTES:
{quote_block}

Rules:
- Keep quotes verbatim or clearly attributed
- Pair quotes with role/industry for credibility
- Focus on outcomes and specificity""",
    }).json()

print("=== Social Proof Assets ===")
print(gen.get("output", gen.get("content", gen.get("text", "")))[:1500])

Example Output

=== Social Proof Assets ===

## Testimonial Card Headlines
1. "Replaced 3 tools with one platform" — VP Marketing, SaaS
2. "From data to decisions in hours, not weeks" — Product Manager, Fintech
3. "Our best hire was actually software" — CMO, E-commerce
4. "Finally, research that keeps up with our roadmap" — Head of Product, Healthcare
5. "Cut our content testing cycle from 6 weeks to 2 days" — Content Director, B2B

## Case Study Headers
1. How [Company] cut content testing from 6 weeks to 2 days (rated 5/5 on G2)
2. VP Marketing replaces 3-tool stack: "Game changer for our team of 12"
3. From 0 to persona-validated messaging in 48 hours — a Fintech story

## Email Proof Bullets
- "Replaced 3 tools with one" — VP Marketing on G2 (★★★★★)
- 4.6/5 average on G2 across 200+ reviews
- "Setup took 20 minutes, not 2 weeks" — Head of Growth

Error Handling

Always attribute quotes to role + industry, never to individual names. G2 reviews may contain PII in the text — scan and redact before publishing.
With fewer than 20 reviews, the quote pool is thin. Supplement with NPS verbatims or support ticket praise for a richer set.