google-developer-knowledge-api
Original:🇺🇸 English
Translated
1 scriptsChecked / no sensitive code detected
Access Google's developer documentation programmatically using the Developer Knowledge REST API. Use when you need to search, retrieve, or reference official Google documentation (Firebase, Android, Cloud, Gemini, etc.) via direct HTTP calls instead of MCP.
6installs
Sourcejarmen423/skills
Added on
NPX Install
npx skill4agent add jarmen423/skills google-developer-knowledge-apiTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Google Developer Knowledge API
Direct REST API access to Google's public developer documentation without needing the MCP server.
Overview
The Developer Knowledge API provides machine-readable access to Google's developer docs. It offers:
- SearchDocumentChunks: Find relevant page URIs and content snippets
- GetDocument: Fetch full content of a single document
- BatchGetDocuments: Fetch multiple documents at once
Authentication
IMPORTANT: Despite official documentation suggesting API keys work, the API actually requires OAuth2 authentication (access tokens or ADC).
Option 1: Application Default Credentials (Recommended)
- Install gcloud CLI if not already installed
- Run:
bash
gcloud auth application-default login - Enable the API in your project:
- Open Developer Knowledge API page
- Select your project and click Enable
Option 2: Service Account
- Create a service account in Google Cloud Console
- Download the JSON key file
- Set the environment variable:
bash
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
Option 3: Access Token
Get a token manually:
bash
gcloud auth application-default print-access-tokenAPI Reference
Base URL:
https://developerknowledge.googleapis.com/v1alphaAll requests require an header.
Authorization: Bearer <token>Search for Document Chunks
bash
GET /documents:searchDocumentChunks?query={query}Parameters:
- (required): Search query string
query - (optional): Number of results per page
pageSize - (optional): Token for pagination
pageToken
Response includes:
- : Array of matching chunks
documentChunks[]- : Document identifier (use for GetDocument)
parent - : Snippet of matching content
content - : Original documentation URL
uri
Get Single Document
bash
GET /{document_name}Parameters:
- : The
document_namevalue from search results (e.g.,parent)documents/developers.google.com/...
Response: Full Markdown content of the document
Batch Get Documents
bash
POST /documents:batchGetBody (JSON):
json
{
"names": [
"documents/developers.google.com/path/to/doc1",
"documents/developers.google.com/path/to/doc2"
]
}Retrieves up to 100 documents in a single call.
Python Client
See for a ready-to-use Python client with automatic OAuth2 handling.
scripts/developer_knowledge_client.pyInstallation Requirements
bash
pip install google-auth google-auth-httplib2Or use the gcloud CLI fallback (no extra dependencies).
Quick Usage
python
from developer_knowledge_client import DeveloperKnowledgeClient
# Uses Application Default Credentials automatically
client = DeveloperKnowledgeClient()
# Search for documentation
results = client.search("Cloud Storage buckets")
for chunk in results.get("documentChunks", []):
print(f"URL: {chunk.get('uri')}")
print(f"Content: {chunk.get('content')[:200]}...")
# Get full document
doc = client.get_document(chunk["parent"])
print(doc.get("content"))Explicit Authentication
python
# Using service account
client = DeveloperKnowledgeClient(service_account_file="/path/to/sa.json")
# Using explicit access token
client = DeveloperKnowledgeClient(access_token="ya29.xxxx")Convenience Method
python
# Search and fetch full documents in one call
docs = client.search_and_get("Firebase authentication", max_results=3)
for doc in docs:
print(doc["content"])cURL Examples
Get Access Token
bash
export TOKEN=$(gcloud auth application-default print-access-token)Search
bash
curl -H "Authorization: Bearer $TOKEN" \
"https://developerknowledge.googleapis.com/v1alpha/documents:searchDocumentChunks?query=BigQuery"Get Document
bash
curl -H "Authorization: Bearer $TOKEN" \
"https://developerknowledge.googleapis.com/v1alpha/documents/developers.google.com/path/to/doc"Covered Documentation
The API indexes these Google developer sites:
- developer.android.com (Android)
- firebase.google.com (Firebase)
- docs.cloud.google.com (Google Cloud)
- ai.google.dev (Gemini API / Google AI)
- developers.google.com (Ads, Maps, YouTube, etc.)
- developer.chrome.com (Chrome)
- developers.home.google.com (Google Home)
- www.tensorflow.org (TensorFlow)
- web.dev (Web)
- fuchsia.dev (Fuchsia)
Limitations
- Authentication: Requires OAuth2 (API keys do NOT work despite documentation)
- Markdown Quality: Generated from HTML, may have formatting issues
- Content Scope: Only public documentation pages, no GitHub/OSS/blogs/YouTube
- Data Freshness: Re-indexed within 24 hours of publication
When to Use This Instead of MCP
Use direct API calls when:
- MCP authentication is failing or not configured
- You need more control over request/response handling
- You're integrating into a pipeline that doesn't support MCP
- You want to use the API in a standalone script
- You need to handle OAuth2 tokens explicitly