Developer Knowledge API

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:

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:

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_source or update_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.

  1. Open the Developer Knowledge API page in the Google APIs library.
  2. Check that you have the correct project selected in which you intend to use the API.
  3. 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:

OAuth scopes

When authenticating with OAuth 2.0 or service accounts, the Developer Knowledge API and Developer Knowledge MCP server accept the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform: default scope used by Application Default Credentials (ADC), the gcloud CLI, and official Google Cloud client libraries.
  • https://www.googleapis.com/auth/devprofiles.full_control: scope used for user OAuth 2.0 consent flows and MCP server integrations.
  • https://www.googleapis.com/auth/developerprofiles.readonly: read-only scope supported for service accounts and credentials that don't require an end-user OAuth consent screen.

Bearer token authorization

To authenticate direct REST requests with a service account or OAuth 2.0 access token, pass the token in the Authorization: Bearer header and specify your billing project in X-Goog-User-Project:

export ACCESS_TOKEN=$(gcloud auth print-access-token)
curl -X POST "https://developerknowledge.googleapis.com/v1:answerQuery" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Goog-User-Project: PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "How do I create a BigQuery dataset?"}'

Replace PROJECT_ID with your Google Cloud project ID.

For Python, Node.js, Go, and Java applications, the official client libraries handle Application Default Credentials (ADC) and token refreshes automatically. For examples, refer to Use client libraries with the Developer Knowledge API.

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.