Prerequisites
Stay organized with collections
Save and categorize content based on your preferences.
Before you can start coding your first client application, there are a few
things you need to do, if you haven't done them already.
Get a Google Account
You need a Google Account
in order to create a project
in the Google API Console. If you already have an account, then you're all set.
You may also want a separate Google Account for testing purposes.
Create a project for your client
Before you can send requests to Google Knowledge Graph Search API, you need to tell Google about your client and activate access to the API. You do this by using the Google API Console to create a project
, which is a named collection of settings and API access information, and register your application.
To get started using Google Knowledge Graph Search API, you need to first use
the setup tool
, which guides you through creating a project in the
Google API Console, enabling the API, and creating credentials.
If you haven't done so already, create your application's API key by clicking Create credentials > API key
. Next, look for your API key in the API
keys
section.
Learn REST basics
There are two ways to invoke the API:
If you decide not to use client libraries, you'll need to understand the basics of REST.
REST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.
The term REST is short for " Representational State Transfer
." In the context of Google APIs, it refers to using HTTP verbs to retrieve and modify representations of data stored by Google.
In a RESTful system, resources are stored in a data store; a client sends a request that the server perform a particular action (such as creating, retrieving, updating, or deleting a resource), and the server performs the action and sends a response, often in the form of a representation of the specified resource.
In Google's RESTful APIs, the client specifies an action using an HTTP verb such as POST
, GET
, PUT
, or DELETE
. It specifies a resource by a globally-unique URI of the following form:
https://www.googleapis.com/ apiName
/ apiVersion
/ resourcePath
? parameters
Because all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.
You may find the method definitions
in the HTTP 1.1 standards documentation useful; they include specifications for GET
, POST
, PUT
, and DELETE
.
REST in the Google Knowledge Graph Search API
The Google Knowledge Graph Search API operations map directly to REST HTTP verbs.
The specific formats for Google Knowledge Graph Search API URIs are:
https://kgsearch.googleapis.com/v1/entities:search?query= your_query
& parameters
The full set of URIs used for each supported operation in the API is summarized in the Google Knowledge Graph Search API Reference
document.
Learn JSON basics
The Google Knowledge Graph Search API returns data in JSON format.
JSON
(JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see json.org
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eBefore coding, ensure you have a Google Account and have created a project in the Google API Console to manage settings and API access.\u003c/p\u003e\n"],["\u003cp\u003eUnderstand REST basics, focusing on using HTTP verbs to retrieve and modify data, which the Google Knowledge Graph Search API utilizes.\u003c/p\u003e\n"],["\u003cp\u003eFamiliarize yourself with JSON, the data format used by the Google Knowledge Graph Search API for returning information.\u003c/p\u003e\n"],["\u003cp\u003eTo use the API without client libraries, learn how to send HTTP requests, parse responses, and construct RESTful URIs to access and manipulate data.\u003c/p\u003e\n"]]],[],null,["Before you can start coding your first client application, there are a few\nthings you need to do, if you haven't done them already.\n1. [Get a Google Account](#getaccount)\n2. [Create a project for your client](#project)\n3. [Learn REST basics](#rest)\n4. [Learn JSON basics](#data-json)\n\nGet a Google Account\n\nYou need a [Google Account](https://www.google.com/accounts/NewAccount) in order to [create a project](#project) in the Google API Console. If you already have an account, then you're all set.\n\nYou may also want a separate Google Account for testing purposes.\n\nCreate a project for your client\n\nBefore you can send requests to Google Knowledge Graph Search API, you need to tell Google about your client and activate access to the API. You do this by using the Google API Console to create a project, which is a named collection of settings and API access information, and register your application.\n\nTo get started using Google Knowledge Graph Search API, you need to first\n[use\nthe setup tool](https://console.cloud.google.com/start/api?id=kgsearch.googleapis.com&credential=client_key), which guides you through creating a project in the\nGoogle API Console, enabling the API, and creating credentials.\n\nIf you haven't done so already, create your application's API key by clicking\n**Create credentials \\\u003e API key** . Next, look for your API key in the **API\nkeys** section.\n\nLearn REST basics\n\nThere are two ways to invoke the API:\n\n- Sending HTTP requests and parsing the responses.\n- Using [client libraries](/knowledge-graph/libraries).\n\nIf you decide not to use client libraries, you'll need to understand the basics of REST.\n\nREST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.\n\nThe term REST is short for \"[Representational State Transfer](https://en.wikipedia.org/wiki/Representational_state_transfer).\" In the context of Google APIs, it refers to using HTTP verbs to retrieve and modify representations of data stored by Google.\n\nIn a RESTful system, resources are stored in a data store; a client sends a request that the server perform a particular action (such as creating, retrieving, updating, or deleting a resource), and the server performs the action and sends a response, often in the form of a representation of the specified resource.\n\nIn Google's RESTful APIs, the client specifies an action using an HTTP verb such as `POST`, `GET`, `PUT`, or `DELETE`. It specifies a resource by a globally-unique URI of the following form: \n\n```\nhttps://www.googleapis.com/apiName/apiVersion/resourcePath?parameters\n```\n\nBecause all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.\n\nYou may find the [method definitions](https://tools.ietf.org/html/rfc7231#section-4.3) in the HTTP 1.1 standards documentation useful; they include specifications for `GET`, `POST`, `PUT`, and `DELETE`.\n\nREST in the Google Knowledge Graph Search API\n\nThe Google Knowledge Graph Search API operations map directly to REST HTTP verbs.\n\nThe specific formats for Google Knowledge Graph Search API URIs are: \n\n```\nhttps://kgsearch.googleapis.com/v1/entities:search?query=your_query¶meters\n```\n\nThe full set of URIs used for each supported operation in the API is summarized in the [Google Knowledge Graph Search API Reference](/knowledge-graph/reference/rest/v1) document.\n\nLearn JSON basics\n\nThe Google Knowledge Graph Search API returns data in JSON format.\n\n\n[JSON](http://en.wikipedia.org/wiki/JSON) (JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see [json.org](http://www.json.org/).\n\n\u003cbr /\u003e"]]