The Developer Knowledge API provides programmatic access to Google's public developer documentation, enabling you to integrate this knowledge base into your own applications and workflows.
Overview
The Developer Knowledge API is designed to be the canonical source for machine-readable access to Google's developer documentation. It offers functions to search and retrieve documents, and answer queries:
SearchDocumentChunksto find relevant page URIs and content snippets based on a query.GetDocumentorBatchGetDocumentsto fetch the full content of the search result(s).AnswerQueryto generate answers to queries drawn from the documentation corpus.
The Developer Knowledge API supports searching and retrieving documentation pages as unstructured Markdown content. The corpus of searchable content is listed in the Corpus reference.
Ways to use Developer Knowledge
You can access Developer Knowledge through the following surfaces depending on your workflow:
- REST API and RPC API: call the HTTP or gRPC endpoints directly. Refer to the REST reference and RPC reference for method specifications.
- Client libraries: integrate the Developer Knowledge API into your applications using official client libraries for Python, Node.js and TypeScript, Go, Java, PHP, and Ruby.
- Google Cloud CLI (
gcloud): rungcloud developer-knowledgecommands from your terminal to search document chunks, fetch Markdown content, and generate answers. - Developer Knowledge MCP server: connect your AI coding assistant or agent
to Google's documentation using Model Context Protocol (MCP) tools
(
search_documents,get_documents, andanswer_query). Refer to the MCP reference.
Choose between the API and the MCP server
The Developer Knowledge API and the Developer Knowledge MCP server are designed for different integration needs:
- Use the Developer Knowledge API, client libraries, or gcloud CLI when:
- Your project doesn't use an AI agent.
- You want to define custom tools or tool sets for your agent.
- You want to process or combine results before passing them to a model (for example, checking document byte length before fetching full content).
- You need to filter search results
(such as by
data_sourceorupdate_time) or apply field masks.
- Use the Developer Knowledge MCP server and agent skill when:
- You want to connect an AI coding assistant or agent without writing custom tool definitions and descriptions.
- You want automatic updates as the Developer Knowledge MCP server adds new capabilities.
- You don't need custom metadata filtering on search results.
Enable the API
To use the Developer Knowledge API, you first need to enable it for your Google Cloud project.
- Open the Developer Knowledge API page in the Google APIs library.
- Check that you have the correct project selected in which you intend to use the API.
- Click Enable. No specific IAM roles are required to enable or use the API.
Authentication
You can authenticate requests to the Developer Knowledge API using one of the following methods:
- API key: authenticate direct REST requests or
the Developer Knowledge MCP server using the
keyquery parameter or theX-Goog-Api-Keyheader. - Application Default Credentials (ADC), OAuth 2.0, or service accounts: authenticate requests when using the official client libraries or production workflows. To learn more about setting up credentials, refer to the Application Default Credentials documentation.
- User credentials (gcloud CLI): authenticate CLI requests by
signing in to your Google Cloud account with
gcloud auth login. Refer to the gcloud CLI quickstart for setup instructions.
Included documentation
Refer to Corpus reference for information about which documents are searched by the API.
The Developer Knowledge API aims to provide access to the latest Google developer documentation. Our goal is to re-index content within 48 hours of publication so that new or updated documentation is available within 2 business days.Known limitations
- Markdown Quality: The Markdown is generated from the source HTML. There might be some discrepancies or formatting issues.
- Content Scope: Only public pages on the Corpus reference are included. Content from other sources like GitHub, OSS sites, blogs, or YouTube is not included.