集成

通过托管密钥认证调用 Exa API,完成网页搜索、内容抓取、相似页查找与异步研究任务。

它能做什么

把请求经 Maton 网关转发到 Exa API 的 search、contents、findSimilar、answer、research/v1 等端点,网关会自动注入 Exa 密钥。认证使用 MATON_API_KEY 环境变量里的 Bearer 令牌,多个连接可通过 Maton-Connection 头指定。支持 neural、keyword、auto 三种搜索模式,以及 text、highlights、summary 等内容提取选项。

什么时候用它

  • 以 neural、keyword 或 auto 模式搜索网页,单次最多返回 100 条结果
  • 按 URL 列表批量抓取正文、关键片段或 AI 生成的摘要
  • 针对具体问题获取带引用来源的 AI 回答
  • 提交异步研究任务,可选用 exa-research-fast、exa-research 或 exa-research-pro 模型,并轮询或流式获取结果

技能文档

Exa

Access the Exa API with managed API key authentication. Perform neural web searches, retrieve page contents, find similar pages, get AI-generated answers with citations, and run async research tasks.

Quick Start

# Search the web
python <<'EOF'
import urllib.request, os, json
data = json.dumps({"query": "latest AI research", "numResults": 5}).encode()
req = urllib.request.Request('https://gateway.maton.ai/exa/search', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Base URL

https://gateway.maton.ai/exa/{endpoint}

Replace {endpoint} with the Exa API endpoint (search, contents, findSimilar, answer, research/v1). The gateway proxies requests to api.exa.ai and automatically injects your API key.

Authentication

All requests require the Maton API key in the Authorization header:

Authorization: Bearer $MATON_API_KEY

Environment Variable: Set your API key as MATON_API_KEY:

export MATON_API_KEY="YOUR_API_KEY"

Getting Your API Key

  1. Sign in or create an account at maton.ai
  2. Go to maton.ai/settings
  3. Copy your API key

Connection Management

Manage your Exa API key connections at https://ctrl.maton.ai.

List Connections

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=exa&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Create Connection

python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'exa', 'method': 'API_KEY'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Open the returned url in a browser to enter your Exa API key.

Get Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Delete Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Specifying Connection

If you have multiple Exa connections, specify which one to use with the Maton-Connection header:

python <<'EOF'
import urllib.request, os, json
data = json.dumps({"query": "AI news"}).encode()
req = urllib.request.Request('https://gateway.maton.ai/exa/search', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
req.add_header('Maton-Connection', '{connection_id}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

If omitted, the gateway uses the default (oldest) active connection.

API Reference

Perform a neural web search with optional content extraction.

POST /exa/search
Content-Type: application/json

{
  "query": "latest AI research papers",
  "numResults": 10
}

Request Parameters:

ParameterTypeRequiredDescription
querystringYesSearch query string
numResultsintegerNoNumber of results (max 100, default 10)
typestringNoSearch type: neural, auto (default), keyword
categorystringNoFilter by category: company, research paper, news, tweet, personal site, financial report, people
includeDomainsarrayNoOnly include these domains
excludeDomainsarrayNoExclude these domains
startPublishedDatestringNoISO 8601 date filter (after)
endPublishedDatestringNoISO 8601 date filter (before)
contentsobjectNoContent extraction options (see below)

Contents Options:

{
  "contents": {
    "text": true,
    "highlights": true,
    "summary": true
  }
}
OptionTypeDescription
textboolean/objectExtract full page text
highlightsboolean/objectExtract relevant snippets
summaryboolean/objectGenerate AI summary

Response:

{
  "requestId": "abc123",
  "resolvedSearchType": "neural",
  "results": [
    {
      "id": "https://example.com/article",
      "title": "Article Title",
      "url": "https://example.com/article",
      "publishedDate": "2024-01-15T00:00:00.000Z",
      "author": "Author Name",
      "text": "Full page content...",
      "highlights": ["Relevant snippet 1", "Relevant snippet 2"],
      "summary": "AI-generated summary..."
    }
  ],
  "costDollars": {
    "total": 0.005
  }
}

Get Contents

Retrieve full page contents for specific URLs.

POST /exa/contents
Content-Type: application/json

{
  "ids": ["https://example.com/page1", "https://example.com/page2"],
  "text": true
}

Request Parameters:

ParameterTypeRequiredDescription
idsarrayYesList of URLs to fetch content from
textbooleanNoInclude full page text
highlightsboolean/objectNoInclude relevant snippets
summaryboolean/objectNoGenerate AI summary

Response:

{
  "requestId": "abc123",
  "results": [
    {
      "id": "https://example.com/page1",
      "url": "https://example.com/page1",
      "title": "Page Title",
      "text": "Full page content..."
    }
  ]
}

Find Similar

Find pages similar to a given URL.

POST /exa/findSimilar
Content-Type: application/json

{
  "url": "https://example.com",
  "numResults": 10
}

Request Parameters:

ParameterTypeRequiredDescription
urlstringYesURL to find similar pages for
numResultsintegerNoNumber of results (max 100, default 10)
includeDomainsarrayNoOnly include these domains
excludeDomainsarrayNoExclude these domains
contentsobjectNoContent extraction options

Response:

{
  "requestId": "abc123",
  "results": [
    {
      "id": "https://similar-site.com",
      "title": "Similar Site",
      "url": "https://similar-site.com",
      "score": 0.95
    }
  ],
  "costDollars": {
    "total": 0.005
  }
}

Answer

Get an AI-generated answer to a question with citations.

POST /exa/answer
Content-Type: application/json

{
  "query": "What is machine learning?",
  "text": true
}

Request Parameters:

ParameterTypeRequiredDescription
querystringYesQuestion to answer
textbooleanNoInclude source text in response

Response:

{
  "requestId": "abc123",
  "answer": "Machine learning is a subset of artificial intelligence...",
  "citations": [
    {
      "id": "https://example.com/ml-guide",
      "url": "https://example.com/ml-guide",
      "title": "Machine Learning Guide"
    }
  ]
}

Research Tasks

Run asynchronous research tasks that explore the web, gather sources, and synthesize findings with citations.

Create Research Task

POST /exa/research/v1
Content-Type: application/json

{
  "instructions": "What are the top AI companies and their main products?",
  "model": "exa-research"
}

Request Parameters:

ParameterTypeRequiredDescription
instructionsstringYesWhat to research (max 4096 chars)
modelstringNoModel to use: exa-research-fast, exa-research (default), exa-research-pro
outputSchemaobjectNoJSON Schema for structured output

Response:

{
  "researchId": "r_01abc123",
  "createdAt": 1772969504083,
  "model": "exa-research",
  "instructions": "What are the top AI companies...",
  "status": "running"
}

Get Research Task

GET /exa/research/v1/{researchId}

Query Parameters:

ParameterTypeDescription
eventsstringSet to true to include event log
streamstringSet to true for SSE streaming

Response (completed):

{
  "researchId": "r_01abc123",
  "status": "completed",
  "createdAt": 1772969504083,
  "finishedAt": 1772969520000,
  "model": "exa-research",
  "instructions": "What are the top AI companies...",
  "output": {
    "content": "Based on my research, the top AI companies are..."
  },
  "costDollars": {
    "total": 0.15,
    "numSearches": 5,
    "numPages": 20,
    "reasoningTokens": 1500
  }
}

Status values: pending, running, completed, canceled, failed

List Research Tasks

GET /exa/research/v1?limit=10

Query Parameters:

ParameterTypeDescription
limitintegerResults per page (1-50, default 10)
cursorstringPagination cursor

Response:

{
  "data": [
    {
      "researchId": "r_01abc123",
      "status": "completed",
      "model": "exa-research",
      "instructions": "What are the top AI companies..."
    }
  ],
  "hasMore": false,
  "nextCursor": null
}

Code Examples

JavaScript

// Search with content extraction
const response = await fetch('https://gateway.maton.ai/exa/search', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.MATON_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    query: 'latest AI news',
    numResults: 5,
    contents: { text: true, highlights: true }
  })
});
const data = await response.json();

