mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
|
…
|
||
|---|---|---|
| .. | ||
| gapi.client.kgsearch-tests.ts | ||
| index.d.ts | ||
| readme.md | ||
| tsconfig.json | ||
| tslint.json | ||
TypeScript typings for Knowledge Graph Search API v1
Searches the Google Knowledge Graph for entities. For detailed description please check documentation.
Installing
Install typings for Knowledge Graph Search API:
npm install @types/gapi.client.kgsearch@v1 --save-dev
Usage
You need to initialize Google API client in your code:
gapi.load("client", () => {
// now we can use gapi.client
// ...
});
Then load api client wrapper:
gapi.client.load('kgsearch', 'v1', () => {
// now we can use gapi.client.kgsearch
// ...
});
After that you can use Knowledge Graph Search API resources:
/*
Searches Knowledge Graph for entities that match the constraints.
A list of matched entities will be returned in response, which will be in
JSON-LD format and compatible with http://schema.org
*/
await gapi.client.entities.search({ });