serpkite 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -88,7 +88,7 @@ interface paths {
88
88
  /** Same as POST /v1/search with query-string parameters */
89
89
  get: operations["searchGet"];
90
90
  put?: never;
91
- /** Google web search (organic results, AI Overview, knowledge graph, answer box, people also ask, top stories, local pack…) */
91
+ /** Google web search (organic results, knowledge graph, answer box, people also ask, top stories, local pack…) */
92
92
  post: operations["search"];
93
93
  delete?: never;
94
94
  options?: never;
@@ -156,7 +156,7 @@ interface paths {
156
156
  };
157
157
  get?: never;
158
158
  put?: never;
159
- /** Google Maps search (places with coordinates). Accepts `ll` ("@lat,lng,zoomz") */
159
+ /** Google Maps search (places with coordinates). Accepts `ll` ("@lat,lng,zoomz") to search around a point */
160
160
  post: operations["maps"];
161
161
  delete?: never;
162
162
  options?: never;
@@ -266,40 +266,6 @@ interface paths {
266
266
  patch?: never;
267
267
  trace?: never;
268
268
  };
269
- "/v1/lens": {
270
- parameters: {
271
- query?: never;
272
- header?: never;
273
- path?: never;
274
- cookie?: never;
275
- };
276
- get?: never;
277
- put?: never;
278
- /** Google Lens visual matches for an image URL (2 credits) */
279
- post: operations["lens"];
280
- delete?: never;
281
- options?: never;
282
- head?: never;
283
- patch?: never;
284
- trace?: never;
285
- };
286
- "/v1/ai-mode": {
287
- parameters: {
288
- query?: never;
289
- header?: never;
290
- path?: never;
291
- cookie?: never;
292
- };
293
- get?: never;
294
- put?: never;
295
- /** Google AI Mode answer with citations (3 credits) */
296
- post: operations["aiMode"];
297
- delete?: never;
298
- options?: never;
299
- head?: never;
300
- patch?: never;
301
- trace?: never;
302
- };
303
269
  "/v1/webpage": {
304
270
  parameters: {
305
271
  query?: never;
@@ -465,7 +431,7 @@ interface paths {
465
431
  };
466
432
  get?: never;
467
433
  put?: never;
468
- /** Remote MCP server (streamable HTTP, JSON-RPC 2.0). Tools search, news, maps, scholar, webpage, ai_overview */
434
+ /** Remote MCP server (streamable HTTP, JSON-RPC 2.0). Tools search, news, maps, scholar, webpage */
469
435
  post: operations["mcp"];
470
436
  delete?: never;
471
437
  options?: never;
@@ -504,20 +470,20 @@ interface components {
504
470
  SearchRequest: {
505
471
  q: string;
506
472
  /**
507
- * @description Country code (ISO 3166-1 alpha-2)
473
+ * @description Country code (ISO 3166-1 alpha-2, case-insensitive; uk is accepted as gb). When omitted and location ends in a country name, that country is used
508
474
  * @default us
509
475
  */
510
476
  country?: string;
511
477
  /**
512
- * @description Interface language (e.g. en
478
+ * @description Interface language: a language code with an optional region (e.g. en, de, pt-br, zh-tw, es-419)
513
479
  * @default en
514
480
  */
515
481
  language?: string;
516
482
  /** @description Free-text location, e.g. "Austin, Texas, United States" */
517
483
  location?: string;
518
- /** @description Pre-encoded Google location (overrides location) */
484
+ /** @description Pre-encoded Google location (overrides ll and location; percent-encoded values are decoded) */
519
485
  uule?: string;
520
- /** @description Maps viewport "@lat,lng,14z" (maps only) */
486
+ /** @description Map point "@lat,lng,14z" (maps and places only; zoom optional): the search runs as a searcher at that point. Overrides location */
521
487
  ll?: string;
522
488
  /**
523
489
  * @description 10, or up to 100 for the depth bundle on search and news (7 credits for 100; values between round up to whole pages). Other verticals return one page of 10
@@ -527,11 +493,11 @@ interface components {
527
493
  /** @default 1 */
528
494
  page?: number;
529
495
  /**
530
- * @description Only results from the last hour/day/…
496
+ * @description Only results from the last hour/day/… (search, news, images, videos, shopping). A fallback engine without that window is skipped, never answered unfiltered
531
497
  * @enum {string}
532
498
  */
533
499
  time?: "hour" | "day" | "week" | "month" | "year";
534
- /** @description Advanced: raw Google tbs filter (e.g. qdr:d); overrides time */
500
+ /** @description Advanced: raw Google tbs filter (e.g. qdr:d, qdr:w2, cdr:1,cd_min:1/1/2026,cd_max:1/31/2026); overrides time */
535
501
  tbs?: string;
536
502
  /**
537
503
  * @default desktop
@@ -550,15 +516,13 @@ interface components {
550
516
  * @enum {string}
551
517
  */
552
518
  format?: "json" | "markdown" | "compact";
553
- /** @description Comma-separated projection, e.g. "results.title,results.link,ai_overview" */
519
+ /** @description Comma-separated projection, e.g. "results.title,results.link,knowledge_graph" */
554
520
  fields?: string;
555
521
  /**
556
522
  * @description Also fetch the top N organic pages as Markdown (+1 credit each fetched page)
557
523
  * @default 0
558
524
  */
559
525
  include_content?: number;
560
- /** @default true */
561
- ai_overview?: boolean;
562
526
  /**
563
527
  * @description Include sponsored results
564
528
  * @default false
@@ -592,19 +556,6 @@ interface components {
592
556
  fields?: string;
593
557
  max_age?: number;
594
558
  };
595
- LensRequest: {
596
- /**
597
- * Format: uri
598
- * @description Image URL
599
- */
600
- url: string;
601
- country?: string;
602
- language?: string;
603
- /** @enum {string} */
604
- format?: "json" | "markdown" | "compact";
605
- fields?: string;
606
- max_age?: number;
607
- };
608
559
  WebpageRequest: {
609
560
  /** Format: uri */
610
561
  url: string;
@@ -662,7 +613,7 @@ interface components {
662
613
  /**
663
614
  * @example search
664
615
  * @example news
665
- * @example ai-mode
616
+ * @example webpage
666
617
  */
667
618
  endpoint: string;
668
619
  /** @description The engine policy as asked (google, auto, one provider or a list) */
@@ -720,17 +671,6 @@ interface components {
720
671
  */
721
672
  sources?: components["schemas"]["Provider"][];
722
673
  };
723
- Reference: {
724
- title?: string;
725
- link: string;
726
- domain?: string;
727
- snippet?: string;
728
- };
729
- AIOverview: {
730
- text?: string;
731
- markdown?: string;
732
- references?: components["schemas"]["Reference"][];
733
- };
734
674
  AnswerBox: {
735
675
  title?: string;
736
676
  answer?: string;
@@ -762,7 +702,6 @@ interface components {
762
702
  SearchResponse: {
763
703
  request: components["schemas"]["RequestEcho"];
764
704
  results: components["schemas"]["OrganicResult"][];
765
- ai_overview: components["schemas"]["AIOverview"] | null;
766
705
  answer_box?: components["schemas"]["AnswerBox"];
767
706
  knowledge_graph?: components["schemas"]["KnowledgeGraph"];
768
707
  ads?: components["schemas"]["OrganicResult"][];
@@ -935,28 +874,6 @@ interface components {
935
874
  results: components["schemas"]["Suggestion"][];
936
875
  meta: components["schemas"]["Meta"];
937
876
  };
938
- LensResult: {
939
- position: number;
940
- title: string;
941
- source?: string;
942
- link: string;
943
- domain?: string;
944
- image_url?: string;
945
- thumbnail_url?: string;
946
- };
947
- LensResponse: {
948
- request: components["schemas"]["RequestEcho"];
949
- results: components["schemas"]["LensResult"][];
950
- meta: components["schemas"]["Meta"];
951
- };
952
- AIModeResponse: {
953
- request: components["schemas"]["RequestEcho"];
954
- answer: string;
955
- markdown?: string;
956
- /** @description Cited sources */
957
- results: components["schemas"]["Reference"][];
958
- meta: components["schemas"]["Meta"];
959
- };
960
877
  PageMetadata: {
961
878
  title?: string;
962
879
  description?: string;
@@ -1059,7 +976,7 @@ interface components {
1059
976
  };
1060
977
  BatchCreateRequest: {
1061
978
  /** @enum {string} */
1062
- endpoint: "search" | "images" | "videos" | "news" | "maps" | "places" | "reviews" | "shopping" | "scholar" | "patents" | "autocomplete" | "lens" | "ai-mode" | "webpage";
979
+ endpoint: "search" | "images" | "videos" | "news" | "maps" | "places" | "reviews" | "shopping" | "scholar" | "patents" | "autocomplete" | "webpage";
1063
980
  /** @description Request bodies for `endpoint` (same fields as the realtime endpoint) */
1064
981
  requests: {
1065
982
  [key: string]: unknown;
@@ -1304,38 +1221,6 @@ interface components {
1304
1221
  };
1305
1222
  };
1306
1223
  /** @description OK (text/markdown when format=markdown) */
1307
- LensOK: {
1308
- headers: {
1309
- "X-Credits-Used": components["headers"]["CreditsUsed"];
1310
- "X-Credits-Remaining": components["headers"]["CreditsRemaining"];
1311
- "X-Cost-USD": components["headers"]["CostUSD"];
1312
- "X-Cache": components["headers"]["Cache"];
1313
- "X-Latency-Ms": components["headers"]["LatencyMs"];
1314
- "X-Tokens-Estimate": components["headers"]["TokensEstimate"];
1315
- [name: string]: unknown;
1316
- };
1317
- content: {
1318
- "application/json": components["schemas"]["LensResponse"];
1319
- "text/markdown": string;
1320
- };
1321
- };
1322
- /** @description OK (text/markdown when format=markdown) */
1323
- AIModeOK: {
1324
- headers: {
1325
- "X-Credits-Used": components["headers"]["CreditsUsed"];
1326
- "X-Credits-Remaining": components["headers"]["CreditsRemaining"];
1327
- "X-Cost-USD": components["headers"]["CostUSD"];
1328
- "X-Cache": components["headers"]["Cache"];
1329
- "X-Latency-Ms": components["headers"]["LatencyMs"];
1330
- "X-Tokens-Estimate": components["headers"]["TokensEstimate"];
1331
- [name: string]: unknown;
1332
- };
1333
- content: {
1334
- "application/json": components["schemas"]["AIModeResponse"];
1335
- "text/markdown": string;
1336
- };
1337
- };
1338
- /** @description OK (text/markdown when format=markdown) */
1339
1224
  WebpageOK: {
1340
1225
  headers: {
1341
1226
  "X-Credits-Used": components["headers"]["CreditsUsed"];
@@ -1392,7 +1277,6 @@ interface operations {
1392
1277
  format?: string;
1393
1278
  fields?: string;
1394
1279
  include_content?: number;
1395
- ai_overview?: boolean;
1396
1280
  ads?: boolean;
1397
1281
  max_age?: number;
1398
1282
  /** @description google (default), auto, consensus, one provider, or a comma-separated list (e.g. google,brave) */
@@ -1616,46 +1500,6 @@ interface operations {
1616
1500
  503: components["responses"]["Unavailable"];
1617
1501
  };
1618
1502
  };
1619
- lens: {
1620
- parameters: {
1621
- query?: never;
1622
- header?: never;
1623
- path?: never;
1624
- cookie?: never;
1625
- };
1626
- requestBody: {
1627
- content: {
1628
- "application/json": components["schemas"]["LensRequest"];
1629
- };
1630
- };
1631
- responses: {
1632
- 200: components["responses"]["LensOK"];
1633
- 400: components["responses"]["Error"];
1634
- 401: components["responses"]["Error"];
1635
- 402: components["responses"]["Error"];
1636
- 403: components["responses"]["Error"];
1637
- 429: components["responses"]["Error"];
1638
- 503: components["responses"]["Unavailable"];
1639
- };
1640
- };
1641
- aiMode: {
1642
- parameters: {
1643
- query?: never;
1644
- header?: never;
1645
- path?: never;
1646
- cookie?: never;
1647
- };
1648
- requestBody: components["requestBodies"]["Search"];
1649
- responses: {
1650
- 200: components["responses"]["AIModeOK"];
1651
- 400: components["responses"]["Error"];
1652
- 401: components["responses"]["Error"];
1653
- 402: components["responses"]["Error"];
1654
- 403: components["responses"]["Error"];
1655
- 429: components["responses"]["Error"];
1656
- 503: components["responses"]["Unavailable"];
1657
- };
1658
- };
1659
1503
  webpage: {
1660
1504
  parameters: {
1661
1505
  query?: never;
@@ -1955,13 +1799,12 @@ type Engine = "google" | "auto" | "consensus" | Provider | Provider[] | (string
1955
1799
  /** One provider attempt in `meta.route`. */
1956
1800
  type RouteStep = Schemas["RouteStep"];
1957
1801
  type RouteOutcome = RouteStep["outcome"];
1958
- /** Parameters for search, images, videos, news, maps, places, shopping, scholar, patents, autocomplete and aiMode. */
1802
+ /** Parameters for search, images, videos, news, maps, places, shopping, scholar, patents and autocomplete. */
1959
1803
  type SearchParams = Omit<Schemas["SearchRequest"], "engine"> & {
1960
1804
  /** Search providers allowed to answer. Default `"google"`. See {@link Engine}. */
1961
1805
  engine?: Engine;
1962
1806
  };
1963
1807
  type ReviewsParams = Schemas["ReviewsRequest"];
1964
- type LensParams = Schemas["LensRequest"];
1965
1808
  type WebpageParams = Schemas["WebpageRequest"];
1966
1809
  type RankParams = Schemas["RankRequest"];
1967
1810
  /** `format` values accepted by the verticals. */
@@ -1971,8 +1814,6 @@ type RequestEcho = Schemas["RequestEcho"];
1971
1814
  type ErrorBody = Schemas["Error"];
1972
1815
  type OrganicResult = Schemas["OrganicResult"];
1973
1816
  type Sitelink = Schemas["Sitelink"];
1974
- type Reference = Schemas["Reference"];
1975
- type AIOverview = Schemas["AIOverview"];
1976
1817
  type AnswerBox = Schemas["AnswerBox"];
1977
1818
  type KnowledgeGraph = Schemas["KnowledgeGraph"];
1978
1819
  type PeopleAlsoAsk = Schemas["PeopleAlsoAsk"];
@@ -1986,7 +1827,6 @@ type ShoppingResult = Schemas["ShoppingResult"];
1986
1827
  type ScholarResult = Schemas["ScholarResult"];
1987
1828
  type PatentResult = Schemas["PatentResult"];
1988
1829
  type Suggestion = Schemas["Suggestion"];
1989
- type LensResult = Schemas["LensResult"];
1990
1830
  type PageMetadata = Schemas["PageMetadata"];
1991
1831
  type RankMatch = Schemas["RankResponse"]["matches"][number];
1992
1832
  type SearchResponse = Schemas["SearchResponse"];
@@ -2001,8 +1841,6 @@ type ShoppingResponse = Schemas["ShoppingResponse"];
2001
1841
  type ScholarResponse = Schemas["ScholarResponse"];
2002
1842
  type PatentsResponse = Schemas["PatentsResponse"];
2003
1843
  type AutocompleteResponse = Schemas["AutocompleteResponse"];
2004
- type LensResponse = Schemas["LensResponse"];
2005
- type AIModeResponse = Schemas["AIModeResponse"];
2006
1844
  type WebpageResponse = Schemas["WebpageResponse"];
2007
1845
  type RankResponse = Schemas["RankResponse"];
2008
1846
  type Account = Schemas["Account"];
@@ -2041,8 +1879,6 @@ type BatchRequestMap = {
2041
1879
  scholar: SearchParams;
2042
1880
  patents: SearchParams;
2043
1881
  autocomplete: SearchParams;
2044
- lens: LensParams;
2045
- "ai-mode": SearchParams;
2046
1882
  webpage: WebpageParams;
2047
1883
  };
2048
1884
  /** Body of `POST /v1/batches`. `requests` takes the same fields as the realtime endpoint. */
@@ -2056,7 +1892,7 @@ type BatchCreateParams = {
2056
1892
  };
2057
1893
  }[BatchEndpoint];
2058
1894
 
2059
- declare const VERSION = "0.1.1";
1895
+ declare const VERSION = "0.3.0";
2060
1896
  declare const DEFAULT_BASE_URL = "https://api.serpkite.com";
2061
1897
  interface SerpKiteOptions {
2062
1898
  /** API key (`skt_live_…`). Defaults to the `SERPKITE_API_KEY` environment variable. */
@@ -2143,11 +1979,10 @@ declare class SerpKite {
2143
1979
  readonly maxRetries: number;
2144
1980
  readonly retryDelayMs: number;
2145
1981
  constructor(options?: SerpKiteOptions);
2146
- /** Google web search: organic results, AI Overview, answer box, knowledge graph, people also ask… */
1982
+ /** Google web search: organic results, answer box, knowledge graph, people also ask… */
2147
1983
  readonly search: VerticalMethod<SearchParams, {
2148
1984
  request: components["schemas"]["RequestEcho"];
2149
1985
  results: components["schemas"]["OrganicResult"][];
2150
- ai_overview: components["schemas"]["AIOverview"] | null;
2151
1986
  answer_box?: components["schemas"]["AnswerBox"];
2152
1987
  knowledge_graph?: components["schemas"]["KnowledgeGraph"];
2153
1988
  ads?: components["schemas"]["OrganicResult"][];
@@ -2230,14 +2065,6 @@ declare class SerpKite {
2230
2065
  results: components["schemas"]["Suggestion"][];
2231
2066
  meta: components["schemas"]["Meta"];
2232
2067
  }>;
2233
- /** Google AI Mode answer with cited sources. */
2234
- readonly aiMode: VerticalMethod<SearchParams, {
2235
- request: components["schemas"]["RequestEcho"];
2236
- answer: string;
2237
- markdown?: string;
2238
- results: components["schemas"]["Reference"][];
2239
- meta: components["schemas"]["Meta"];
2240
- }>;
2241
2068
  /** Fetch any public URL as clean Markdown plus metadata. */
2242
2069
  readonly webpage: VerticalMethod<{
2243
2070
  url: string;
@@ -2254,8 +2081,6 @@ declare class SerpKite {
2254
2081
  metadata: components["schemas"]["PageMetadata"];
2255
2082
  meta: components["schemas"]["Meta"];
2256
2083
  }>;
2257
- /** Google Lens visual matches for an image URL. */
2258
- lens(params: LensParams, options?: RequestOptions): Promise<LensResponse>;
2259
2084
  /** Position of `domain` for keyword `q` in the top `num` results (default 100). */
2260
2085
  rank(params: RankParams, options?: RequestOptions): Promise<RankResponse>;
2261
2086
  /** Balance, limits and this month's usage for the key's account. */
@@ -2343,4 +2168,4 @@ type HeaderSource = Headers | Record<string, string | string[] | undefined>;
2343
2168
  */
2344
2169
  declare function verifyWebhook(secret: string, payload: string | Uint8Array, headers: HeaderSource, options?: VerifyWebhookOptions): Promise<boolean>;
2345
2170
 
2346
- export { type AIModeResponse, type AIOverview, type Account, type AnswerBox, type AutocompleteResponse, type Batch, type BatchCreateEntry, type BatchCreateError, type BatchCreateOptions, type BatchCreateParams, type BatchCreateResponse, type BatchEndpoint, type BatchStatus, type CompactResponse, DEFAULT_BASE_URL, type Engine, type ErrorBody, type Format, type ImageResult, type ImagesResponse, type KnowledgeGraph, type LensParams, type LensResponse, type LensResult, type MapsResponse, type Meta, type NewsResponse, type NewsResult, type OrganicResult, type PageMetadata, type PatentResult, type PatentsResponse, type PeopleAlsoAsk, type PlaceResult, type PlacesResponse, type Provider, type RankMatch, type RankParams, type RankResponse, type Reference, type RelatedSearch, type RequestEcho, type RequestOptions, type ResponseInfo, type ReviewResult, type ReviewsParams, type ReviewsResponse, type RouteOutcome, type RouteStep, type ScholarResponse, type ScholarResult, type SearchParams, type SearchResponse, SerpKite, SerpKiteError, type SerpKiteOptions, type ShoppingResponse, type ShoppingResult, type Sitelink, type Status, type Suggestion, VERSION, type VerifyWebhookOptions, type VerticalMethod, type VideoResult, type VideosResponse, type WaitOptions, type WebpageParams, type WebpageResponse, type components, isBatchError, type operations, parseRetryAfter, type paths, verifyWebhook };
2171
+ export { type Account, type AnswerBox, type AutocompleteResponse, type Batch, type BatchCreateEntry, type BatchCreateError, type BatchCreateOptions, type BatchCreateParams, type BatchCreateResponse, type BatchEndpoint, type BatchStatus, type CompactResponse, DEFAULT_BASE_URL, type Engine, type ErrorBody, type Format, type ImageResult, type ImagesResponse, type KnowledgeGraph, type MapsResponse, type Meta, type NewsResponse, type NewsResult, type OrganicResult, type PageMetadata, type PatentResult, type PatentsResponse, type PeopleAlsoAsk, type PlaceResult, type PlacesResponse, type Provider, type RankMatch, type RankParams, type RankResponse, type RelatedSearch, type RequestEcho, type RequestOptions, type ResponseInfo, type ReviewResult, type ReviewsParams, type ReviewsResponse, type RouteOutcome, type RouteStep, type ScholarResponse, type ScholarResult, type SearchParams, type SearchResponse, SerpKite, SerpKiteError, type SerpKiteOptions, type ShoppingResponse, type ShoppingResult, type Sitelink, type Status, type Suggestion, VERSION, type VerifyWebhookOptions, type VerticalMethod, type VideoResult, type VideosResponse, type WaitOptions, type WebpageParams, type WebpageResponse, type components, isBatchError, type operations, parseRetryAfter, type paths, verifyWebhook };