totalum-sdk 1.11.0 → 1.12.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/_types/{coerce.d-BKhuaDya.d.ts → coerce.d-Cp5NZQN-.d.ts} +1 -1
  3. package/dist/_types/{errors.d-RTRkidv5.d.ts → errors.d-ve4rY-Hx.d.ts} +37 -5
  4. package/dist/_types/{integrations.d-CzTa9T-L.d.ts → integrations.d-BRhNKT7K.d.ts} +2 -2
  5. package/dist/_types/{ops.d-CNsrT4Ma.d.ts → ops.d-DIC4u0go.d.ts} +2 -2
  6. package/dist/ai/index.d.ts +275 -23
  7. package/dist/ai/index.js +305 -24
  8. package/dist/analytics/index.d.ts +58 -12
  9. package/dist/analytics/index.js +46 -3
  10. package/dist/browser/index.d.ts +228 -20
  11. package/dist/browser/index.js +122 -13
  12. package/dist/connections/index.d.ts +305 -23
  13. package/dist/connections/index.js +302 -21
  14. package/dist/cron/index.d.ts +147 -20
  15. package/dist/cron/index.js +157 -15
  16. package/dist/d1/errors.js +15 -0
  17. package/dist/d1/index.d.ts +254 -10
  18. package/dist/d1/index.js +24 -4
  19. package/dist/d1/session.js +26 -2
  20. package/dist/email/index.d.ts +65 -10
  21. package/dist/email/index.js +60 -5
  22. package/dist/errors.js +17 -0
  23. package/dist/files/index.d.ts +243 -20
  24. package/dist/files/index.js +247 -14
  25. package/dist/index.d.ts +25 -10
  26. package/dist/index.js +19 -5
  27. package/dist/logs/index.d.ts +48 -10
  28. package/dist/logs/index.js +39 -4
  29. package/dist/payments/index.d.ts +221 -23
  30. package/dist/payments/index.js +216 -18
  31. package/dist/pdf/index.d.ts +59 -9
  32. package/dist/pdf/index.js +54 -4
  33. package/dist/react/index.d.ts +78 -6
  34. package/dist/react/index.js +51 -5
  35. package/dist/realtime/index.d.ts +55 -8
  36. package/dist/realtime/index.js +53 -6
  37. package/dist/scan/index.d.ts +78 -10
  38. package/dist/scan/index.js +63 -3
  39. package/dist/seo/index.d.ts +1118 -8
  40. package/dist/seo/index.js +325 -4
  41. package/dist/speech/index.d.ts +34 -10
  42. package/dist/speech/index.js +25 -5
  43. package/dist/vectors/index.d.ts +96 -9
  44. package/dist/vectors/index.js +93 -7
  45. package/dist/web/index.d.ts +168 -15
  46. package/dist/web/index.js +163 -10
  47. package/dist/webhooks/index.d.ts +122 -15
  48. package/dist/webhooks/index.js +119 -13
  49. package/package.json +2 -1
  50. package/totalum-sdk.md +10336 -754
  51. package/totalum-sdk.signatures.json +69 -1
@@ -1,23 +1,1133 @@
1
- export { y as SeoIndexNowKey, z as SeoNotifyOutput } from '../_types/integrations.d-CzTa9T-L.js';
2
- import { T as TotalumClientOptions } from '../_types/errors.d-RTRkidv5.js';
3
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-RTRkidv5.js';
4
- import '../_types/coerce.d-BKhuaDya.js';
1
+ import { Z as ZodObject, d as ZodString, x as ZodDefault, f as ZodEnum, c as ZodOptional, j as ZodBoolean, y as ZodPipe, z as ZodTransform, m as $strip, o as output, e as ZodArray, w as ZodNullable, l as ZodInt, h as ZodRecord, k as ZodNumber, p as ZodURL, T as TotalumClientOptions, U as Usage } from '../_types/errors.d-ve4rY-Hx.js';
2
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-ve4rY-Hx.js';
3
+ export { y as SeoIndexNowKey, z as SeoNotifyOutput } from '../_types/integrations.d-BRhNKT7K.js';
4
+ import '../_types/coerce.d-Cp5NZQN-.js';
5
5
 
