Generated Ad

Produce ads based on other content from the web

Live preview

Checking API key

How it works

Each ad set is one request to Exa's /search endpoint with type: "deep". The query asks Exa to find real search intent, forum language, reviews, and recent proof points for the product and audience.

Each platform variant has its own outputSchema. Google Search returns five headlines and four descriptions. Meta returns primaryText, headline, description, and cta. LinkedIn returns introText, headline, description, and cta.

The preview renders the ad in the platform frame and shows the grounding concept alongside deduped sources.

Source code

npm install exa-js
import Exa from "exa-js";
const exa = new Exa("YOUR_API_KEY");

const topic = "Revenue forecasting for B2B SaaS CFOs";

const result = await exa.search(
  `What specific professional pain points and proof points around "${topic}" do decision-makers care about right now?`,
  {
    type: "deep",
    numResults: 12,
    systemPrompt: `Draft a LinkedIn Sponsored Content ad for "${topic}". Use real audience language from the sources. Return intro text, headline, description, CTA, and the audience insight. Respect LinkedIn character limits.`,
    outputSchema: {
      type: "object",
      required: ["audienceInsight", "introText", "headline", "description", "cta"],
      properties: {
        audienceInsight: { type: "string" },
        introText: { type: "string", description: "Max 150 characters" },
        headline: { type: "string", description: "Max 70 characters" },
        description: { type: "string", description: "Max 100 characters" },
        cta: { type: "string", description: "LinkedIn CTA value" },
      },
    },
    contents: { highlights: true },
  }
);

const ad = result.output.content;
const citations = result.output.grounding.flatMap((g) => g.citations);
Ask ExaBot