Skip to content

NilsKrause/kagi-api-client-obsidian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kagi API client

A client for the Kagi API, written in typescript.

Usage

const settings = {token: '<KAGI_API_TOKE>'}
const kagi = new Kagi(settings);

let summarizeResult = kagi.summarize('<URL_OR_TEXT>');
let searchResult = kagi.search('<SEARCH_TERM>');
let fastGPTResult = kagi.fastgpt('<PROMPT>');
let enrichWebResult = kagi.enrichWeb('<URL_TO_ENRICH>');
let enrichNewsResult = kagi.enrichNews('<URL_TO_ENRICH>');

Settings

export type Settings = {
  // The Kagi API token to use
  token: string,
  // The Kagi API Version to use
  version?: KagiApiVersion
  // Defaults to use  for summarize requests
  summarizerDefaults?: SummarizerOptions
  // Defaults to use for search requests
  searchDefaults?: SearchOptions
  // Defaults to use for FastGPT requests
  fastGPTDefaults?: FastGPTOptions
}

Response

type KagiResponse<KagiDataT extends KagiData> = {
  // Request Metadata
  meta: KagiMeta
  // Response data. Can be any valid JSON value, as documented
  data: KagiDataT
  // Error Object, if an error occurred
  error: KagiErrorT[]
}

Please refer to the type definitions and the Kagi documentation for further information.

Costs

Please refer to the Kagi API documentation for an detailed explanation about costs. Also please not that the Search API is currently in closed beta and only available to the Kagi Business (team) plan.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published