@kite-sa/sdk 0.0.0-stage → 0.6.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.
@@ -0,0 +1,1432 @@
1
+ import type { operations } from "./openapi.js";
2
+ type Op = keyof operations;
3
+ type QueryOf<K extends Op> = operations[K]["parameters"] extends {
4
+ query?: infer Q;
5
+ } ? NonNullable<Q> : never;
6
+ type BodyOf<K extends Op> = operations[K] extends {
7
+ requestBody: {
8
+ content: {
9
+ "application/json": infer B;
10
+ };
11
+ };
12
+ } ? B : never;
13
+ type HeaderOf<K extends Op> = operations[K]["parameters"] extends {
14
+ header?: infer H;
15
+ } ? NonNullable<H> : never;
16
+ type Query = Record<string, string | number | boolean | readonly (string | number)[] | undefined>;
17
+ type Headers = Record<string, string | undefined>;
18
+ /** The low-level caller `Kite` hands to the generated namespaces. */
19
+ export type Request = <T>(method: string, path: string, options?: {
20
+ query?: Query;
21
+ body?: unknown;
22
+ headers?: Headers;
23
+ }) => Promise<T>;
24
+ /** Every endpoint in the spec, namespaced by its operationId. */
25
+ export declare function createEndpoints(request: Request): {
26
+ readonly analytics: {
27
+ /**
28
+ * Find below-market listings. Residential listings asking noticeably less than
29
+ * similar listings nearby, biggest gap first.
30
+ */
31
+ readonly belowMarket: (params: QueryOf<"analytics.below_market">) => Promise<{
32
+ data: {
33
+ listing: import("./openapi-zod/models.js").Listing;
34
+ comparison: {
35
+ median_price_sar: unknown;
36
+ p25_price_sar: unknown;
37
+ p75_price_sar: unknown;
38
+ percent_vs_median: number | null;
39
+ sample_size: number;
40
+ radius_m: unknown;
41
+ look_back_days: unknown;
42
+ price_basis: string;
43
+ price_source: string;
44
+ };
45
+ }[];
46
+ pagination: import("./openapi-zod/models.js").Pagination;
47
+ }>;
48
+ /**
49
+ * Find below-market listings (old path). **Deprecated:** use GET
50
+ * /market/below-market, which takes the same parameters and returns the same
51
+ * response.
52
+ */
53
+ readonly deals: (params: QueryOf<"analytics.deals">) => Promise<{
54
+ data: {
55
+ listing: import("./openapi-zod/models.js").Listing;
56
+ comparison: {
57
+ median_price_sar: unknown;
58
+ p25_price_sar: unknown;
59
+ p75_price_sar: unknown;
60
+ percent_vs_median: number | null;
61
+ sample_size: number;
62
+ radius_m: unknown;
63
+ look_back_days: unknown;
64
+ price_basis: string;
65
+ price_source: string;
66
+ };
67
+ }[];
68
+ pagination: import("./openapi-zod/models.js").Pagination;
69
+ }>;
70
+ /**
71
+ * Get comparable listings. Active listings similar to this one, nearest first,
72
+ * with how each one differs. A comparable has the same city, listing type and
73
+ * property type, is within about 5 km, and has an area between 2/3 and 1.5 times
74
+ * this listing's (the comparison-approach caliper).
75
+ */
76
+ readonly listingComparables: (id: string | number, params?: QueryOf<"analytics.listing_comparables">) => Promise<{
77
+ data: {
78
+ listing_id: number;
79
+ price_basis: string;
80
+ price_source: string;
81
+ unavailable_reason: unknown;
82
+ criteria: {
83
+ max_distance_m: number;
84
+ area_range_sqm: unknown;
85
+ same_bedrooms: boolean;
86
+ };
87
+ summary: {
88
+ sample_size: number;
89
+ median_price_sar: unknown;
90
+ listing_price_sar: unknown;
91
+ diff_from_median_pct: number | null;
92
+ };
93
+ comparables: {
94
+ listing: import("./openapi-zod/models.js").Listing;
95
+ similarity: {
96
+ distance_m: unknown;
97
+ area_diff_pct: number | null;
98
+ price_diff_pct: number | null;
99
+ };
100
+ }[];
101
+ };
102
+ }>;
103
+ /**
104
+ * Get a listing's market position. Where a listing's price sits in its market:
105
+ * percentile, quartiles and difference from the median, against like-for-like
106
+ * listings in its neighborhood and in its city. The cohort is listings with the
107
+ * same listing type, category and property type, and for residential listings
108
+ * the same bedroom count.
109
+ */
110
+ readonly listingMarketPosition: (id: string | number) => Promise<{
111
+ data: {
112
+ listing_id: number;
113
+ price_basis: string;
114
+ price_source: string;
115
+ price_sar: unknown;
116
+ price_per_sqm_sar: unknown;
117
+ cohort: {
118
+ city: string;
119
+ listing_type: unknown;
120
+ listing_category: unknown;
121
+ property_type: string | null;
122
+ neighborhood_ids: unknown;
123
+ beds: unknown;
124
+ };
125
+ basis: unknown;
126
+ price_percentile: unknown;
127
+ diff_from_median_pct: number | null;
128
+ neighborhood: unknown;
129
+ city: unknown;
130
+ listing_in_sample: boolean;
131
+ window: {
132
+ updated_within_days: number;
133
+ from: string;
134
+ to: string;
135
+ };
136
+ };
137
+ }>;
138
+ /**
139
+ * Get a listing's nearby asking-price band. The 25th percentile, median and 75th
140
+ * percentile of asking prices for comparable units near this listing, in SAR and
141
+ * per m², where this listing's price sits against them, and the cohort and
142
+ * stability behind the numbers.
143
+ */
144
+ readonly listingPriceBand: (id: string | number) => Promise<{
145
+ data: {
146
+ listing_id: number;
147
+ status: string;
148
+ price_basis: string;
149
+ price_source: string;
150
+ price_sar: unknown;
151
+ price_per_sqm_sar: unknown;
152
+ band: unknown;
153
+ position: unknown;
154
+ stability: unknown;
155
+ cohort: unknown;
156
+ methodology: unknown;
157
+ };
158
+ }>;
159
+ /**
160
+ * Compare neighborhoods. Side-by-side profile of 2 to 5 neighborhoods: price
161
+ * quartiles, area, price per m², amenity shares, bedroom and property-type mix,
162
+ * and for rentals the gross yield against the same cohort's sale prices.
163
+ */
164
+ readonly neighborhoodsCompare: (params: QueryOf<"analytics.neighborhoods_compare">) => Promise<{
165
+ data: {
166
+ filters: {
167
+ city: string;
168
+ listing_type: unknown;
169
+ listing_category: unknown;
170
+ property_type: string | null;
171
+ neighborhood_ids: unknown;
172
+ beds: unknown;
173
+ };
174
+ price_basis: string;
175
+ price_source: string;
176
+ neighborhoods: {
177
+ neighborhood_id: number;
178
+ name_en: string;
179
+ name_ar: string;
180
+ sample_size: number;
181
+ median_price_sar: unknown;
182
+ p25_price_sar: unknown;
183
+ p75_price_sar: unknown;
184
+ median_area_sqm: unknown;
185
+ median_price_per_sqm_sar: unknown;
186
+ amenity_share_pct: {
187
+ ac: number | null;
188
+ parking: number | null;
189
+ pool: number | null;
190
+ lift: number | null;
191
+ furnished: number | null;
192
+ };
193
+ bedrooms_mix: {
194
+ "0": number;
195
+ "1": number;
196
+ "2": number;
197
+ "3": number;
198
+ "4": number;
199
+ "5_plus": number;
200
+ };
201
+ property_type_mix: Record<string, number>;
202
+ median_sale_price_sar?: unknown;
203
+ sale_sample_size?: number;
204
+ gross_yield_pct?: number | null;
205
+ }[];
206
+ window: {
207
+ updated_within_days: number;
208
+ from: string;
209
+ to: string;
210
+ };
211
+ };
212
+ }>;
213
+ /**
214
+ * Get gross rental yield. Gross rental yield (median yearly asking rent ÷ median
215
+ * asking sale price) for one property type, over the whole city (or the
216
+ * requested neighborhoods) and per neighborhood, highest yield first. Rent and
217
+ * sale medians come from the same cohort (property type, and bedrooms if given)
218
+ * in the same area.
219
+ */
220
+ readonly rentalYield: (params: QueryOf<"analytics.rental_yield">) => Promise<{
221
+ data: {
222
+ filters: {
223
+ city: string;
224
+ listing_type: unknown;
225
+ listing_category: unknown;
226
+ property_type: string | null;
227
+ neighborhood_ids: unknown;
228
+ beds: unknown;
229
+ };
230
+ overall: {
231
+ median_yearly_rent_sar: unknown;
232
+ median_sale_price_sar: unknown;
233
+ gross_yield_pct: number | null;
234
+ rent_sample_size: number;
235
+ sale_sample_size: number;
236
+ };
237
+ neighborhoods: {
238
+ median_yearly_rent_sar: unknown;
239
+ median_sale_price_sar: unknown;
240
+ gross_yield_pct: number | null;
241
+ rent_sample_size: number;
242
+ sale_sample_size: number;
243
+ neighborhood_id: number;
244
+ name_en: string | null;
245
+ name_ar: string | null;
246
+ }[];
247
+ price_source: string;
248
+ window: {
249
+ updated_within_days: number;
250
+ from: string;
251
+ to: string;
252
+ };
253
+ };
254
+ }>;
255
+ /**
256
+ * Get price trends. Monthly asking prices over recent months (up to 36), for a
257
+ * city or for up to five neighborhoods (one series each): the median and
258
+ * quartiles for the price level, and a constant-quality price index
259
+ * (`price_index`) for change over time.
260
+ */
261
+ readonly trends: (params: QueryOf<"analytics.trends">) => Promise<{
262
+ data: {
263
+ filters: {
264
+ city: string;
265
+ listing_type: unknown;
266
+ listing_category: unknown;
267
+ property_type: string | null;
268
+ neighborhood_ids: unknown;
269
+ beds: unknown;
270
+ };
271
+ price_basis: string;
272
+ price_source: string;
273
+ basis: string;
274
+ series: {
275
+ neighborhood_id: unknown;
276
+ name_en: string | null;
277
+ name_ar: string | null;
278
+ change_pct: number | null;
279
+ index_change_pct: number | null;
280
+ index_base_month: string | null;
281
+ points: {
282
+ month: string;
283
+ sample_size: number;
284
+ median_price_sar: unknown;
285
+ p25_price_sar: unknown;
286
+ p75_price_sar: unknown;
287
+ price_index: number | null;
288
+ index_cells: number;
289
+ index_sample_size: number;
290
+ partial: boolean;
291
+ coverage: string;
292
+ }[];
293
+ }[];
294
+ history: {
295
+ starts_on: string;
296
+ first_complete_month: string;
297
+ };
298
+ methodology: string;
299
+ };
300
+ }>;
301
+ };
302
+ readonly exports: {
303
+ /**
304
+ * Create an export. Starts an export of a whole dataset as files, for loading
305
+ * into a warehouse.
306
+ */
307
+ readonly create: (body: BodyOf<"exports.create">, headers?: HeaderOf<"exports.create">) => Promise<{
308
+ data: import("./openapi-zod/models.js").Export;
309
+ }>;
310
+ /**
311
+ * Get an export. An export's status and, once `completed`, a signed download
312
+ * link for every file, valid for 60 minutes; call again for fresh links.
313
+ */
314
+ readonly get: (exportId: string | number) => Promise<{
315
+ data: import("./openapi-zod/models.js").Export;
316
+ }>;
317
+ /**
318
+ * List exports. Your organization's exports, newest first, without download
319
+ * links (GET one export for those).
320
+ */
321
+ readonly list: (params?: QueryOf<"exports.list">) => Promise<{
322
+ data: import("./openapi-zod/models.js").Export[];
323
+ }>;
324
+ };
325
+ readonly listings: {
326
+ /** Get listings by id. Up to 100 listings in one call, in the order requested. */
327
+ readonly batch: (params: QueryOf<"listings.batch">) => Promise<{
328
+ data: import("./openapi-zod/models.js").Listing[];
329
+ missing_ids: number[];
330
+ }>;
331
+ /** Count listings. How many listings match the same filters as search. */
332
+ readonly count: (params: QueryOf<"listings.count">) => Promise<{
333
+ data: {
334
+ total: number;
335
+ };
336
+ }>;
337
+ /** Get a listing. One active listing. */
338
+ readonly get: (id: string | number) => Promise<{
339
+ data: import("./openapi-zod/models.js").Listing;
340
+ }>;
341
+ /**
342
+ * Get a listing's price history. Every price change Kite recorded for an active
343
+ * listing, oldest first.
344
+ */
345
+ readonly priceHistory: (id: string | number) => Promise<{
346
+ data: {
347
+ listing_id: number;
348
+ current_price_yearly_sar: unknown;
349
+ first_seen_at: unknown;
350
+ history_window_days: unknown;
351
+ changes: {
352
+ changed_at: string;
353
+ from_yearly_sar: number;
354
+ to_yearly_sar: unknown;
355
+ }[];
356
+ };
357
+ }>;
358
+ /**
359
+ * Search listings. Active, deduplicated listings in one city, quality-filtered
360
+ * like kite.sa.
361
+ */
362
+ readonly search: (params: QueryOf<"listings.search">) => Promise<{
363
+ data: import("./openapi-zod/models.js").Listing[];
364
+ pagination: import("./openapi-zod/models.js").Pagination;
365
+ }>;
366
+ };
367
+ readonly market: {
368
+ /**
369
+ * Area distribution. Histogram and percentiles of floor/plot area (m²) over
370
+ * listings in the sample that state an area (`without_area_count` did not).
371
+ */
372
+ readonly areaDistribution: (params: QueryOf<"market.area_distribution">) => Promise<{
373
+ data: {
374
+ filters: {
375
+ city: string;
376
+ listing_type: string;
377
+ listing_category: unknown;
378
+ property_type: string | null;
379
+ neighborhood_ids: unknown;
380
+ beds: unknown;
381
+ };
382
+ sample_size: number;
383
+ without_area_count: number;
384
+ median_area_sqm: unknown;
385
+ mean_area_sqm: unknown;
386
+ percentiles_sqm: {
387
+ p10: unknown;
388
+ p25: unknown;
389
+ p75: unknown;
390
+ p90: unknown;
391
+ };
392
+ range_sqm: {
393
+ min: number;
394
+ max: number;
395
+ };
396
+ buckets: {
397
+ min_sqm: number;
398
+ max_sqm: number;
399
+ count: number;
400
+ }[];
401
+ above_range_count: number;
402
+ window: {
403
+ updated_within_days: number;
404
+ from: string;
405
+ to: string;
406
+ };
407
+ };
408
+ }>;
409
+ /**
410
+ * Commercial rent per m² by neighborhood. Asking rent per m² of commercial space
411
+ * (shops, offices, warehouses, commercial land and whole buildings) by
412
+ * neighborhood, with the city-wide figure for each type as a benchmark.
413
+ */
414
+ readonly commercialRents: (params: QueryOf<"market.commercial_rents">) => Promise<{
415
+ data: {
416
+ filters: {
417
+ city: string;
418
+ listing_type: string;
419
+ listing_category: string;
420
+ property_types: string[];
421
+ neighborhood_ids: unknown;
422
+ area_min: unknown;
423
+ area_max: unknown;
424
+ };
425
+ price_basis: string;
426
+ price_source: string;
427
+ min_sample_size: number;
428
+ city_totals: {
429
+ property_type: string;
430
+ sample_size: number;
431
+ median_rent_per_sqm_sar: unknown;
432
+ p25_rent_per_sqm_sar: unknown;
433
+ p75_rent_per_sqm_sar: unknown;
434
+ median_area_sqm: unknown;
435
+ median_rent_sar: unknown;
436
+ street_width: {
437
+ sample_size: number;
438
+ median_m: number | null;
439
+ };
440
+ exclusions: {
441
+ listings_in_scope: number;
442
+ lease_takeover: number;
443
+ implausible_area_or_price: number;
444
+ repeated_listing: number;
445
+ outside_price_per_sqm_fence: number;
446
+ };
447
+ price_per_sqm_fence_sar: {
448
+ lower: number;
449
+ upper: unknown;
450
+ };
451
+ }[];
452
+ neighborhoods: {
453
+ neighborhood_id: number;
454
+ name_ar: string;
455
+ name_en: string;
456
+ center: unknown;
457
+ property_type: string;
458
+ sample_size: number;
459
+ median_rent_per_sqm_sar: unknown;
460
+ p25_rent_per_sqm_sar: unknown;
461
+ p75_rent_per_sqm_sar: unknown;
462
+ median_area_sqm: unknown;
463
+ median_rent_sar: unknown;
464
+ street_width: {
465
+ sample_size: number;
466
+ median_m: number | null;
467
+ };
468
+ }[];
469
+ window: {
470
+ updated_within_days: number;
471
+ from: string;
472
+ to: string;
473
+ };
474
+ };
475
+ }>;
476
+ /**
477
+ * Land prices per m². Median registered price per m² of land plots, per quarter,
478
+ * for a city, for each of up to 20 neighborhoods (`neighborhood_id`), or for
479
+ * every neighborhood in the city in one call (`group_by=neighborhood` without
480
+ * `neighborhood_id`, over at most 12 quarters), with quarter-on-quarter and
481
+ * year-on-year change.
482
+ */
483
+ readonly landPrices: (params: QueryOf<"market.land_prices">) => Promise<{
484
+ data: {
485
+ filters: {
486
+ city: string;
487
+ neighborhood_ids: unknown;
488
+ group_by: string;
489
+ land_use: string;
490
+ };
491
+ asset: string;
492
+ price_basis: string;
493
+ price_source: string;
494
+ window: {
495
+ quarter_from: string;
496
+ quarter_to: string;
497
+ };
498
+ min_sample_size: number;
499
+ series: {
500
+ neighborhood: unknown;
501
+ points: {
502
+ quarter: string;
503
+ period_start: string;
504
+ deal_count: number;
505
+ suppressed: boolean;
506
+ complete: boolean;
507
+ coverage_flag: import("./openapi-zod/models.js").CoverageFlag;
508
+ median_price_per_sqm_sar: unknown;
509
+ p25_price_per_sqm_sar: unknown;
510
+ p75_price_per_sqm_sar: unknown;
511
+ median_plot_area_sqm: unknown;
512
+ change_qoq_pct: number | null;
513
+ change_yoy_pct: number | null;
514
+ }[];
515
+ latest: unknown;
516
+ }[];
517
+ coverage: import("./openapi-zod/models.js").TransactionCoverage;
518
+ attribution: import("./openapi-zod/models.js").TransactionAttribution;
519
+ };
520
+ }>;
521
+ /**
522
+ * Prices by neighborhood. Median and quartile price per neighborhood in a city,
523
+ * most expensive first.
524
+ */
525
+ readonly neighborhoods: (params: QueryOf<"market.neighborhoods">) => Promise<{
526
+ data: {
527
+ filters: {
528
+ city: string;
529
+ listing_type: string;
530
+ listing_category: unknown;
531
+ property_type: string | null;
532
+ neighborhood_ids: unknown;
533
+ beds: unknown;
534
+ };
535
+ price_basis: string;
536
+ price_source: string;
537
+ min_sample_size: number;
538
+ neighborhoods: {
539
+ neighborhood_id: number;
540
+ name_ar: string;
541
+ name_en: string;
542
+ center: unknown;
543
+ sample_size: number;
544
+ median_price_sar: unknown;
545
+ p25_price_sar: unknown;
546
+ p75_price_sar: unknown;
547
+ median_price_per_sqm_sar: unknown;
548
+ }[];
549
+ suppressed_neighborhoods: number;
550
+ suppressed_sample_size: number;
551
+ window: {
552
+ updated_within_days: number;
553
+ from: string;
554
+ to: string;
555
+ };
556
+ };
557
+ }>;
558
+ /** Price distribution. Histogram and percentiles of price. */
559
+ readonly priceDistribution: (params: QueryOf<"market.price_distribution">) => Promise<{
560
+ data: {
561
+ filters: {
562
+ city: string;
563
+ listing_type: string;
564
+ listing_category: unknown;
565
+ property_type: string | null;
566
+ neighborhood_ids: unknown;
567
+ beds: unknown;
568
+ };
569
+ price_basis: string;
570
+ price_source: string;
571
+ sample_size: number;
572
+ median_price_sar: unknown;
573
+ mean_price_sar: unknown;
574
+ percentiles_sar: {
575
+ p10: unknown;
576
+ p25: unknown;
577
+ p75: unknown;
578
+ p90: unknown;
579
+ };
580
+ range_sar: {
581
+ min: number;
582
+ max: number;
583
+ };
584
+ buckets: {
585
+ min_sar: number;
586
+ max_sar: number;
587
+ count: number;
588
+ }[];
589
+ below_range_count: number;
590
+ above_range_count: number;
591
+ window: {
592
+ updated_within_days: number;
593
+ from: string;
594
+ to: string;
595
+ };
596
+ };
597
+ }>;
598
+ /**
599
+ * Market summary. Headline numbers for a city (or neighborhoods): listing count,
600
+ * median and quartile price, median area and price per m², how recently listings
601
+ * were updated, and breakdowns by property type, top neighborhoods by volume,
602
+ * and source. Computed over the market sample: active, deduplicated listings
603
+ * updated in the last 30 days (`updated_at`), after the same outlier filter
604
+ * kite.sa uses (per-tier price fences from the median and MAD of log price,
605
+ * bedroom and area sanity checks, and a floor at 30% of the neighborhood
606
+ * median).
607
+ */
608
+ readonly summary: (params: QueryOf<"market.summary">) => Promise<{
609
+ data: {
610
+ filters: {
611
+ city: string;
612
+ listing_type: string;
613
+ listing_category: unknown;
614
+ property_type: string | null;
615
+ neighborhood_ids: unknown;
616
+ beds: unknown;
617
+ };
618
+ price_basis: string;
619
+ price_source: string;
620
+ sample_size: number;
621
+ median_price_sar: unknown;
622
+ p25_price_sar: unknown;
623
+ p75_price_sar: unknown;
624
+ median_area_sqm: unknown;
625
+ median_price_per_sqm_sar: unknown;
626
+ area_sample_size: number;
627
+ updated_last_3_days: number;
628
+ updated_last_7_days: number;
629
+ by_property_type: {
630
+ property_type: string;
631
+ sample_size: number;
632
+ median_price_sar: unknown;
633
+ }[];
634
+ top_neighborhoods: {
635
+ neighborhood_id: number;
636
+ name_ar: string;
637
+ name_en: string;
638
+ sample_size: number;
639
+ median_price_sar: unknown;
640
+ }[];
641
+ sources: {
642
+ source: string;
643
+ count: number;
644
+ }[];
645
+ window: {
646
+ updated_within_days: number;
647
+ from: string;
648
+ to: string;
649
+ };
650
+ };
651
+ }>;
652
+ /**
653
+ * New supply. How many listings came onto the market recently: listings first
654
+ * seen in the last 7 days vs the 7 days before, and the last 30 days vs the 30
655
+ * days before (rolling windows ending now).
656
+ */
657
+ readonly supply: (params: QueryOf<"market.supply">) => Promise<{
658
+ data: {
659
+ filters: {
660
+ city: string;
661
+ listing_type: string;
662
+ listing_category: unknown;
663
+ property_type: string | null;
664
+ neighborhood_ids: unknown;
665
+ beds: unknown;
666
+ };
667
+ sample_size: number;
668
+ last_7_days: {
669
+ new_listings: number;
670
+ previous_new_listings: number;
671
+ change_pct: number | null;
672
+ };
673
+ last_30_days: {
674
+ new_listings: number;
675
+ previous_new_listings: number;
676
+ change_pct: number | null;
677
+ };
678
+ window: {
679
+ updated_within_days: number;
680
+ from: string;
681
+ to: string;
682
+ };
683
+ };
684
+ }>;
685
+ /**
686
+ * Registered deal statistics. Deal counts and median, 25th and 75th percentile
687
+ * price per m² and total price, per quarter and land-use class, for a city, a
688
+ * set of neighborhoods combined (`group_by=city` with `neighborhood_id`), or
689
+ * each neighborhood (`group_by=neighborhood`).
690
+ */
691
+ readonly transactions: (params: QueryOf<"market.transactions">) => Promise<{
692
+ data: {
693
+ filters: {
694
+ city: string;
695
+ neighborhood_ids: unknown;
696
+ group_by: string;
697
+ land_use: unknown;
698
+ };
699
+ price_basis: string;
700
+ price_source: string;
701
+ window: {
702
+ quarter_from: string;
703
+ quarter_to: string;
704
+ };
705
+ min_sample_size: number;
706
+ cells: {
707
+ quarter: string;
708
+ period_start: string;
709
+ neighborhood: unknown;
710
+ land_use: string;
711
+ deal_count: number;
712
+ suppressed: boolean;
713
+ complete: boolean;
714
+ coverage_flag: import("./openapi-zod/models.js").CoverageFlag;
715
+ median_price_per_sqm_sar: unknown;
716
+ p25_price_per_sqm_sar: unknown;
717
+ p75_price_per_sqm_sar: unknown;
718
+ price_per_sqm_sample_size: number;
719
+ median_price_sar: unknown;
720
+ p25_price_sar: unknown;
721
+ p75_price_sar: unknown;
722
+ median_area_sqm: unknown;
723
+ }[];
724
+ coverage: import("./openapi-zod/models.js").TransactionCoverage;
725
+ attribution: import("./openapi-zod/models.js").TransactionAttribution;
726
+ };
727
+ }>;
728
+ /**
729
+ * Vacancy indicator. How long listings in the sample have been on the market, as
730
+ * a proxy for vacancy (actual occupancy isn't observed).
731
+ */
732
+ readonly vacancy: (params: QueryOf<"market.vacancy">) => Promise<{
733
+ data: {
734
+ filters: {
735
+ city: string;
736
+ listing_type: string;
737
+ listing_category: unknown;
738
+ property_type: string | null;
739
+ neighborhood_ids: unknown;
740
+ beds: unknown;
741
+ };
742
+ sample_size: number;
743
+ median_days_on_market: unknown;
744
+ on_market_over_30_days: {
745
+ count: number;
746
+ pct: number | null;
747
+ };
748
+ on_market_over_60_days: {
749
+ count: number;
750
+ pct: number | null;
751
+ };
752
+ on_market_over_90_days: {
753
+ count: number;
754
+ pct: number | null;
755
+ };
756
+ window: {
757
+ updated_within_days: number;
758
+ from: string;
759
+ to: string;
760
+ };
761
+ };
762
+ }>;
763
+ };
764
+ readonly official: {
765
+ /**
766
+ * Kite Property Index. **Free on every plan (0 units).** Series built on Saudi
767
+ * open data are served under the Saudi Open Data License v2.0 with attribution:
768
+ * show `attribution.notice` wherever you display or pass on those figures. The
769
+ * Kite Property Index, as published: the series of a **published monthly
770
+ * release**, frozen when it was released.
771
+ */
772
+ readonly marketIndex: (params?: QueryOf<"official.market_index">) => Promise<{
773
+ data: {
774
+ release: {
775
+ slug: string;
776
+ revision: number;
777
+ published_at: string;
778
+ methodology_version: string;
779
+ revision_note: string | null;
780
+ headline: string | null;
781
+ url: string;
782
+ methodology_url: string;
783
+ };
784
+ available_releases: string[];
785
+ notes: string[];
786
+ series: {
787
+ series: string;
788
+ label: string;
789
+ metric: string;
790
+ statistic: string;
791
+ kind: string;
792
+ unit: string;
793
+ price_source: string;
794
+ property: string;
795
+ source_key: string;
796
+ source: string;
797
+ geography: string;
798
+ city: string | null;
799
+ granularity: string;
800
+ sample_unit: string;
801
+ min_sample_size: number;
802
+ withheld_periods: string[];
803
+ points: {
804
+ period: string;
805
+ period_start: string;
806
+ value: number;
807
+ sample_size: number;
808
+ coverage_flag: import("./openapi-zod/models.js").CoverageFlag;
809
+ }[];
810
+ }[];
811
+ attribution: unknown;
812
+ };
813
+ }>;
814
+ /**
815
+ * Registered rents (REGA). **Free on every plan (0 units).** This is Saudi open
816
+ * data, served at no charge under the Saudi Open Data License v2.0 with
817
+ * attribution: show `attribution.notice` wherever you display or pass on the
818
+ * figures. Registered rents from REGA's quarterly rent index ("مؤشر الايجار",
819
+ * published on open.data.gov.sa): for each neighborhood and property type, the
820
+ * **mean** yearly rent of the residential leases registered on Ejar that
821
+ * quarter, the mean yearly rent per m², and the number of contracts behind them.
822
+ * - **These are means, not medians.** REGA publishes the mean; a few large
823
+ * leases pull it up, so it usually sits above a median.
824
+ */
825
+ readonly registeredRents: (params: QueryOf<"official.registered_rents">) => Promise<{
826
+ data: {
827
+ filters: {
828
+ city: string;
829
+ neighborhood_ids: unknown;
830
+ property_types: string[];
831
+ };
832
+ period: {
833
+ label: string;
834
+ start: string;
835
+ end: string;
836
+ };
837
+ available_periods: string[];
838
+ price_source: string;
839
+ price_basis: string;
840
+ statistic: string;
841
+ min_sample_size: number;
842
+ cells: {
843
+ neighborhood_id: unknown;
844
+ neighborhood_name_ar: string;
845
+ neighborhood_name_en: string | null;
846
+ town_ar: string;
847
+ property_type: string;
848
+ property_type_ar: string;
849
+ contract_count: number;
850
+ mean_rent_sar: number;
851
+ mean_rent_per_sqm_sar: number | null;
852
+ source_url: string | null;
853
+ }[];
854
+ coverage: {
855
+ cells: number;
856
+ cells_served: number;
857
+ cells_withheld: number;
858
+ contracts: number;
859
+ contracts_withheld: number;
860
+ cells_served_with_neighborhood_id: number;
861
+ };
862
+ city_totals: {
863
+ property_type: string;
864
+ contract_count: number;
865
+ mean_rent_sar: unknown;
866
+ cells: number;
867
+ towns: number;
868
+ }[];
869
+ attribution: {
870
+ notice: string;
871
+ license: {
872
+ name: string;
873
+ url: string;
874
+ base_license: string;
875
+ base_license_url: string;
876
+ };
877
+ datasets: {
878
+ source: string;
879
+ title: string;
880
+ title_en: string;
881
+ publisher: string;
882
+ urls: string[];
883
+ }[];
884
+ };
885
+ };
886
+ }>;
887
+ };
888
+ readonly organization: {
889
+ readonly auditEvents: {
890
+ /** List audit events. Newest first, 50 per page. */
891
+ readonly list: (params?: QueryOf<"organization.audit_events.list">) => Promise<{
892
+ data: {
893
+ action: string;
894
+ target: string | null;
895
+ actor: string | null;
896
+ actor_key_id: string | null;
897
+ ip: string | null;
898
+ created_at: string;
899
+ }[];
900
+ pagination: {
901
+ next_cursor: string | null;
902
+ has_more: boolean;
903
+ };
904
+ }>;
905
+ };
906
+ /** Get your organization. Name, plan and limits, and this month's usage. */
907
+ readonly get: () => Promise<{
908
+ data: {
909
+ id: string;
910
+ name: string;
911
+ slug: string;
912
+ status: string;
913
+ plan: {
914
+ id: string;
915
+ name: string;
916
+ scopes: string[];
917
+ rate_limit_per_minute: number;
918
+ monthly_quota_units: unknown;
919
+ max_page_size: number;
920
+ max_active_keys: number;
921
+ };
922
+ usage: {
923
+ month_units: number;
924
+ resets_in_seconds: number;
925
+ };
926
+ };
927
+ }>;
928
+ readonly keys: {
929
+ /** Create a data key. Creates a `dk_live_…` key. */
930
+ readonly create: (body: BodyOf<"organization.keys.create">, headers?: HeaderOf<"organization.keys.create">) => Promise<{
931
+ data: {
932
+ id: string;
933
+ name: string;
934
+ key: string;
935
+ hint: string;
936
+ };
937
+ }>;
938
+ /** List data keys. Active data keys (`dk_live_…`). */
939
+ readonly list: () => Promise<{
940
+ data: {
941
+ id: string;
942
+ name: string;
943
+ hint: string;
944
+ project_id: string;
945
+ scopes: unknown;
946
+ expires_at: unknown;
947
+ created_at: string;
948
+ last_used_at: unknown;
949
+ }[];
950
+ }>;
951
+ /** Revoke a key. Requests with the key are rejected right away. */
952
+ readonly revoke: (keyId: string | number, headers?: HeaderOf<"organization.keys.revoke">) => Promise<{
953
+ data: {
954
+ id: string;
955
+ revoked: boolean;
956
+ };
957
+ }>;
958
+ };
959
+ readonly members: {
960
+ /**
961
+ * List members and invitations. Everyone with access to this organization and
962
+ * every invitation not yet accepted, with each person's role.
963
+ */
964
+ readonly list: () => Promise<{
965
+ data: {
966
+ members: {
967
+ email: string;
968
+ name: string | null;
969
+ role: string;
970
+ joined_at: string;
971
+ }[];
972
+ invitations: {
973
+ email: string;
974
+ role: string;
975
+ expires_at: string;
976
+ }[];
977
+ };
978
+ }>;
979
+ };
980
+ readonly projects: {
981
+ /** List projects. The projects this organization's keys belong to. */
982
+ readonly list: () => Promise<{
983
+ data: {
984
+ id: string;
985
+ name: string;
986
+ monthly_unit_cap: unknown;
987
+ active_keys: number;
988
+ month_units: number;
989
+ created_at: string;
990
+ }[];
991
+ }>;
992
+ };
993
+ readonly requestLogs: {
994
+ /**
995
+ * List request logs. Calls this organization made, newest first, within its
996
+ * retention window (7, 30 or 90 days, set on the Settings page).
997
+ */
998
+ readonly list: (params?: QueryOf<"organization.request_logs.list">) => Promise<{
999
+ data: {
1000
+ request_id: string | null;
1001
+ at: string;
1002
+ route: string;
1003
+ status: number;
1004
+ units: unknown;
1005
+ duration_ms: number;
1006
+ key_id: string | null;
1007
+ error: unknown;
1008
+ params: unknown;
1009
+ }[];
1010
+ pagination: import("./openapi-zod/models.js").Pagination;
1011
+ }>;
1012
+ };
1013
+ /**
1014
+ * Daily usage. Requests and units per UTC day, key, endpoint and result class,
1015
+ * for the last 7, 30 or 90 days.
1016
+ */
1017
+ readonly usage: (params?: QueryOf<"organization.usage">) => Promise<{
1018
+ data: {
1019
+ day: string;
1020
+ key_id: string | null;
1021
+ endpoint: string;
1022
+ status_class: number;
1023
+ requests: number;
1024
+ units: number;
1025
+ }[];
1026
+ }>;
1027
+ readonly webhooks: {
1028
+ /** Create a webhook endpoint. Subscribes an HTTPS URL to listing events. */
1029
+ readonly create: (body: BodyOf<"organization.webhooks.create">, headers?: HeaderOf<"organization.webhooks.create">) => Promise<{
1030
+ data: {
1031
+ id: string;
1032
+ url: string;
1033
+ event_types: string[];
1034
+ filters: Record<string, unknown>;
1035
+ description: string | null;
1036
+ status: string;
1037
+ disabled_reason: string | null;
1038
+ consecutive_failures: number;
1039
+ created_at: string;
1040
+ secret: string;
1041
+ };
1042
+ }>;
1043
+ /**
1044
+ * Delete a webhook endpoint. Stops delivery and removes the endpoint and its
1045
+ * delivery history.
1046
+ */
1047
+ readonly delete: (webhookId: string | number, headers?: HeaderOf<"organization.webhooks.delete">) => Promise<{
1048
+ data: {
1049
+ id: string;
1050
+ deleted: boolean;
1051
+ };
1052
+ }>;
1053
+ /**
1054
+ * List deliveries. What was sent to this endpoint, newest first, with what it
1055
+ * answered.
1056
+ */
1057
+ readonly deliveries: (webhookId: string | number, params?: QueryOf<"organization.webhooks.deliveries">) => Promise<{
1058
+ data: {
1059
+ id: number;
1060
+ event_id: string;
1061
+ event_type: string;
1062
+ status: string;
1063
+ attempts: number;
1064
+ response_status: unknown;
1065
+ response_snippet: string | null;
1066
+ next_attempt_at: unknown;
1067
+ delivered_at: unknown;
1068
+ created_at: string;
1069
+ }[];
1070
+ }>;
1071
+ /** List webhook endpoints. Every endpoint this organization has subscribed. */
1072
+ readonly list: () => Promise<{
1073
+ data: {
1074
+ id: string;
1075
+ url: string;
1076
+ event_types: string[];
1077
+ filters: Record<string, unknown>;
1078
+ description: string | null;
1079
+ status: string;
1080
+ disabled_reason: string | null;
1081
+ consecutive_failures: number;
1082
+ created_at: string;
1083
+ }[];
1084
+ }>;
1085
+ /**
1086
+ * Replay a delivery. Queues the same payload again, with its original
1087
+ * `event_id` so a receiver that already handled it can recognise the repeat.
1088
+ */
1089
+ readonly replay: (webhookId: string | number, deliveryId: string | number, headers?: HeaderOf<"organization.webhooks.replay">) => Promise<{
1090
+ data: {
1091
+ id: number;
1092
+ status: string;
1093
+ };
1094
+ }>;
1095
+ };
1096
+ };
1097
+ readonly projects: {
1098
+ /** List developers. Developers with active projects on Kite, most projects first. */
1099
+ readonly developers: (params?: QueryOf<"projects.developers">) => Promise<{
1100
+ data: {
1101
+ name: string;
1102
+ project_count: number;
1103
+ active_project_count: number;
1104
+ cities: string[];
1105
+ }[];
1106
+ pagination: import("./openapi-zod/models.js").Pagination;
1107
+ }>;
1108
+ /**
1109
+ * Get a project. One project with its description, boundary, amenities,
1110
+ * financing banks and a summary of the units listed on Kite.
1111
+ */
1112
+ readonly get: (id: string | number) => Promise<{
1113
+ data: {
1114
+ id: number;
1115
+ url: string | null;
1116
+ name_ar: string | null;
1117
+ name_en: string | null;
1118
+ developer: string | null;
1119
+ status: unknown;
1120
+ project_type: unknown;
1121
+ listing_category: string;
1122
+ location: {
1123
+ city: string | null;
1124
+ city_name_en: string | null;
1125
+ neighborhood_id: unknown;
1126
+ neighborhood_name_ar: string | null;
1127
+ neighborhood_name_en: string | null;
1128
+ lat: number | null;
1129
+ lng: number | null;
1130
+ };
1131
+ price: {
1132
+ starting_sar: unknown;
1133
+ from_sar: unknown;
1134
+ to_sar: unknown;
1135
+ };
1136
+ area_sqm: {
1137
+ min: number | null;
1138
+ max: number | null;
1139
+ };
1140
+ advertised_unit_count: unknown;
1141
+ last_seen_at: unknown;
1142
+ description: string | null;
1143
+ description_en: string | null;
1144
+ address: string | null;
1145
+ boundary: unknown;
1146
+ images: string[];
1147
+ features: string[];
1148
+ supported_banks: string[];
1149
+ warranty: {
1150
+ item: string;
1151
+ duration: string | null;
1152
+ }[];
1153
+ links: {
1154
+ brochure: string | null;
1155
+ virtual_tour: string | null;
1156
+ video: string | null;
1157
+ };
1158
+ source: {
1159
+ name: string;
1160
+ url: string | null;
1161
+ };
1162
+ linked_units: {
1163
+ count: number;
1164
+ for_sale: number;
1165
+ for_rent: number;
1166
+ bedrooms_min: unknown;
1167
+ bedrooms_max: unknown;
1168
+ area_sqm_min: number | null;
1169
+ area_sqm_max: number | null;
1170
+ sale_price_sar_min: unknown;
1171
+ sale_price_sar_max: unknown;
1172
+ yearly_rent_sar_min: unknown;
1173
+ yearly_rent_sar_max: unknown;
1174
+ };
1175
+ };
1176
+ }>;
1177
+ /**
1178
+ * Search projects. Off-plan and newly built residential and commercial projects
1179
+ * from Saudi developers and portals, one entry per project (copies from several
1180
+ * sources are merged).
1181
+ */
1182
+ readonly search: (params?: QueryOf<"projects.search">) => Promise<{
1183
+ data: {
1184
+ id: number;
1185
+ url: string | null;
1186
+ name_ar: string | null;
1187
+ name_en: string | null;
1188
+ developer: string | null;
1189
+ status: unknown;
1190
+ project_type: unknown;
1191
+ listing_category: string;
1192
+ location: {
1193
+ city: string | null;
1194
+ city_name_en: string | null;
1195
+ neighborhood_id: unknown;
1196
+ neighborhood_name_ar: string | null;
1197
+ neighborhood_name_en: string | null;
1198
+ lat: number | null;
1199
+ lng: number | null;
1200
+ };
1201
+ price: {
1202
+ starting_sar: unknown;
1203
+ from_sar: unknown;
1204
+ to_sar: unknown;
1205
+ };
1206
+ area_sqm: {
1207
+ min: number | null;
1208
+ max: number | null;
1209
+ };
1210
+ advertised_unit_count: unknown;
1211
+ linked_units: {
1212
+ count: number;
1213
+ bedrooms_min: unknown;
1214
+ bedrooms_max: unknown;
1215
+ };
1216
+ cover_image: string | null;
1217
+ last_seen_at: unknown;
1218
+ }[];
1219
+ pagination: import("./openapi-zod/models.js").Pagination;
1220
+ }>;
1221
+ /**
1222
+ * List a project's units. Active listings on Kite linked to one project: units
1223
+ * for sale (total price) and, for some projects, rentals (yearly rent).
1224
+ */
1225
+ readonly units: (id: string | number, params?: QueryOf<"projects.units">) => Promise<{
1226
+ data: {
1227
+ id: number;
1228
+ url: string;
1229
+ project: {
1230
+ id: number;
1231
+ name_ar: string | null;
1232
+ name_en: string | null;
1233
+ };
1234
+ link: {
1235
+ type: string;
1236
+ confidence: number;
1237
+ };
1238
+ title: string | null;
1239
+ listing_type: string;
1240
+ property_type: string;
1241
+ sale_price_sar: unknown;
1242
+ yearly_rent_sar: unknown;
1243
+ bedrooms: unknown;
1244
+ bathrooms: unknown;
1245
+ area_sqm: number | null;
1246
+ floor: string | null;
1247
+ location: {
1248
+ city: string | null;
1249
+ city_name_en: string | null;
1250
+ neighborhood_id: unknown;
1251
+ neighborhood_name_ar: string | null;
1252
+ neighborhood_name_en: string | null;
1253
+ lat: number | null;
1254
+ lng: number | null;
1255
+ };
1256
+ images: string[];
1257
+ source: {
1258
+ name: string;
1259
+ url: string | null;
1260
+ };
1261
+ first_seen_at: unknown;
1262
+ last_seen_at: unknown;
1263
+ }[];
1264
+ pagination: import("./openapi-zod/models.js").Pagination;
1265
+ }>;
1266
+ /**
1267
+ * Search project units. Units across all projects: active listings linked to a
1268
+ * project, filtered by the unit (bedrooms, price, area) and by its project
1269
+ * (city, developer, status).
1270
+ */
1271
+ readonly unitsSearch: (params?: QueryOf<"projects.units_search">) => Promise<{
1272
+ data: {
1273
+ id: number;
1274
+ url: string;
1275
+ project: {
1276
+ id: number;
1277
+ name_ar: string | null;
1278
+ name_en: string | null;
1279
+ };
1280
+ link: {
1281
+ type: string;
1282
+ confidence: number;
1283
+ };
1284
+ title: string | null;
1285
+ listing_type: string;
1286
+ property_type: string;
1287
+ sale_price_sar: unknown;
1288
+ yearly_rent_sar: unknown;
1289
+ bedrooms: unknown;
1290
+ bathrooms: unknown;
1291
+ area_sqm: number | null;
1292
+ floor: string | null;
1293
+ location: {
1294
+ city: string | null;
1295
+ city_name_en: string | null;
1296
+ neighborhood_id: unknown;
1297
+ neighborhood_name_ar: string | null;
1298
+ neighborhood_name_en: string | null;
1299
+ lat: number | null;
1300
+ lng: number | null;
1301
+ };
1302
+ images: string[];
1303
+ source: {
1304
+ name: string;
1305
+ url: string | null;
1306
+ };
1307
+ first_seen_at: unknown;
1308
+ last_seen_at: unknown;
1309
+ }[];
1310
+ pagination: import("./openapi-zod/models.js").Pagination;
1311
+ }>;
1312
+ };
1313
+ readonly reference: {
1314
+ /** List cities. Cities Kite covers. */
1315
+ readonly cities: () => Promise<{
1316
+ data: {
1317
+ slug: string;
1318
+ name_en: string;
1319
+ name_ar: string;
1320
+ }[];
1321
+ }>;
1322
+ /**
1323
+ * What the API covers. What the API can answer, per city: active listings by
1324
+ * listing type and kind of property, how many neighborhoods have at least 10 of
1325
+ * them, the share with a published nearby price band, the latest registered-deal
1326
+ * quarter and how much of it is placed in neighborhoods, and whether registered
1327
+ * rents exist.
1328
+ */
1329
+ readonly coverage: (params?: QueryOf<"reference.coverage">) => Promise<{
1330
+ data: {
1331
+ computed_at: string;
1332
+ cities: {
1333
+ city: string;
1334
+ name_en: string;
1335
+ name_ar: string;
1336
+ listings: {
1337
+ listing_type: string;
1338
+ property_family: string;
1339
+ property_types: string[];
1340
+ active_listings: number;
1341
+ neighborhoods_with_10_listings: number;
1342
+ price_band_ready_pct: number | null;
1343
+ }[];
1344
+ registered_deals: {
1345
+ latest_quarter: string | null;
1346
+ neighborhood_mapped_pct: number | null;
1347
+ mappable_deals: number;
1348
+ };
1349
+ registered_rents: {
1350
+ available: boolean;
1351
+ latest_quarter: string | null;
1352
+ };
1353
+ }[];
1354
+ };
1355
+ }>;
1356
+ /**
1357
+ * List city directions. Groupings of neighborhoods by part of the city (north,
1358
+ * east, …).
1359
+ */
1360
+ readonly directions: (city: string | number) => Promise<{
1361
+ data: {
1362
+ id: number;
1363
+ name_en: string;
1364
+ name_ar: string;
1365
+ neighborhood_ids: number[];
1366
+ }[];
1367
+ }>;
1368
+ /** List enumerated values. Allowed values for enumerated fields and filters. */
1369
+ readonly enums: () => Promise<{
1370
+ data: {
1371
+ listing_types: string[];
1372
+ listing_categories: string[];
1373
+ property_types: {
1374
+ residential: string[];
1375
+ commercial: string[];
1376
+ };
1377
+ rent_frequencies: string[];
1378
+ advertiser_types: string[];
1379
+ amenities: string[];
1380
+ project_features: string[];
1381
+ project_banks: string[];
1382
+ sources: {
1383
+ id: string;
1384
+ name: string;
1385
+ }[];
1386
+ };
1387
+ }>;
1388
+ /**
1389
+ * Get this key's limits. The plan, rate limit, monthly quota, page size and
1390
+ * paging depth that apply to the key making the request, and the APIs it can
1391
+ * reach.
1392
+ */
1393
+ readonly limits: () => Promise<{
1394
+ data: {
1395
+ plan: string;
1396
+ scopes: string[];
1397
+ rate_limit_per_minute: number;
1398
+ monthly_quota_units: unknown;
1399
+ max_page_size: number;
1400
+ max_result_depth: number;
1401
+ };
1402
+ }>;
1403
+ /** List neighborhoods. Active neighborhoods in a city. */
1404
+ readonly neighborhoods: (city: string | number) => Promise<{
1405
+ data: {
1406
+ id: number;
1407
+ slug: string;
1408
+ name_ar: string;
1409
+ name_en: string;
1410
+ direction_id: unknown;
1411
+ center: unknown;
1412
+ }[];
1413
+ }>;
1414
+ };
1415
+ readonly transactions: {
1416
+ /**
1417
+ * Search registered deals. Individual sale deals registered with the Ministry of
1418
+ * Justice, from its quarterly open data, in one city: month, neighborhood,
1419
+ * land-use class, area, price and price per m².
1420
+ */
1421
+ readonly search: (params: QueryOf<"transactions.search">) => Promise<{
1422
+ data: import("./openapi-zod/models.js").Transaction[];
1423
+ pagination: import("./openapi-zod/models.js").Pagination;
1424
+ price_basis: string;
1425
+ price_source: string;
1426
+ coverage: import("./openapi-zod/models.js").TransactionCoverage;
1427
+ attribution: import("./openapi-zod/models.js").TransactionAttribution;
1428
+ }>;
1429
+ };
1430
+ };
1431
+ export type Endpoints = ReturnType<typeof createEndpoints>;
1432
+ export {};