# Get started with Consensus API Source: https://docs.consensus.app/api-get-started Search over 220 million peer-reviewed research papers with the Consensus REST API. The Consensus API lets you search 220+ million peer-reviewed papers over a single REST endpoint. Send a query and get back ranked papers with titles, authors, journals, publication years, citation counts, and direct links. **Base URL** ``` https://api.consensus.app ``` ## Authentication Every request must include your API key in the `x-api-key` header. ```http theme={null} x-api-key: YOUR_API_KEY ``` Don't have a key yet? Request API access at [consensus.app/home/api](https://consensus.app/home/api). ## Make your first request Pass a `query` — the only required parameter. Store your key in an environment variable named `CONSENSUS_API_KEY` first. ```bash cURL theme={null} curl "https://api.consensus.app/v1/search?query=creatine%20and%20cognitive%20function" \ -H "x-api-key: $CONSENSUS_API_KEY" ``` ```python Python theme={null} import os import requests resp = requests.get( "https://api.consensus.app/v1/search", headers={"x-api-key": os.environ["CONSENSUS_API_KEY"]}, params={"query": "creatine and cognitive function"}, ) resp.raise_for_status() for paper in resp.json()["results"]: print(paper["title"], "—", paper["journal_name"], paper["publish_year"]) ``` ```javascript JavaScript theme={null} const params = new URLSearchParams({ query: "creatine and cognitive function" }); const resp = await fetch(`https://api.consensus.app/v1/search?${params}`, { headers: { "x-api-key": process.env.CONSENSUS_API_KEY }, }); const { results } = await resp.json(); for (const paper of results) { console.log(paper.title, "—", paper.journal_name, paper.publish_year); } ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "net/http" "net/url" "os" ) func main() { req, _ := http.NewRequest("GET", "https://api.consensus.app/v1/search", nil) req.Header.Set("x-api-key", os.Getenv("CONSENSUS_API_KEY")) req.URL.RawQuery = url.Values{"query": {"creatine and cognitive function"}}.Encode() resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var body struct { Results []struct { Title string `json:"title"` JournalName string `json:"journal_name"` PublishYear int `json:"publish_year"` } `json:"results"` } json.NewDecoder(resp.Body).Decode(&body) for _, paper := range body.Results { fmt.Printf("%s — %s %d\n", paper.Title, paper.JournalName, paper.PublishYear) } } ``` ```php PHP theme={null} response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); // Parse response.body() with your preferred JSON library (Jackson, Gson, ...) System.out.println(response.body()); } } ``` ## Next steps Full parameter list, response schema, and interactive playground. Client code, examples, and issues for the Consensus API. Prefer a no-code path? Connect Consensus to Claude, ChatGPT, and other MCP clients. Explore the Consensus research platform. # Query for relevant papers. Source: https://docs.consensus.app/api-reference/query-for-relevant-papers /openapi.json get /v1/search The supported endpoint for searching academic papers. Use this instead of the legacy `/v1/quick_search` endpoint, which is deprecated and will be removed on 2027-02-07. # Query for relevant papers (legacy). Source: https://docs.consensus.app/api-reference/query-for-relevant-papers-legacy /openapi.json get /v1/quick_search This endpoint is deprecated. Use `GET /v1/search` instead. It will be removed on 2027-02-07. # Get started with Consensus MCP Source: https://docs.consensus.app/consensus-mcp The Consensus MCP server enables AI assistants like ChatGPT, Claude, Gemini Spark, and other MCP-compatible clients to search over 220 million peer-reviewed academic research papers directly from the conversation. Consensus MCP lets AI assistants search 220+ million peer-reviewed research papers. Connect your preferred client below. You'll be searching in under 2 minutes **Server URL** ```text theme={null} https://mcp.consensus.app/mcp ``` Add Consensus from the Claude connectors directory. Add Consensus from the ChatGPT app directory. ## Connect Your Client **One-click:** open [Consensus in the Claude directory](https://claude.ai/directory/65247229-f0c7-49df-9044-fcbb8b3894c6) and click **Connect**. Or connect manually: Open [claude.ai](https://claude.ai) or the Claude desktop app and go to **Settings**. Select **Connectors**, then **Browse connectors**. Search for **Consensus** and click **Connect**. Approve the sign-in with your Consensus account, or continue without one at reduced limits. Ask a research question in any chat. Consensus appears in the tools menu. ```bash theme={null} claude mcp add --transport http consensus https://mcp.consensus.app/mcp ``` OAuth will open in your browser automatically on first use. You can also trigger it manually with the `/mcp` command inside Claude Code. **One-click:** open [Consensus in the ChatGPT app directory](https://chatgpt.com/plugins/plugin_asdk_app_6943e6f4a928819195962de16fb9ffe4) and click **Connect**. Or connect manually: Open [chatgpt.com](https://chatgpt.com) and sign in. Open **Apps** from the sidebar, search for **Consensus**, and click **Connect**. Sign in with your Consensus account when prompted. Ask a research question, or call it by name: "Use Consensus to find RCTs on…" Search results display in an interactive widget showing top papers with citations and direct links. Consensus also works with ChatGPT Deep Research. See [Using Consensus with ChatGPT Deep Research](#using-consensus-with-chatgpt-deep-research) below. ```bash theme={null} codex mcp add consensus --url https://mcp.consensus.app/mcp codex mcp login consensus ``` Or add to `~/.codex/config.toml`: ```toml theme={null} [mcp_servers.consensus] url = "https://mcp.consensus.app/mcp" ``` **One-click:** [Install in Cursor](https://cursor.com/en/install-mcp?name=consensus\&config=eyJ1cmwiOiJodHRwczovL21jcC5jb25zZW5zdXMuYXBwL21jcCJ9). Or add to `~/.cursor/mcp.json`: ```json theme={null} { "mcpServers": { "consensus": { "command": "npx", "args": ["-y", "mcp-remote@latest", "https://mcp.consensus.app/mcp"] } } } ``` Add to your MCP configuration: ```json theme={null} { "servers": { "consensus": { "url": "https://mcp.consensus.app/mcp" } } } ``` Add to your MCP configuration: ```json theme={null} { "mcpServers": { "consensus": { "serverUrl": "https://mcp.consensus.app/mcp" } } } ``` Add Consensus as a custom app for Gemini Spark: Go to [gemini.google.com](https://gemini.google.com) and sign in with a personal Google Account, then click **Settings & help** → **Connected Apps**. Under **Custom apps for Spark**, click **Add a custom app** and paste the server URL: ```text theme={null} https://mcp.consensus.app/mcp ``` Click **Next** and follow the prompts to finish OAuth. If your client doesn't support Dynamic Client Registration, expand **Advanced features** and enter your credentials. Ask Gemini Spark a research question and it can call Consensus tools. Requires access to Gemini Spark, a personal Google Account, Keep Activity turned on, and is currently available in the US. Workspace and school accounts are not supported yet. **One-click:** install [Consensus for Copilot](https://marketplace.microsoft.com/en-us/product/WA200011861) from the Microsoft Marketplace.