> ## 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.

# Recommendation Quotes → Social Proof Content

> Extract G2 recommendation quotes and generate social proof marketing assets with Mavera

## 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

<CodeGroup>
  ```python Python theme={"dark"}
  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])
  ```

  ```javascript JavaScript theme={"dark"}
  const G2 = process.env.G2_API_KEY;
  const MV = process.env.MAVERA_API_KEY;
  const G2_H = { Authorization: `Token token=${G2}`, "Content-Type": "application/vnd.api+json" };
  const MV_H = { Authorization: `Bearer ${MV}`, "Content-Type": "application/json" };

  // 1. Pull reviews
  const reviews = [];
  let page = 1;
  while (reviews.length < 200) {
    const res = await fetch(
      `https://data.g2.com/api/v1/survey-responses?page[size]=50&page[number]=${page}`,
      { headers: G2_H }
    );
    if (res.status === 429) { await new Promise((r) => setTimeout(r, 1000)); continue; }
    const data = (await res.json()).data || [];
    if (!data.length) break;
    reviews.push(...data);
    page++;
    await new Promise((r) => setTimeout(r, 100));
  }

  // 2. Extract quotes
  const quotes = [];
  for (const rev of reviews) {
    const attrs = rev.attributes || {};
    if ((attrs.star_rating || 0) < 4) continue;
    for (const [key, val] of Object.entries(attrs.comment_answers || {})) {
      const text = typeof val === "string" ? val : val?.text || "";
      if ((key.toLowerCase().includes("recommend") || key.toLowerCase().includes("love")) && text.length > 30) {
        quotes.push({ text: text.slice(0, 300), role: attrs.title || "User", industry: attrs.industry || "Technology" });
      }
    }
  }

  // 3. Generate
  const quoteBlock = quotes.slice(0, 15).map((q) => `"${q.text}" — ${q.role}, ${q.industry}`).join("\n\n");
  const gen = await fetch("https://app.mavera.io/api/v1/generations", {
    method: "POST", headers: MV_H,
    body: JSON.stringify({
      prompt: `From G2 quotes, generate: 1) 5 testimonial headlines 2) 3 case study headers 3) 5 email proof bullets 4) 3 social posts\n\nQUOTES:\n${quoteBlock}`,
    }),
  }).then((r) => r.json());
  console.log(gen.output || gen.content || gen.text || "");
  ```
</CodeGroup>

## Example Output

```text theme={"dark"}
=== 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

<AccordionGroup>
  <Accordion title="Quote attribution">Always attribute quotes to role + industry, never to individual names. G2 reviews may contain PII in the text — scan and redact before publishing.</Accordion>
  <Accordion title="Low review counts">With fewer than 20 reviews, the quote pool is thin. Supplement with NPS verbatims or support ticket praise for a richer set.</Accordion>
</AccordionGroup>