Python

import os
import requests

# Search with content extraction
response = requests.post(
    'https://gateway.maton.ai/exa/search',
    headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
    json={
        'query': 'latest AI news',
        'numResults': 5,
        'contents': {'text': True, 'highlights': True}
    }
)
data = response.json()

Notes

  • Search types: neural (semantic), auto (hybrid), keyword (traditional)
  • Maximum 100 results per search request
  • Content extraction (text, highlights, summary) incurs additional costs
  • Categories like people and company have restricted filter support
  • Timestamps are in ISO 8601 format
  • IMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments

Error Handling

StatusMeaning
400Missing Exa connection or invalid request
401Invalid or missing Maton API key
429Rate limited
4xx/5xxPassthrough error from Exa API

Resources

常见问题

Exa 的 API 密钥是如何管理的?
由 Maton 网关托管。请求时只需携带 MATON_API_KEY 的 Bearer 令牌,网关会注入实际的 Exa 密钥;存在多个连接时,可用 Maton-Connection 头指定使用哪一个。
支持哪些 Exa 端点?
共有五个:/exa/search、/exa/contents、/exa/findSimilar、/exa/answer,以及用于创建、查询、列出异步研究任务的 /exa/research/v1。
研究任务支持结构化输出吗?
支持。/exa/research/v1 端点接受 JSON Schema 格式的 outputSchema 参数,任务完成后会按该结构返回合成结果。

相关技能

通过 Maton 网关调用 Tavily API,完成网页搜索、内容提取、站点爬取与异步研究任务。

30 次安装

Plan Exa neural web searches before calling any Exa wrapper — craft queries, pick categories, set domain/date filters, define fallbacks, and decide when Exa...

1 次安装

通过托管认证调用 Firecrawl API,提供网页抓取、整站爬取、URL 发现和带正文内容的搜索能力。

95 次安装1 星标

通过托管 OAuth 代理接入 Google Search Console,查询搜索分析数据、管理 sitemap 并查看站点表现。

265 次安装10 星标

通过 Brave Search API 完成网页、图片、新闻与视频搜索,认证由网关托管。

44 次安装

通过托管认证接入 Apify API,运行爬虫并管理 actors、数据集、键值存储与定时任务。

26 次安装