6
- /** `totalum.seo` over the Totalum API `/v1/seo/*` (scope `seo`): IndexNow for verified custom domains, free. */
6
+ declare const SeoSerpGoogleInput: ZodObject<{
7
+ city: ZodOptional<ZodString>;
8
+ depth: ZodDefault<ZodInt>;
9
+ device: ZodDefault<ZodEnum<{
10
+ mobile: "mobile";
11
+ desktop: "desktop";
12
+ }>>;
13
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
14
+ language: ZodString;
15
+ keyword: ZodString;
16
+ }, $strip>;
17
+ type SeoSerpGoogleInput = output<typeof SeoSerpGoogleInput>;
18
+ declare const SeoSerpAiModeInput: ZodObject<{
19
+ device: ZodDefault<ZodEnum<{
20
+ mobile: "mobile";
21
+ desktop: "desktop";
22
+ }>>;
23
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
24
+ language: ZodString;
25
+ keyword: ZodString;
26
+ }, $strip>;
27
+ type SeoSerpAiModeInput = output<typeof SeoSerpAiModeInput>;
28
+ declare const SeoSerpMapsInput: ZodObject<{
29
+ city: ZodOptional<ZodString>;
30
+ depth: ZodDefault<ZodInt>;
31
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
32
+ language: ZodString;
33
+ keyword: ZodString;
34
+ }, $strip>;
35
+ type SeoSerpMapsInput = output<typeof SeoSerpMapsInput>;
36
+ declare const SeoAiAnswerInput: ZodObject<{
37
+ prompt: ZodString;
38
+ platform: ZodDefault<ZodEnum<{
39
+ claude: "claude";
40
+ chatgpt: "chatgpt";
41
+ gemini: "gemini";
42
+ perplexity: "perplexity";
43
+ }>>;
44
+ model: ZodOptional<ZodString>;
45
+ webSearch: ZodDefault<ZodBoolean>;
46
+ country: ZodOptional<ZodPipe<ZodString, ZodTransform<string, string>>>;
47
+ }, $strip>;
48
+ type SeoAiAnswerInput = output<typeof SeoAiAnswerInput>;
49
+ declare const SeoChatGptSearchInput: ZodObject<{
50
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
51
+ language: ZodString;
52
+ keyword: ZodString;
53
+ }, $strip>;
54
+ type SeoChatGptSearchInput = output<typeof SeoChatGptSearchInput>;
55
+ declare const SeoAiMentionsInput: ZodObject<{
56
+ platform: ZodOptional<ZodEnum<{
57
+ chatgpt: "chatgpt";
58
+ google: "google";
59
+ }>>;
60
+ view: ZodDefault<ZodEnum<{
61
+ mentions: "mentions";
62
+ "top-domains": "top-domains";
63
+ "top-pages": "top-pages";
64
+ }>>;
65
+ limit: ZodDefault<ZodInt>;
66
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
67
+ language: ZodString;
68
+ domain: ZodOptional<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>>;
69
+ keyword: ZodOptional<ZodString>;
70
+ }, $strip>;
71
+ type SeoAiMentionsInput = output<typeof SeoAiMentionsInput>;
72
+ declare const SeoAiKeywordVolumeInput: ZodObject<{
73
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
74
+ language: ZodString;
75
+ keywords: ZodArray<ZodString>;
76
+ }, $strip>;
77
+ type SeoAiKeywordVolumeInput = output<typeof SeoAiKeywordVolumeInput>;
78
+ declare const SeoKeywordIdeasInput: ZodObject<{
79
+ limit: ZodDefault<ZodInt>;
80
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
81
+ language: ZodString;
82
+ keywords: ZodArray<ZodString>;
83
+ }, $strip>;
84
+ type SeoKeywordIdeasInput = output<typeof SeoKeywordIdeasInput>;
85
+ declare const SeoKeywordRelatedInput: ZodObject<{
86
+ depth: ZodDefault<ZodInt>;
87
+ limit: ZodDefault<ZodInt>;
88
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
89
+ language: ZodString;
90
+ keyword: ZodString;
91
+ }, $strip>;
92
+ type SeoKeywordRelatedInput = output<typeof SeoKeywordRelatedInput>;
93
+ declare const SeoKeywordOverviewInput: ZodObject<{
94
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
95
+ language: ZodString;
96
+ keywords: ZodArray<ZodString>;
97
+ }, $strip>;
98
+ type SeoKeywordOverviewInput = output<typeof SeoKeywordOverviewInput>;
99
+ declare const SeoKeywordTrendsInput: ZodObject<{
100
+ keywords: ZodArray<ZodString>;
101
+ country: ZodOptional<ZodPipe<ZodString, ZodTransform<string, string>>>;
102
+ language: ZodOptional<ZodString>;
103
+ timeRange: ZodDefault<ZodEnum<{
104
+ past_7_days: "past_7_days";
105
+ past_30_days: "past_30_days";
106
+ past_90_days: "past_90_days";
107
+ past_12_months: "past_12_months";
108
+ past_5_years: "past_5_years";
109
+ }>>;
110
+ }, $strip>;
111
+ type SeoKeywordTrendsInput = output<typeof SeoKeywordTrendsInput>;
112
+ declare const SeoDomainKeywordsInput: ZodObject<{
113
+ limit: ZodDefault<ZodInt>;
114
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
115
+ language: ZodString;
116
+ domain: ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>;
117
+ }, $strip>;
118
+ type SeoDomainKeywordsInput = output<typeof SeoDomainKeywordsInput>;
119
+ declare const SeoDomainCompetitorsInput: ZodObject<{
120
+ limit: ZodDefault<ZodInt>;
121
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
122
+ language: ZodString;
123
+ domain: ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>;
124
+ }, $strip>;
125
+ type SeoDomainCompetitorsInput = output<typeof SeoDomainCompetitorsInput>;
126
+ declare const SeoKeywordGapInput: ZodObject<{
127
+ mode: ZodDefault<ZodEnum<{
128
+ shared: "shared";
129
+ missing: "missing";
130
+ }>>;
131
+ limit: ZodDefault<ZodInt>;
132
+ country: ZodPipe<ZodString, ZodTransform<string, string>>;
133
+ language: ZodString;
134
+ domain: ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>;
135
+ competitor: ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>;
136
+ }, $strip>;
137
+ type SeoKeywordGapInput = output<typeof SeoKeywordGapInput>;
138
+ declare const SeoPageAnalyzeInput: ZodObject<{
139
+ url: ZodURL;
140
+ }, $strip>;
141
+ type SeoPageAnalyzeInput = output<typeof SeoPageAnalyzeInput>;
142
+ declare const SeoBacklinksSummaryInput: ZodObject<{
143
+ domain: ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>;
144
+ }, $strip>;
145
+ type SeoBacklinksSummaryInput = output<typeof SeoBacklinksSummaryInput>;
146
+ declare const SeoSource: ZodObject<{
147
+ title: ZodNullable<ZodString>;
148
+ url: ZodString;
149
+ domain: ZodNullable<ZodString>;
150
+ }, $strip>;
151
+ type SeoSource = output<typeof SeoSource>;
152
+ /** One keyword's search data (Google, the country and language asked). */
153
+ declare const SeoKeyword: ZodObject<{
154
+ keyword: ZodString;
155
+ searchVolume: ZodNullable<ZodInt>;
156
+ cpc: ZodNullable<ZodNumber>;
157
+ competition: ZodNullable<ZodNumber>;
158
+ competitionLevel: ZodNullable<ZodEnum<{
159
+ low: "low";
160
+ medium: "medium";
161
+ high: "high";
162
+ }>>;
163
+ difficulty: ZodNullable<ZodInt>;
164
+ intent: ZodNullable<ZodEnum<{
165
+ informational: "informational";
166
+ navigational: "navigational";
167
+ commercial: "commercial";
168
+ transactional: "transactional";
169
+ }>>;
170
+ trend: ZodNullable<ZodObject<{
171
+ monthly: ZodNullable<ZodInt>;
172
+ quarterly: ZodNullable<ZodInt>;
173
+ yearly: ZodNullable<ZodInt>;
174
+ }, $strip>>;
175
+ monthlySearches: ZodArray<ZodObject<{
176
+ year: ZodInt;
177
+ month: ZodInt;
178
+ searchVolume: ZodNullable<ZodInt>;
179
+ }, $strip>>;
180
+ }, $strip>;
181
+ type SeoKeyword = output<typeof SeoKeyword>;
182
+ declare const SeoSerpGoogleOutput: ZodObject<{
183
+ keyword: ZodString;
184
+ totalResults: ZodNullable<ZodInt>;
185
+ organic: ZodArray<ZodObject<{
186
+ position: ZodInt;
187
+ title: ZodNullable<ZodString>;
188
+ url: ZodString;
189
+ domain: ZodNullable<ZodString>;
190
+ snippet: ZodNullable<ZodString>;
191
+ breadcrumb: ZodNullable<ZodString>;
192
+ }, $strip>>;
193
+ featuredSnippet: ZodNullable<ZodObject<{
194
+ title: ZodNullable<ZodString>;
195
+ snippet: ZodNullable<ZodString>;
196
+ url: ZodString;
197
+ domain: ZodNullable<ZodString>;
198
+ }, $strip>>;
199
+ peopleAlsoAsk: ZodArray<ZodObject<{
200
+ question: ZodString;
201
+ answer: ZodNullable<ZodObject<{
202
+ title: ZodNullable<ZodString>;
203
+ url: ZodString;
204
+ domain: ZodNullable<ZodString>;
205
+ snippet: ZodNullable<ZodString>;
206
+ }, $strip>>;
207
+ }, $strip>>;
208
+ relatedSearches: ZodArray<ZodString>;
209
+ aiOverview: ZodNullable<ZodObject<{
210
+ text: ZodString;
211
+ sources: ZodArray<ZodObject<{
212
+ title: ZodNullable<ZodString>;
213
+ url: ZodString;
214
+ domain: ZodNullable<ZodString>;
215
+ }, $strip>>;
216
+ }, $strip>>;
217
+ }, $strip>;
218
+ type SeoSerpGoogleOutput = output<typeof SeoSerpGoogleOutput>;
219
+ declare const SeoSerpAiModeOutput: ZodObject<{
220
+ keyword: ZodString;
221
+ answer: ZodString;
222
+ sources: ZodArray<ZodObject<{
223
+ title: ZodNullable<ZodString>;
224
+ url: ZodString;
225
+ domain: ZodNullable<ZodString>;
226
+ }, $strip>>;
227
+ }, $strip>;
228
+ type SeoSerpAiModeOutput = output<typeof SeoSerpAiModeOutput>;
229
+ declare const SeoSerpMapsOutput: ZodObject<{
230
+ keyword: ZodString;
231
+ results: ZodArray<ZodObject<{
232
+ position: ZodInt;
233
+ title: ZodString;
234
+ category: ZodNullable<ZodString>;
235
+ address: ZodNullable<ZodString>;
236
+ city: ZodNullable<ZodString>;
237
+ phone: ZodNullable<ZodString>;
238
+ website: ZodNullable<ZodString>;
239
+ rating: ZodNullable<ZodNumber>;
240
+ reviews: ZodNullable<ZodInt>;
241
+ priceLevel: ZodNullable<ZodString>;
242
+ latitude: ZodNullable<ZodNumber>;
243
+ longitude: ZodNullable<ZodNumber>;
244
+ placeId: ZodNullable<ZodString>;
245
+ claimed: ZodNullable<ZodBoolean>;
246
+ }, $strip>>;
247
+ }, $strip>;
248
+ type SeoSerpMapsOutput = output<typeof SeoSerpMapsOutput>;
249
+ declare const SeoAiAnswerOutput: ZodObject<{
250
+ platform: ZodEnum<{
251
+ claude: "claude";
252
+ chatgpt: "chatgpt";
253
+ gemini: "gemini";
254
+ perplexity: "perplexity";
255
+ }>;
256
+ model: ZodString;
257
+ answer: ZodString;
258
+ sources: ZodArray<ZodObject<{
259
+ title: ZodNullable<ZodString>;
260
+ url: ZodString;
261
+ domain: ZodNullable<ZodString>;
262
+ }, $strip>>;
263
+ citedDomains: ZodArray<ZodString>;
264
+ searchQueries: ZodArray<ZodString>;
265
+ }, $strip>;
266
+ type SeoAiAnswerOutput = output<typeof SeoAiAnswerOutput>;
267
+ declare const SeoChatGptSearchOutput: ZodObject<{
268
+ keyword: ZodString;
269
+ answer: ZodString;
270
+ sources: ZodArray<ZodObject<{
271
+ title: ZodNullable<ZodString>;
272
+ url: ZodString;
273
+ domain: ZodNullable<ZodString>;
274
+ snippet: ZodNullable<ZodString>;
275
+ publishedAt: ZodNullable<ZodString>;
276
+ }, $strip>>;
277
+ searchResults: ZodArray<ZodObject<{
278
+ title: ZodNullable<ZodString>;
279
+ url: ZodString;
280
+ domain: ZodNullable<ZodString>;
281
+ }, $strip>>;
282
+ brands: ZodArray<ZodObject<{
283
+ name: ZodString;
284
+ category: ZodNullable<ZodString>;
285
+ }, $strip>>;
286
+ searchQueries: ZodArray<ZodString>;
287
+ }, $strip>;
288
+ type SeoChatGptSearchOutput = output<typeof SeoChatGptSearchOutput>;
289
+ declare const SeoAiMentionsOutput: ZodObject<{
290
+ totalCount: ZodInt;
291
+ mentions: ZodOptional<ZodArray<ZodObject<{
292
+ platform: ZodEnum<{
293
+ chatgpt: "chatgpt";
294
+ google: "google";
295
+ }>;
296
+ question: ZodString;
297
+ answer: ZodString;
298
+ sources: ZodArray<ZodObject<{
299
+ title: ZodNullable<ZodString>;
300
+ url: ZodString;
301
+ domain: ZodNullable<ZodString>;
302
+ }, $strip>>;
303
+ brands: ZodArray<ZodObject<{
304
+ name: ZodString;
305
+ category: ZodNullable<ZodString>;
306
+ }, $strip>>;
307
+ aiSearchVolume: ZodNullable<ZodInt>;
308
+ }, $strip>>>;
309
+ domains: ZodOptional<ZodArray<ZodObject<{
310
+ mentions: ZodInt;
311
+ aiSearchVolume: ZodNullable<ZodInt>;
312
+ domain: ZodString;
313
+ }, $strip>>>;
314
+ pages: ZodOptional<ZodArray<ZodObject<{
315
+ mentions: ZodInt;
316
+ aiSearchVolume: ZodNullable<ZodInt>;
317
+ url: ZodString;
318
+ }, $strip>>>;
319
+ }, $strip>;
320
+ type SeoAiMentionsOutput = output<typeof SeoAiMentionsOutput>;
321
+ declare const SeoAiKeywordVolumeOutput: ZodObject<{
322
+ keywords: ZodArray<ZodObject<{
323
+ keyword: ZodString;
324
+ aiSearchVolume: ZodNullable<ZodInt>;
325
+ monthlySearches: ZodArray<ZodObject<{
326
+ year: ZodInt;
327
+ month: ZodInt;
328
+ aiSearchVolume: ZodNullable<ZodInt>;
329
+ }, $strip>>;
330
+ }, $strip>>;
331
+ }, $strip>;
332
+ type SeoAiKeywordVolumeOutput = output<typeof SeoAiKeywordVolumeOutput>;
333
+ declare const SeoKeywordsOutput: ZodObject<{
334
+ keywords: ZodArray<ZodObject<{
335
+ keyword: ZodString;
336
+ searchVolume: ZodNullable<ZodInt>;
337
+ cpc: ZodNullable<ZodNumber>;
338
+ competition: ZodNullable<ZodNumber>;
339
+ competitionLevel: ZodNullable<ZodEnum<{
340
+ low: "low";
341
+ medium: "medium";
342
+ high: "high";
343
+ }>>;
344
+ difficulty: ZodNullable<ZodInt>;
345
+ intent: ZodNullable<ZodEnum<{
346
+ informational: "informational";
347
+ navigational: "navigational";
348
+ commercial: "commercial";
349
+ transactional: "transactional";
350
+ }>>;
351
+ trend: ZodNullable<ZodObject<{
352
+ monthly: ZodNullable<ZodInt>;
353
+ quarterly: ZodNullable<ZodInt>;
354
+ yearly: ZodNullable<ZodInt>;
355
+ }, $strip>>;
356
+ monthlySearches: ZodArray<ZodObject<{
357
+ year: ZodInt;
358
+ month: ZodInt;
359
+ searchVolume: ZodNullable<ZodInt>;
360
+ }, $strip>>;
361
+ }, $strip>>;
362
+ }, $strip>;
363
+ type SeoKeywordsOutput = output<typeof SeoKeywordsOutput>;
364
+ declare const SeoKeywordTrendsOutput: ZodObject<{
365
+ keywords: ZodArray<ZodString>;
366
+ timeline: ZodArray<ZodObject<{
367
+ from: ZodString;
368
+ to: ZodString;
369
+ values: ZodArray<ZodNullable<ZodInt>>;
370
+ }, $strip>>;
371
+ }, $strip>;
372
+ type SeoKeywordTrendsOutput = output<typeof SeoKeywordTrendsOutput>;
373
+ declare const SeoDomainKeywordsOutput: ZodObject<{
374
+ domain: ZodString;
375
+ totalCount: ZodInt;
376
+ keywords: ZodArray<ZodObject<{
377
+ keyword: ZodString;
378
+ searchVolume: ZodNullable<ZodInt>;
379
+ cpc: ZodNullable<ZodNumber>;
380
+ difficulty: ZodNullable<ZodInt>;
381
+ intent: ZodNullable<ZodEnum<{
382
+ informational: "informational";
383
+ navigational: "navigational";
384
+ commercial: "commercial";
385
+ transactional: "transactional";
386
+ }>>;
387
+ position: ZodInt;
388
+ url: ZodNullable<ZodString>;
389
+ traffic: ZodNullable<ZodNumber>;
390
+ }, $strip>>;
391
+ }, $strip>;
392
+ type SeoDomainKeywordsOutput = output<typeof SeoDomainKeywordsOutput>;
393
+ declare const SeoDomainCompetitorsOutput: ZodObject<{
394
+ domain: ZodString;
395
+ competitors: ZodArray<ZodObject<{
396
+ domain: ZodString;
397
+ sharedKeywords: ZodInt;
398
+ avgPosition: ZodNullable<ZodNumber>;
399
+ organicKeywords: ZodNullable<ZodInt>;
400
+ traffic: ZodNullable<ZodNumber>;
401
+ }, $strip>>;
402
+ }, $strip>;
403
+ type SeoDomainCompetitorsOutput = output<typeof SeoDomainCompetitorsOutput>;
404
+ declare const SeoKeywordGapOutput: ZodObject<{
405
+ domain: ZodString;
406
+ competitor: ZodString;
407
+ keywords: ZodArray<ZodObject<{
408
+ keyword: ZodString;
409
+ searchVolume: ZodNullable<ZodInt>;
410
+ cpc: ZodNullable<ZodNumber>;
411
+ difficulty: ZodNullable<ZodInt>;
412
+ intent: ZodNullable<ZodEnum<{
413
+ informational: "informational";
414
+ navigational: "navigational";
415
+ commercial: "commercial";
416
+ transactional: "transactional";
417
+ }>>;
418
+ competitorPosition: ZodNullable<ZodInt>;
419
+ competitorUrl: ZodNullable<ZodString>;
420
+ domainPosition: ZodNullable<ZodInt>;
421
+ domainUrl: ZodNullable<ZodString>;
422
+ }, $strip>>;
423
+ }, $strip>;
424
+ type SeoKeywordGapOutput = output<typeof SeoKeywordGapOutput>;
425
+ declare const SeoPageAnalyzeOutput: ZodObject<{
426
+ url: ZodString;
427
+ statusCode: ZodNullable<ZodInt>;
428
+ title: ZodNullable<ZodString>;
429
+ description: ZodNullable<ZodString>;
430
+ canonical: ZodNullable<ZodString>;
431
+ headings: ZodObject<{
432
+ h1: ZodArray<ZodString>;
433
+ h2: ZodArray<ZodString>;
434
+ h3: ZodArray<ZodString>;
435
+ }, $strip>;
436
+ wordCount: ZodNullable<ZodInt>;
437
+ links: ZodObject<{
438
+ internal: ZodNullable<ZodInt>;
439
+ external: ZodNullable<ZodInt>;
440
+ }, $strip>;
441
+ images: ZodNullable<ZodInt>;
442
+ hasStructuredData: ZodNullable<ZodBoolean>;
443
+ score: ZodNullable<ZodNumber>;
444
+ issues: ZodArray<ZodString>;
445
+ social: ZodRecord<ZodString, ZodString>;
446
+ content: ZodArray<ZodObject<{
447
+ heading: ZodNullable<ZodString>;
448
+ level: ZodNullable<ZodInt>;
449
+ text: ZodString;
450
+ }, $strip>>;
451
+ }, $strip>;
452
+ type SeoPageAnalyzeOutput = output<typeof SeoPageAnalyzeOutput>;
453
+ declare const SeoBacklinksSummaryOutput: ZodObject<{
454
+ domain: ZodString;
455
+ rank: ZodNullable<ZodInt>;
456
+ backlinks: ZodNullable<ZodInt>;
457
+ referringDomains: ZodNullable<ZodInt>;
458
+ referringDomainsNofollow: ZodNullable<ZodInt>;
459
+ referringMainDomains: ZodNullable<ZodInt>;
460
+ referringIps: ZodNullable<ZodInt>;
461
+ brokenBacklinks: ZodNullable<ZodInt>;
462
+ spamScore: ZodNullable<ZodInt>;
463
+ firstSeen: ZodNullable<ZodString>;
464
+ topTlds: ZodRecord<ZodString, ZodInt>;
465
+ topCountries: ZodRecord<ZodString, ZodInt>;
466
+ }, $strip>;
467
+ type SeoBacklinksSummaryOutput = output<typeof SeoBacklinksSummaryOutput>;
468
+ /** `GET /v1/seo/locations` (0 credits). */
469
+ declare const SeoLocationsOutput: ZodObject<{
470
+ countries: ZodArray<ZodObject<{
471
+ country: ZodString;
472
+ name: ZodString;
473
+ dataLanguages: ZodArray<ZodString>;
474
+ }, $strip>>;
475
+ languages: ZodArray<ZodObject<{
476
+ language: ZodString;
477
+ name: ZodString;
478
+ }, $strip>>;
479
+ }, $strip>;
480
+ type SeoLocationsOutput = output<typeof SeoLocationsOutput>;
481
+
482
+ /** `T` with the fields SDK-API fills by default (`K`) optional. */
483
+ type Defaulted<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
484
+ /**
485
+ * Creates the `seo` namespace (the same object as `totalum.seo`, scope `seo`): search and AI-answer research —
486
+ * Google results, AI Overviews and AI Mode, Maps, what ChatGPT, Claude, Gemini and Perplexity answer and cite,
487
+ * keyword ideas and volumes, competitors and keyword gaps, backlinks and on-page analysis — for a country and
488
+ * language (ISO codes, e.g. `es`/`es`), billed in credits (every result carries `usage.credits`); plus IndexNow for
489
+ * verified custom domains, free. The plan limits the research calls per minute and per month.
490
+ *
491
+ * @param options - The project key, API URL and environment; each falls back to its environment variable.
492
+ * @returns The `seo` namespace: the methods below.
493
+ * @example
494
+ * import { totalumSeo } from 'totalum-sdk/seo';
495
+ *
496
+ * const seo = totalumSeo();
497
+ * const { keywords } = await seo.keywords.ideas({ keywords: ['dentista'], country: 'es', language: 'es' });
498
+ */
7
499
  declare function totalumSeo(options?: TotalumClientOptions): {
8
- /** Tells search engines (IndexNow) that these URLs of the project's custom domains changed. */
500
+ /**
501
+ * Tells the search engines that use IndexNow (Bing, Yandex, Seznam, Naver, …) that these pages of the project's
502
+ * custom domain were added or changed, so they are crawled again soon, and fetches each domain's `/sitemap.xml` so
503
+ * it is fresh. Call it after publishing a post or editing a product page. Only verified custom domains are sent:
504
+ * for Totalum's own hosts the answer is `indexNow: 'skipped_no_custom_domain'`. Free.
505
+ *
506
+ * @param urls - Full URLs on the project's hostnames.
507
+ * @returns How many URLs were accepted and what was sent.
508
+ * @throws URL_NOT_PROJECT_HOST (400) A URL is not on one of the project's hostnames; `details.url`.
509
+ * @throws INDEXNOW_ERROR (502) IndexNow refused the submission.
510
+ * @throws ENGINE_UNAVAILABLE (502) SEO is unavailable; retry shortly.
511
+ * @example
512
+ * const out = await totalum.seo.notifyChanged(['https://www.acme.com/blog/launch', 'https://www.acme.com/pricing']);
513
+ * //=>
514
+ * { "accepted": 2, "indexNow": "sent", "sitemapsPinged": true }
515
+ */
9
516
  notifyChanged: (urls: string[]) => Promise<{
10
517
  accepted: number;
11
518
  indexNow: "error" | "sent" | "skipped_no_custom_domain";
12
519
  sitemapsPinged: boolean;
13
520
  }>;
14
- /** The key the template serves at `/<key>.txt`. */
521
+ /**
522
+ * The project's IndexNow key: the template serves it at `/<key>.txt` so search engines can check the submissions
523
+ * are yours. Free.
524
+ *
525
+ * @returns The key and the URL it is served at.
526
+ * @throws ENGINE_UNAVAILABLE (502) SEO is unavailable; retry shortly.
527
+ * @example
528
+ * const { key, keyLocation } = await totalum.seo.indexNowKey();
529
+ * //=>
530
+ * { "key": "99d8cc52…", "keyLocation": "https://acme.totalum.app/99d8cc52….txt" }
531
+ */
15
532
  indexNowKey: () => Promise<{
16
533
  key: string;
17
534
  keyLocation: string;
18
535
  }>;
536
+ /**
537
+ * The countries and languages the research methods accept, and for each country the languages keyword, domain
538
+ * and AI data exist in (search results take any listed language). Free.
539
+ *
540
+ * @returns Every country and language code.
541
+ * @throws FORBIDDEN_SCOPE (403) The key lacks the `seo` scope.
542
+ * @example
543
+ * const { countries } = await totalum.seo.locations();
544
+ * //=>
545
+ * { "countries": [{ "country": "es", "name": "Spain", "dataLanguages": ["es"] }, …], "languages": [{ "language": "ca", "name": "Catalan" }, …] }
546
+ */
547
+ locations: () => Promise<{
548
+ countries: {
549
+ country: string;
550
+ name: string;
551
+ dataLanguages: string[];
552
+ }[];
553
+ languages: {
554
+ language: string;
555
+ name: string;
556
+ }[];
557
+ }>;
558
+ serp: {
559
+ /**
560
+ * Google's results for a keyword as searched from a country (or one of its cities), in a language: the organic
561
+ * results, the featured snippet, "People also ask", related searches and the AI Overview with its sources. Use
562
+ * it to see what ranks and what the page that ranks must answer.
563
+ *
564
+ * @param input - The keyword, where it is searched from and how many results.
565
+ * @returns The results page and the credits it cost.
566
+ * @throws SEO_CITY_NOT_FOUND (400) No such city in `country`.
567
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
568
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
569
+ * @throws PROVIDER_TIMEOUT (504) The search took too long; retry.
570
+ * @throws PROVIDER_UNAVAILABLE (503) Search data is unavailable; retry later.
571
+ * @example
572
+ * const page = await totalum.seo.serp.google({ keyword: 'dentista barcelona', country: 'es', language: 'es', city: 'Barcelona' });
573
+ * //=>
574
+ * {
575
+ * "keyword": "dentista barcelona",
576
+ * "totalResults": 3150000,
577
+ * "organic": [{ "position": 1, "title": "Clínica Dental …", "url": "https://www.example.es/", "domain": "www.example.es", "snippet": "…", "breadcrumb": "https://www.example.es" }],
578
+ * "featuredSnippet": null,
579
+ * "peopleAlsoAsk": [{ "question": "¿Cuánto cuesta un empaste en Barcelona?", "answer": null }],
580
+ * "relatedSearches": ["dentista barcelona urgencias"],
581
+ * "aiOverview": null,
582
+ * "usage": { "credits": 0.1429 }
583
+ * }
584
+ */
585
+ google: (input: Defaulted<SeoSerpGoogleInput, "depth" | "device">) => Promise<Omit<{
586
+ keyword: string;
587
+ totalResults: number | null;
588
+ organic: {
589
+ position: number;
590
+ title: string | null;
591
+ url: string;
592
+ domain: string | null;
593
+ snippet: string | null;
594
+ breadcrumb: string | null;
595
+ }[];
596
+ featuredSnippet: {
597
+ title: string | null;
598
+ snippet: string | null;
599
+ url: string;
600
+ domain: string | null;
601
+ } | null;
602
+ peopleAlsoAsk: {
603
+ question: string;
604
+ answer: {
605
+ title: string | null;
606
+ url: string;
607
+ domain: string | null;
608
+ snippet: string | null;
609
+ } | null;
610
+ }[];
611
+ relatedSearches: string[];
612
+ aiOverview: {
613
+ text: string;
614
+ sources: {
615
+ title: string | null;
616
+ url: string;
617
+ domain: string | null;
618
+ }[];
619
+ } | null;
620
+ }, "usage"> & {
621
+ usage: Usage;
622
+ }>;
623
+ /**
624
+ * Google's AI Mode answer for a question and the pages it cites, where Google offers AI Mode.
625
+ *
626
+ * @param input - The question and where it is asked from.
627
+ * @returns The answer, its sources and the credits it cost.
628
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) Google does not offer AI Mode there, or no data for that country and language.
629
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
630
+ * @throws PROVIDER_TIMEOUT (504) The search took too long; retry.
631
+ * @throws PROVIDER_UNAVAILABLE (503) Search data is unavailable; retry later.
632
+ * @example
633
+ * const ai = await totalum.seo.serp.aiMode({ keyword: 'best budgeting apps', country: 'us', language: 'en' });
634
+ * //=>
635
+ * { "keyword": "best budgeting apps", "answer": "Popular choices include …", "sources": [{ "title": "…", "url": "https://…", "domain": "…" }], "usage": { "credits": 0.2858 } }
636
+ */
637
+ aiMode: (input: Defaulted<SeoSerpAiModeInput, "device">) => Promise<Omit<{
638
+ keyword: string;
639
+ answer: string;
640
+ sources: {
641
+ title: string | null;
642
+ url: string;
643
+ domain: string | null;
644
+ }[];
645
+ }, "usage"> & {
646
+ usage: Usage;
647
+ }>;
648
+ /**
649
+ * Google Maps results for a search (local businesses): name, category, address, phone, website, rating and
650
+ * reviews — the local competitors of a business.
651
+ *
652
+ * @param input - The search, where it is made from and how many results.
653
+ * @returns The places, best first, and the credits it cost.
654
+ * @throws SEO_CITY_NOT_FOUND (400) No such city in `country`.
655
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
656
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
657
+ * @throws PROVIDER_TIMEOUT (504) The search took too long; retry.
658
+ * @throws PROVIDER_UNAVAILABLE (503) Search data is unavailable; retry later.
659
+ * @example
660
+ * const { results } = await totalum.seo.serp.maps({ keyword: 'dentista', country: 'es', language: 'es', city: 'Barcelona', depth: 10 });
661
+ * //=>
662
+ * { "keyword": "dentista", "results": [{ "position": 1, "title": "Clínica Dental …", "category": "Dentista", "rating": 4.9, "reviews": 812, … }], "usage": { "credits": 0.1429 } }
663
+ */
664
+ maps: (input: Defaulted<SeoSerpMapsInput, "depth">) => Promise<Omit<{
665
+ keyword: string;
666
+ results: {
667
+ position: number;
668
+ title: string;
669
+ category: string | null;
670
+ address: string | null;
671
+ city: string | null;
672
+ phone: string | null;
673
+ website: string | null;
674
+ rating: number | null;
675
+ reviews: number | null;
676
+ priceLevel: string | null;
677
+ latitude: number | null;
678
+ longitude: number | null;
679
+ placeId: string | null;
680
+ claimed: boolean | null;
681
+ }[];
682
+ }, "usage"> & {
683
+ usage: Usage;
684
+ }>;
685
+ };
686
+ ai: {
687
+ /**
688
+ * What an AI assistant (ChatGPT, Claude, Gemini or Perplexity) answers to a question, with the web searches it
689
+ * ran, the pages it cited and their domains — to see which brands and sites the AIs recommend (GEO). Among the
690
+ * dearer research calls: ask a few real questions, not dozens.
691
+ *
692
+ * @param input - The question, the assistant and the country its web search runs from.
693
+ * @returns The answer, its sources and the credits it cost.
694
+ * @throws SEO_REQUEST_REJECTED (400) The question or model was refused; `details.field`.
695
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
696
+ * @throws PROVIDER_TIMEOUT (504) The answer took too long; retry.
697
+ * @throws PROVIDER_UNAVAILABLE (503) The AI data is unavailable; retry later.
698
+ * @example
699
+ * const a = await totalum.seo.ai.answer({ prompt: 'Mejor clínica dental en Barcelona', platform: 'chatgpt', country: 'es' });
700
+ * //=>
701
+ * { "platform": "chatgpt", "model": "…", "answer": "Algunas de las clínicas mejor valoradas …", "sources": [{ "title": "…", "url": "https://…", "domain": "…" }], "citedDomains": ["www.doctoralia.es"], "searchQueries": ["mejor clínica dental barcelona"], "usage": { "credits": 2.1883 } }
702
+ */
703
+ answer: (input: Defaulted<SeoAiAnswerInput, "platform" | "webSearch">) => Promise<Omit<{
704
+ platform: "claude" | "chatgpt" | "gemini" | "perplexity";
705
+ model: string;
706
+ answer: string;
707
+ sources: {
708
+ title: string | null;
709
+ url: string;
710
+ domain: string | null;
711
+ }[];
712
+ citedDomains: string[];
713
+ searchQueries: string[];
714
+ }, "usage"> & {
715
+ usage: Usage;
716
+ }>;
717
+ /**
718
+ * ChatGPT's search answer for a query as shown to users in a country: the answer, the sources and search results
719
+ * it showed, and the brands it named.
720
+ *
721
+ * @param input - The query and the country and language.
722
+ * @returns The answer, its sources, brands and the credits it cost.
723
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
724
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
725
+ * @throws PROVIDER_TIMEOUT (504) The answer took too long; retry.
726
+ * @throws PROVIDER_UNAVAILABLE (503) The AI data is unavailable; retry later.
727
+ * @example
728
+ * const s = await totalum.seo.ai.chatgptSearch({ keyword: 'best budgeting app', country: 'us', language: 'en' });
729
+ * //=>
730
+ * { "keyword": "best budgeting app", "answer": "…", "sources": [], "searchResults": [], "brands": [{ "name": "YNAB", "category": "Software" }], "searchQueries": ["best budgeting app 2026"], "usage": { "credits": 0.2858 } }
731
+ */
732
+ chatgptSearch: (input: SeoChatGptSearchInput) => Promise<Omit<{
733
+ keyword: string;
734
+ answer: string;
735
+ sources: {
736
+ title: string | null;
737
+ url: string;
738
+ domain: string | null;
739
+ snippet: string | null;
740
+ publishedAt: string | null;
741
+ }[];
742
+ searchResults: {
743
+ title: string | null;
744
+ url: string;
745
+ domain: string | null;
746
+ }[];
747
+ brands: {
748
+ name: string;
749
+ category: string | null;
750
+ }[];
751
+ searchQueries: string[];
752
+ }, "usage"> & {
753
+ usage: Usage;
754
+ }>;
755
+ /**
756
+ * Where a domain, or a keyword or brand, is mentioned in AI answers (Google's AI Overviews; ChatGPT for the
757
+ * United States in English): the questions and answers, or the most cited domains or pages. Give exactly one
758
+ * of `domain` or `keyword`. The dearest research call: use it once per brand, not per page.
759
+ *
760
+ * @param input - The domain or keyword, the place, the AI and the view.
761
+ * @returns The mentions (or top domains or pages) and the credits it cost.
762
+ * @throws VALIDATION_ERROR (400) Neither or both of `domain` and `keyword`.
763
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
764
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
765
+ * @throws PROVIDER_UNAVAILABLE (503) The AI data is unavailable; retry later.
766
+ * @example
767
+ * const m = await totalum.seo.ai.mentions({ keyword: 'budgeting app', country: 'us', language: 'en', view: 'top-domains', limit: 5 });
768
+ * //=>
769
+ * { "totalCount": 1814, "domains": [{ "domain": "www.nerdwallet.com", "mentions": 416, "aiSearchVolume": 316550 }], "usage": { "credits": 7.5 } }
770
+ */
771
+ mentions: (input: Defaulted<SeoAiMentionsInput, "view" | "limit">) => Promise<Omit<{
772
+ totalCount: number;
773
+ mentions?: {
774
+ platform: "chatgpt" | "google";
775
+ question: string;
776
+ answer: string;
777
+ sources: {
778
+ title: string | null;
779
+ url: string;
780
+ domain: string | null;
781
+ }[];
782
+ brands: {
783
+ name: string;
784
+ category: string | null;
785
+ }[];
786
+ aiSearchVolume: number | null;
787
+ }[] | undefined;
788
+ domains?: {
789
+ mentions: number;
790
+ aiSearchVolume: number | null;
791
+ domain: string;
792
+ }[] | undefined;
793
+ pages?: {
794
+ mentions: number;
795
+ aiSearchVolume: number | null;
796
+ url: string;
797
+ }[] | undefined;
798
+ }, "usage"> & {
799
+ usage: Usage;
800
+ }>;
801
+ /**
802
+ * How often keywords are asked to AI assistants per month (AI search volume), per keyword.
803
+ *
804
+ * @param input - Up to 1,000 keywords and the place.
805
+ * @returns The AI search volume per keyword and the credits it cost.
806
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
807
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
808
+ * @throws PROVIDER_UNAVAILABLE (503) The AI data is unavailable; retry later.
809
+ * @example
810
+ * const v = await totalum.seo.ai.keywordVolume({ keywords: ['budget planner'], country: 'us', language: 'en' });
811
+ * //=>
812
+ * { "keywords": [{ "keyword": "budget planner", "aiSearchVolume": 3241, "monthlySearches": [{ "year": 2026, "month": 10, "aiSearchVolume": 3241 }] }], "usage": { "credits": 0.7215 } }
813
+ */
814
+ keywordVolume: (input: SeoAiKeywordVolumeInput) => Promise<Omit<{
815
+ keywords: {
816
+ keyword: string;
817
+ aiSearchVolume: number | null;
818
+ monthlySearches: {
819
+ year: number;
820
+ month: number;
821
+ aiSearchVolume: number | null;
822
+ }[];
823
+ }[];
824
+ }, "usage"> & {
825
+ usage: Usage;
826
+ }>;
827
+ };
828
+ keywords: {
829
+ /**
830
+ * Keyword ideas around seed keywords (phrases containing the first seed first, then wider ideas), each with its
831
+ * monthly Google search volume, cost per click, competition, difficulty and intent — to choose what a page or an
832
+ * article targets.
833
+ *
834
+ * @param input - Up to 20 seed keywords, the place and how many ideas.
835
+ * @returns The ideas and the credits it cost.
836
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No keyword data for that country and language.
837
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
838
+ * @throws PROVIDER_UNAVAILABLE (503) Keyword data is unavailable; retry later.
839
+ * @example
840
+ * const { keywords } = await totalum.seo.keywords.ideas({ keywords: ['dentista barcelona'], country: 'es', language: 'es', limit: 20 });
841
+ * //=>
842
+ * { "keywords": [{ "keyword": "dentista barcelona", "searchVolume": 4400, "cpc": 2.1, "competition": 0.4, "competitionLevel": "medium", "difficulty": 31, "intent": "commercial", "trend": { "monthly": 0, "quarterly": 22, "yearly": -18 }, "monthlySearches": [{ "year": 2026, "month": 10, "searchVolume": 4400 }] }], "usage": { "credits": 2.0572 } }
843
+ */
844
+ ideas: (input: Defaulted<SeoKeywordIdeasInput, "limit">) => Promise<Omit<{
845
+ keywords: {
846
+ keyword: string;
847
+ searchVolume: number | null;
848
+ cpc: number | null;
849
+ competition: number | null;
850
+ competitionLevel: "low" | "medium" | "high" | null;
851
+ difficulty: number | null;
852
+ intent: "informational" | "navigational" | "commercial" | "transactional" | null;
853
+ trend: {
854
+ monthly: number | null;
855
+ quarterly: number | null;
856
+ yearly: number | null;
857
+ } | null;
858
+ monthlySearches: {
859
+ year: number;
860
+ month: number;
861
+ searchVolume: number | null;
862
+ }[];
863
+ }[];
864
+ }, "usage"> & {
865
+ usage: Usage;
866
+ }>;
867
+ /**
868
+ * The searches Google relates to a keyword ("related searches", followed `depth` hops), with the same data as
869
+ * `ideas` — topic clusters and article ideas.
870
+ *
871
+ * @param input - The keyword, the place, the depth and how many.
872
+ * @returns The related keywords and the credits it cost.
873
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No keyword data for that country and language.
874
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
875
+ * @throws PROVIDER_UNAVAILABLE (503) Keyword data is unavailable; retry later.
876
+ * @example
877
+ * const { keywords } = await totalum.seo.keywords.related({ keyword: 'emergency fund', country: 'us', language: 'en', limit: 20 });
878
+ * //=>
879
+ * { "keywords": [{ "keyword": "how much emergency fund", "searchVolume": 2900, "difficulty": 22, "intent": "informational", … }], "usage": { "credits": 0.9343 } }
880
+ */
881
+ related: (input: Defaulted<SeoKeywordRelatedInput, "depth" | "limit">) => Promise<Omit<{
882
+ keywords: {
883
+ keyword: string;
884
+ searchVolume: number | null;
885
+ cpc: number | null;
886
+ competition: number | null;
887
+ competitionLevel: "low" | "medium" | "high" | null;
888
+ difficulty: number | null;
889
+ intent: "informational" | "navigational" | "commercial" | "transactional" | null;
890
+ trend: {
891
+ monthly: number | null;
892
+ quarterly: number | null;
893
+ yearly: number | null;
894
+ } | null;
895
+ monthlySearches: {
896
+ year: number;
897
+ month: number;
898
+ searchVolume: number | null;
899
+ }[];
900
+ }[];
901
+ }, "usage"> & {
902
+ usage: Usage;
903
+ }>;
904
+ /**
905
+ * The search data of keywords you already have (up to 700): volume, cost per click, competition, difficulty,
906
+ * intent and the last 12 months.
907
+ *
908
+ * @param input - The keywords and the place.
909
+ * @returns One row per keyword found and the credits it cost.
910
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No keyword data for that country and language.
911
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
912
+ * @throws PROVIDER_UNAVAILABLE (503) Keyword data is unavailable; retry later.
913
+ * @example
914
+ * const { keywords } = await totalum.seo.keywords.overview({ keywords: ['implantes dentales barcelona', 'ortodoncia invisible barcelona'], country: 'es', language: 'es' });
915
+ * //=>
916
+ * { "keywords": [{ "keyword": "implantes dentales barcelona", "searchVolume": 1900, "difficulty": 28, … }], "usage": { "credits": 0.8743 } }
917
+ */
918
+ overview: (input: SeoKeywordOverviewInput) => Promise<Omit<{
919
+ keywords: {
920
+ keyword: string;
921
+ searchVolume: number | null;
922
+ cpc: number | null;
923
+ competition: number | null;
924
+ competitionLevel: "low" | "medium" | "high" | null;
925
+ difficulty: number | null;
926
+ intent: "informational" | "navigational" | "commercial" | "transactional" | null;
927
+ trend: {
928
+ monthly: number | null;
929
+ quarterly: number | null;
930
+ yearly: number | null;
931
+ } | null;
932
+ monthlySearches: {
933
+ year: number;
934
+ month: number;
935
+ searchVolume: number | null;
936
+ }[];
937
+ }[];
938
+ }, "usage"> & {
939
+ usage: Usage;
940
+ }>;
941
+ /**
942
+ * Google Trends interest over time (0–100) for up to 5 keywords, worldwide or in a country — seasonality and
943
+ * which wording is rising.
944
+ *
945
+ * @param input - The keywords, the place (optional) and the period.
946
+ * @returns The timeline and the credits it cost.
947
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
948
+ * @throws PROVIDER_UNAVAILABLE (503) Trends data is unavailable; retry later.
949
+ * @example
950
+ * const t = await totalum.seo.keywords.trends({ keywords: ['budget app', 'expense tracker'], country: 'us' });
951
+ * //=>
952
+ * { "keywords": ["budget app", "expense tracker"], "timeline": [{ "from": "2025-11-23", "to": "2025-11-29", "values": [71, 40] }], "usage": { "credits": 0.7858 } }
953
+ */
954
+ trends: (input: Defaulted<SeoKeywordTrendsInput, "timeRange">) => Promise<Omit<{
955
+ keywords: string[];
956
+ timeline: {
957
+ from: string;
958
+ to: string;
959
+ values: (number | null)[];
960
+ }[];
961
+ }, "usage"> & {
962
+ usage: Usage;
963
+ }>;
964
+ };
965
+ domain: {
966
+ /**
967
+ * The keywords a domain ranks for on Google in a country, with its position, the ranking URL and the estimated
968
+ * traffic — what a competitor gets its visits from.
969
+ *
970
+ * @param input - The domain, the place and how many keywords.
971
+ * @returns The ranked keywords, best first, and the credits it cost.
972
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
973
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
974
+ * @throws PROVIDER_UNAVAILABLE (503) Domain data is unavailable; retry later.
975
+ * @example
976
+ * const d = await totalum.seo.domain.keywords({ domain: 'example.es', country: 'es', language: 'es', limit: 20 });
977
+ * //=>
978
+ * { "domain": "example.es", "totalCount": 1273, "keywords": [{ "keyword": "…", "position": 1, "url": "https://example.es/p", "traffic": 2.97, "searchVolume": 880, … }], "usage": { "credits": 0.9 } }
979
+ */
980
+ keywords: (input: Defaulted<SeoDomainKeywordsInput, "limit">) => Promise<Omit<{
981
+ domain: string;
982
+ totalCount: number;
983
+ keywords: {
984
+ keyword: string;
985
+ searchVolume: number | null;
986
+ cpc: number | null;
987
+ difficulty: number | null;
988
+ intent: "informational" | "navigational" | "commercial" | "transactional" | null;
989
+ position: number;
990
+ url: string | null;
991
+ traffic: number | null;
992
+ }[];
993
+ }, "usage"> & {
994
+ usage: Usage;
995
+ }>;
996
+ /**
997
+ * The domains that compete with a domain on Google in a country (most shared keywords first).
998
+ *
999
+ * @param input - The domain, the place and how many competitors.
1000
+ * @returns The competitors and the credits it cost.
1001
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
1002
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
1003
+ * @throws PROVIDER_UNAVAILABLE (503) Domain data is unavailable; retry later.
1004
+ * @example
1005
+ * const c = await totalum.seo.domain.competitors({ domain: 'example.es', country: 'es', language: 'es', limit: 5 });
1006
+ * //=>
1007
+ * { "domain": "example.es", "competitors": [{ "domain": "rival.es", "sharedKeywords": 540, "avgPosition": 18.2, "organicKeywords": 9000, "traffic": 12000 }], "usage": { "credits": 0.9086 } }
1008
+ */
1009
+ competitors: (input: Defaulted<SeoDomainCompetitorsInput, "limit">) => Promise<Omit<{
1010
+ domain: string;
1011
+ competitors: {
1012
+ domain: string;
1013
+ sharedKeywords: number;
1014
+ avgPosition: number | null;
1015
+ organicKeywords: number | null;
1016
+ traffic: number | null;
1017
+ }[];
1018
+ }, "usage"> & {
1019
+ usage: Usage;
1020
+ }>;
1021
+ /**
1022
+ * The keyword gap between a domain and a competitor: the keywords the competitor ranks for and the domain does
1023
+ * not (`missing`), or that both rank for (`shared`).
1024
+ *
1025
+ * @param input - The domain, the competitor, the place, the mode and how many.
1026
+ * @returns The keywords with both positions and the credits it cost.
1027
+ * @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
1028
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
1029
+ * @throws PROVIDER_UNAVAILABLE (503) Domain data is unavailable; retry later.
1030
+ * @example
1031
+ * const g = await totalum.seo.domain.keywordGap({ domain: 'example.es', competitor: 'rival.es', country: 'es', language: 'es' });
1032
+ * //=>
1033
+ * { "domain": "example.es", "competitor": "rival.es", "keywords": [{ "keyword": "…", "competitorPosition": 3, "competitorUrl": "https://rival.es/p", "domainPosition": null, "domainUrl": null, … }], "usage": { "credits": 0.9 } }
1034
+ */
1035
+ keywordGap: (input: Defaulted<SeoKeywordGapInput, "mode" | "limit">) => Promise<Omit<{
1036
+ domain: string;
1037
+ competitor: string;
1038
+ keywords: {
1039
+ keyword: string;
1040
+ searchVolume: number | null;
1041
+ cpc: number | null;
1042
+ difficulty: number | null;
1043
+ intent: "informational" | "navigational" | "commercial" | "transactional" | null;
1044
+ competitorPosition: number | null;
1045
+ competitorUrl: string | null;
1046
+ domainPosition: number | null;
1047
+ domainUrl: string | null;
1048
+ }[];
1049
+ }, "usage"> & {
1050
+ usage: Usage;
1051
+ }>;
1052
+ /**
1053
+ * A domain's backlink profile: authority rank, backlinks, referring domains, spam score and where its links come
1054
+ * from.
1055
+ *
1056
+ * @param input - The domain.
1057
+ * @returns The summary and the credits it cost.
1058
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
1059
+ * @throws PROVIDER_UNAVAILABLE (503) Backlink data is unavailable; retry later.
1060
+ * @example
1061
+ * const b = await totalum.seo.domain.backlinks({ domain: 'example.es' });
1062
+ * //=>
1063
+ * { "domain": "example.es", "rank": 212, "backlinks": 667, "referringDomains": 235, "spamScore": 11, …, "usage": { "credits": 1.7169 } }
1064
+ */
1065
+ backlinks: (input: SeoBacklinksSummaryInput) => Promise<Omit<{
1066
+ domain: string;
1067
+ rank: number | null;
1068
+ backlinks: number | null;
1069
+ referringDomains: number | null;
1070
+ referringDomainsNofollow: number | null;
1071
+ referringMainDomains: number | null;
1072
+ referringIps: number | null;
1073
+ brokenBacklinks: number | null;
1074
+ spamScore: number | null;
1075
+ firstSeen: string | null;
1076
+ topTlds: Record<string, number>;
1077
+ topCountries: Record<string, number>;
1078
+ }, "usage"> & {
1079
+ usage: Usage;
1080
+ }>;
1081
+ };
1082
+ page: {
1083
+ /**
1084
+ * Reads one public page as a search engine does: title, description, canonical, headings, word count, links,
1085
+ * images, structured data, social tags, an on-page score with the issues found, and its main text by section —
1086
+ * the structure of a page that ranks.
1087
+ *
1088
+ * @param input - The page's URL.
1089
+ * @returns The page analysis and the credits it cost.
1090
+ * @throws SEO_REQUEST_REJECTED (400) The page could not be read; `details.field`.
1091
+ * @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
1092
+ * @throws PROVIDER_TIMEOUT (504) The page took too long; retry.
1093
+ * @throws PROVIDER_UNAVAILABLE (503) Page analysis is unavailable; retry later.
1094
+ * @example
1095
+ * const p = await totalum.seo.page.analyze({ url: 'https://www.example.es/' });
1096
+ * //=>
1097
+ * { "url": "https://www.example.es/", "statusCode": 200, "title": "Ejemplo", "headings": { "h1": ["Ejemplo"], "h2": ["…"], "h3": [] }, "wordCount": 2418, "hasStructuredData": true, "score": 91.59, "issues": ["title_too_long"], "content": [{ "heading": "Ejemplo", "level": 1, "text": "…" }], …, "usage": { "credits": 0.0215 } }
1098
+ */
1099
+ analyze: (input: SeoPageAnalyzeInput) => Promise<Omit<{
1100
+ url: string;
1101
+ statusCode: number | null;
1102
+ title: string | null;
1103
+ description: string | null;
1104
+ canonical: string | null;
1105
+ headings: {
1106
+ h1: string[];
1107
+ h2: string[];
1108
+ h3: string[];
1109
+ };
1110
+ wordCount: number | null;
1111
+ links: {
1112
+ internal: number | null;
1113
+ external: number | null;
1114
+ };
1115
+ images: number | null;
1116
+ hasStructuredData: boolean | null;
1117
+ score: number | null;
1118
+ issues: string[];
1119
+ social: Record<string, string>;
1120
+ content: {
1121
+ heading: string | null;
1122
+ level: number | null;
1123
+ text: string;
1124
+ }[];
1125
+ }, "usage"> & {
1126
+ usage: Usage;
1127
+ }>;
1128
+ };
19
1129
  };
