Build with exa

From MoizIbnYousaf/marketing-cli · View interactive version

Build with exa is an AI agent skill from the GitHub repository MoizIbnYousaf/marketing-cli. Build applications and agents with Exa's API Platform: search, contents, answer, context, Agent API, monitors, websets, OpenAI-compatible endpoints, and exa-py / exa-js. Use when choosing Exa endpoints, writing Exa API calls, integrating semantic web search or research into products, or debugging Ex

How to use this skill

Skill file

On Activation

  1. Confirm EXA_API_KEY is available for any live API call. SDK examples assume the key is set.
  2. Default new integrations to POST /search with type: "auto" and contents.highlights: true. Escalate to Agent API only for multi-step research / list-building.
  3. Load only the references/*.md file needed for the current endpoint - do not dump the whole tree into context.
  4. For agent-native marketing research inside mktg projects, prefer exa-search, company-research, or lead-generation over inventing a custom integration.

Build with Exa

Scope

Included by default:

Note on data retention: /search, /answer, and deep research are Zero Data Retention (ZDR). The Agent API (/agent), Websets, and Monitors are not ZDR. If a use case requires ZDR, stay on the ZDR surfaces or contact Exa.

Installation

# Python
pip install exa-py

# TypeScript / JavaScript
npm install exa-js

Authentication

export EXA_API_KEY="your_api_key_here"

Exa accepts either the x-api-key header or Authorization: Bearer <key>.

API Decision Workflow

Before picking an endpoint, decide which workflow shape fits:

Default to the search endpoint. Use the search endpoint (/search) for most new integrations, then move to a more specialized Exa surface only when the task shape clearly calls for it.

  1. Need general semantic web retrieval, synthesized output, filters, or content extraction from search results: use the search endpoint (/search)
  2. Already know the URLs and need clean page extraction or freshness controls: use the contents endpoint (/contents)
  3. Need pages related to a known seed URL: use the search endpoint (/search) with a query derived from the page (for example title, topic, or text from /contents)
  4. Need a grounded answer with citations from Exa-managed search: use the answer endpoint (/answer)
  5. Need code-focused retrieval from repos, docs, and Stack Overflow: use the context endpoint (/context)
  6. Need OpenAI SDK drop-in compatibility for chat or responses clients: use the OpenAI-compatible endpoints (/chat/completions, /responses)
  7. Need asynchronous multi-step research, list-building, enrichment, or follow-up questions over prior research: use the Agent API (/agent)
  8. Need scheduled recurring search with webhook delivery: use the Monitors API (/monitors)
  9. Need async verified and enriched entity collection workflows: use the Websets API (/websets/v0)

Quick Start

For more complete examples, see the relevant reference file in the table below.

Python (/search):

from exa_py import Exa

exa = Exa(api_key="YOUR_EXA_API_KEY")
result = exa.search(
    "latest developments in LLMs",
    type="auto",
    contents={"highlights": True}
)

for item in result.results:
    print(item.title, item.url)

TypeScript (/search):

import Exa from "exa-js";

const exa = new Exa();
const result = await exa.search("latest developments in LLMs", {
  type: "auto",
  contents: { highlights: true }
});

for (const item of result.results) {
  console.log(item.title, item.url);
}

Raw HTTP (/search):

curl -X POST "https://api.exa.ai/search" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $EXA_API_KEY" \
  -d '{
    "query": "latest developments in LLMs",
    "type": "auto",
    "contents": {
      "highlights": true
    }
  }'

Anti-Patterns

Reference Files

| File | Topics |

|------|--------|

| references/search.md | Search endpoint request/response shape, search types, filters, nested contents, structured output |

| references/contents.md | Contents endpoint extraction, freshness, statuses, top-level content fields |

| references/answer.md | Grounded answer generation with citations and structured output |

| references/context.md | Code-focused retrieval with tokensNum |

| references/agent.md | Agent API for async multi-step research, enrichment, structured output, polling, and events |

| references/openai-compat.md | OpenAI-compatible endpoints, model routing, extra_body usage |

| references/monitors.md | Standalone Monitors API for scheduled recurring search |

| references/websets.md | Websets API for async verified and enriched collection building |

| references/sdks.md | Python and TypeScript SDK naming, methods, and shape differences |

| references/http-requests.md | Minimal raw HTTP examples across major Exa surfaces |

| references/models-and-modes.md | Search type selection, answer/research model routing, latency tradeoffs |

| references/prompting-and-patterns.md | Durable query, prompting, freshness, and output-schema patterns |

| references/common-mistakes.md | Parameter-shape corrections |

Canonical Docs

Attribution

Ported from exa-labs/agent-skills - adapted for mktg's drop-in contract on 2026-07-18.

Upstream commit: 390ffee2d7e1d0dce2ed8efe4994c2b3c1c0173b

Drift detection: if the upstream skill changes, re-run mktg-steal https://github.com/exa-labs/agent-skills to evaluate the diff.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.