Package google.developers.knowledge.v1alpha

Index

DeveloperKnowledge

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.

The API is designed to be the canonical source for machine-readable access to Google's developer documentation.

A typical use case is to first use DeveloperKnowledge.SearchDocumentChunks to find relevant page URIs based on a query, and then use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full content of the top results.

All document content is provided in Markdown format.

BatchGetDocuments

rpc BatchGetDocuments(BatchGetDocumentsRequest) returns (BatchGetDocumentsResponse)

Retrieves multiple documents, each with its full Markdown content.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/devprofiles.full_control

For more information, see the OAuth 2.0 Overview.

GetDocument

rpc GetDocument(GetDocumentRequest) returns (Document)

Retrieves a single document with its full Markdown content.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/devprofiles.full_control

For more information, see the OAuth 2.0 Overview.

SearchDocumentChunks

rpc SearchDocumentChunks(SearchDocumentChunksRequest) returns (SearchDocumentChunksResponse)

Searches for developer knowledge across Google's developer documentation. This method returns document chunks based on the user's query. There can be many chunks of the same Document. To retrieve full documents, use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with the DocumentChunk.parent returned in the SearchDocumentChunksResponse.results.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/devprofiles.full_control

For more information, see the OAuth 2.0 Overview.

BatchGetDocumentsRequest

Request message for DeveloperKnowledge.BatchGetDocuments.

Fields
names[]

string

Required. The names of the documents to retrieve. A maximum of 20 documents can be retrieved in a batch. The documents are returned in the same order as the names in the request.

Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets

BatchGetDocumentsResponse

Response message for DeveloperKnowledge.BatchGetDocuments.

Fields
documents[]

Document

Documents requested.

Document

A Document represents a piece of content from the Developer Knowledge corpus.

Fields
name

string

Identifier. The resource name of the document. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets

uri

string

Output only. The URI of the content, such as docs.cloud.google.com/storage/docs/creating-buckets.

content

string

Output only. The full content of the document in Markdown format.

description

string

Output only. A description of the document.

DocumentChunk

A DocumentChunk represents a piece of content from a Document in the DeveloperKnowledge corpus. To fetch the entire document content, pass the parent to DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments.

Fields
parent

string

Output only. The resource name of the document this chunk is from. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets

id

string

Output only. The ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.

content

string

Output only. The content of the document chunk.

GetDocumentRequest

Request message for DeveloperKnowledge.GetDocument.

Fields
name

string

Required. The name of the document to retrieve. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets

SearchDocumentChunksRequest

Request message for DeveloperKnowledge.SearchDocumentChunks.

Fields
query

string

Required. The raw query string provided by the user, such as "How to create a Cloud Storage bucket?".

page_size

int32

Optional. The maximum number of results to return. The service may return fewer than this value.

If unspecified, at most 5 results will be returned.

The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT error.

page_token

string

Optional. A page token, received from a previous SearchDocumentChunks call. Provide this to retrieve the subsequent page.

SearchDocumentChunksResponse

Response message for DeveloperKnowledge.SearchDocumentChunks.

Fields
results[]

DocumentChunk

The search results for the given query. Each DocumentChunk in this list contains a snippet of content relevant to the search query. Use the DocumentChunk.parent field of each result with DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to retrieve the full document content.

next_page_token

string

Optional. A token that can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.