20
1130
  type TotalumSeo = ReturnType<typeof totalumSeo>;
21
1131
 
22
- export { TotalumClientOptions, totalumSeo };
1132
+ export { SeoAiAnswerInput, SeoAiAnswerOutput, SeoAiKeywordVolumeInput, SeoAiKeywordVolumeOutput, SeoAiMentionsInput, SeoAiMentionsOutput, SeoBacklinksSummaryInput, SeoBacklinksSummaryOutput, SeoChatGptSearchInput, SeoChatGptSearchOutput, SeoDomainCompetitorsInput, SeoDomainCompetitorsOutput, SeoDomainKeywordsInput, SeoDomainKeywordsOutput, SeoKeyword, SeoKeywordGapInput, SeoKeywordGapOutput, SeoKeywordIdeasInput, SeoKeywordOverviewInput, SeoKeywordRelatedInput, SeoKeywordTrendsInput, SeoKeywordTrendsOutput, SeoKeywordsOutput, SeoLocationsOutput, SeoPageAnalyzeInput, SeoPageAnalyzeOutput, SeoSerpAiModeInput, SeoSerpAiModeOutput, SeoSerpGoogleInput, SeoSerpGoogleOutput, SeoSerpMapsInput, SeoSerpMapsOutput, SeoSource, TotalumClientOptions, totalumSeo };
23
1133
  export type { TotalumSeo };